mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 19:23:38 +01:00
Replace != null with is not null
This commit is contained in:
@@ -62,7 +62,7 @@ namespace Emby.Server.Implementations.TV
|
||||
{
|
||||
var parent = _libraryManager.GetItemById(query.ParentId.Value);
|
||||
|
||||
if (parent != null)
|
||||
if (parent is not null)
|
||||
{
|
||||
parents = new[] { parent };
|
||||
}
|
||||
@@ -168,7 +168,7 @@ namespace Emby.Server.Implementations.TV
|
||||
return !anyFound && i.LastWatchedDate == DateTime.MinValue;
|
||||
})
|
||||
.Select(i => i.GetEpisodeFunction())
|
||||
.Where(i => i != null);
|
||||
.Where(i => i is not null);
|
||||
}
|
||||
|
||||
private static string GetUniqueSeriesKey(Episode episode)
|
||||
@@ -247,23 +247,23 @@ namespace Emby.Server.Implementations.TV
|
||||
DtoOptions = dtoOptions
|
||||
})
|
||||
.Cast<Episode>()
|
||||
.Where(episode => episode.AirsBeforeSeasonNumber != null || episode.AirsAfterSeasonNumber != null)
|
||||
.Where(episode => episode.AirsBeforeSeasonNumber is not null || episode.AirsAfterSeasonNumber is not null)
|
||||
.ToList();
|
||||
|
||||
if (lastWatchedEpisode != null)
|
||||
if (lastWatchedEpisode is not null)
|
||||
{
|
||||
// Last watched episode is added, because there could be specials that aired before the last watched episode
|
||||
consideredEpisodes.Add(lastWatchedEpisode);
|
||||
}
|
||||
|
||||
if (nextEpisode != null)
|
||||
if (nextEpisode is not null)
|
||||
{
|
||||
consideredEpisodes.Add(nextEpisode);
|
||||
}
|
||||
|
||||
var sortedConsideredEpisodes = _libraryManager.Sort(consideredEpisodes, user, new[] { (ItemSortBy.AiredEpisodeOrder, SortOrder.Ascending) })
|
||||
.Cast<Episode>();
|
||||
if (lastWatchedEpisode != null)
|
||||
if (lastWatchedEpisode is not null)
|
||||
{
|
||||
sortedConsideredEpisodes = sortedConsideredEpisodes.SkipWhile(episode => !episode.Id.Equals(lastWatchedEpisode.Id)).Skip(1);
|
||||
}
|
||||
@@ -271,7 +271,7 @@ namespace Emby.Server.Implementations.TV
|
||||
nextEpisode = sortedConsideredEpisodes.FirstOrDefault();
|
||||
}
|
||||
|
||||
if (nextEpisode != null)
|
||||
if (nextEpisode is not null)
|
||||
{
|
||||
var userData = _userDataManager.GetUserData(user, nextEpisode);
|
||||
|
||||
@@ -284,7 +284,7 @@ namespace Emby.Server.Implementations.TV
|
||||
return nextEpisode;
|
||||
}
|
||||
|
||||
if (lastWatchedEpisode != null)
|
||||
if (lastWatchedEpisode is not null)
|
||||
{
|
||||
var userData = _userDataManager.GetUserData(user, lastWatchedEpisode);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user