diff options
| author | Bond_009 <bond.009@outlook.com> | 2022-12-05 15:01:13 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2022-12-05 15:01:13 +0100 |
| commit | 52194f56b5f07e3ae01e2fb6d121452e37d1e93f (patch) | |
| tree | fd638972f72ec49734ad07f831a3aae3b2501a1d /Emby.Server.Implementations/TV/TVSeriesManager.cs | |
| parent | c7d50d640e614a3c13699e3041fbfcb258861c5a (diff) | |
Replace != null with is not null
Diffstat (limited to 'Emby.Server.Implementations/TV/TVSeriesManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/TV/TVSeriesManager.cs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs index 57fa57c59..967f90b55 100644 --- a/Emby.Server.Implementations/TV/TVSeriesManager.cs +++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs @@ -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); |
