Replace != null with is not null

This commit is contained in:
Bond_009
2022-12-05 15:01:13 +01:00
parent c7d50d640e
commit 52194f56b5
218 changed files with 928 additions and 928 deletions

View File

@@ -81,7 +81,7 @@ namespace Emby.Server.Implementations.Images
{
var image = item.GetImageInfo(imageType, 0);
if (image != null)
if (image is not null)
{
if (!image.IsLocalFile)
{
@@ -143,20 +143,20 @@ namespace Emby.Server.Implementations.Images
if (useBackdrop)
{
var backdrop = i.GetImageInfo(ImageType.Backdrop, 0);
if (backdrop != null && backdrop.IsLocalFile)
if (backdrop is not null && backdrop.IsLocalFile)
{
return backdrop.Path;
}
}
var image = i.GetImageInfo(ImageType.Primary, 0);
if (image != null && image.IsLocalFile)
if (image is not null && image.IsLocalFile)
{
return image.Path;
}
image = i.GetImageInfo(ImageType.Thumb, 0);
if (image != null && image.IsLocalFile)
if (image is not null && image.IsLocalFile)
{
return image.Path;
}
@@ -268,7 +268,7 @@ namespace Emby.Server.Implementations.Images
{
var image = item.GetImageInfo(type, 0);
if (image != null)
if (image is not null)
{
if (!image.IsLocalFile)
{

View File

@@ -52,7 +52,7 @@ namespace Emby.Server.Implementations.Images
if (i is Episode episode)
{
var series = episode.Series;
if (series != null)
if (series is not null)
{
return series;
}
@@ -63,7 +63,7 @@ namespace Emby.Server.Implementations.Images
if (i is Season season)
{
var series = season.Series;
if (series != null)
if (series is not null)
{
return series;
}
@@ -74,7 +74,7 @@ namespace Emby.Server.Implementations.Images
if (i is Audio audio)
{
var album = audio.AlbumEntity;
if (album != null && album.HasImage(ImageType.Primary))
if (album is not null && album.HasImage(ImageType.Primary))
{
return album;
}

View File

@@ -34,7 +34,7 @@ namespace Emby.Server.Implementations.Images
if (subItem is Episode episode)
{
var series = episode.Series;
if (series != null && series.HasImage(ImageType.Primary))
if (series is not null && series.HasImage(ImageType.Primary))
{
return series;
}
@@ -47,7 +47,7 @@ namespace Emby.Server.Implementations.Images
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)
{
@@ -57,7 +57,7 @@ namespace Emby.Server.Implementations.Images
return null;
})
.Where(i => i != null)
.Where(i => i is not null)
.GroupBy(x => x.Id)
.Select(x => x.First())
.ToList();