mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 18:53:27 +01:00
Replace != null with is not null
This commit is contained in:
@@ -59,7 +59,7 @@ namespace Emby.Server.Implementations.Collections
|
||||
var episode = subItem as Episode;
|
||||
|
||||
var series = episode?.Series;
|
||||
if (series != null && series.HasImage(ImageType.Primary))
|
||||
if (series is not null && series.HasImage(ImageType.Primary))
|
||||
{
|
||||
return series;
|
||||
}
|
||||
@@ -71,7 +71,7 @@ namespace Emby.Server.Implementations.Collections
|
||||
|
||||
var parent = subItem.GetOwner() ?? subItem.GetParent();
|
||||
|
||||
if (parent != null && parent.HasImage(ImageType.Primary))
|
||||
if (parent is not null && parent.HasImage(ImageType.Primary))
|
||||
{
|
||||
if (parent is MusicAlbum)
|
||||
{
|
||||
@@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.Collections
|
||||
|
||||
return null;
|
||||
})
|
||||
.Where(i => i != null)
|
||||
.Where(i => i is not null)
|
||||
.GroupBy(x => x!.Id) // We removed the null values
|
||||
.Select(x => x.First())
|
||||
.ToList()!; // Again... the list doesn't contain any null values
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.Collections
|
||||
internal async Task<Folder?> EnsureLibraryFolder(string path, bool createIfNeeded)
|
||||
{
|
||||
var existingFolder = FindFolders(path).FirstOrDefault();
|
||||
if (existingFolder != null)
|
||||
if (existingFolder is not null)
|
||||
{
|
||||
return existingFolder;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ namespace Emby.Server.Implementations.Collections
|
||||
{
|
||||
var childItem = _libraryManager.GetItemById(guidId);
|
||||
|
||||
var child = collection.LinkedChildren.FirstOrDefault(i => (i.ItemId.HasValue && i.ItemId.Value.Equals(guidId)) || (childItem != null && string.Equals(childItem.Path, i.Path, StringComparison.OrdinalIgnoreCase)));
|
||||
var child = collection.LinkedChildren.FirstOrDefault(i => (i.ItemId.HasValue && i.ItemId.Value.Equals(guidId)) || (childItem is not null && string.Equals(childItem.Path, i.Path, StringComparison.OrdinalIgnoreCase)));
|
||||
|
||||
if (child is null)
|
||||
{
|
||||
@@ -275,7 +275,7 @@ namespace Emby.Server.Implementations.Collections
|
||||
|
||||
list.Add(child);
|
||||
|
||||
if (childItem != null)
|
||||
if (childItem is not null)
|
||||
{
|
||||
itemList.Add(childItem);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user