The Free Software Media System - Server Backend & API
Only fetch Next Up for episodes that have been fully matched
Claus Viuma23920e2ad45
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.csindex 21c12ae79f..552c9d1c1a 100644--- a/Emby.Server.Implementations/TV/TVSeriesManager.cs+++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs@@ -117,23 +117,19 @@ namespace Emby.Server.Implementations.TVlimit = limit.Value + 10;}- var items = _libraryManager.GetItemList(new InternalItemsQuery(user)- {- IncludeItemTypes = new[] { typeof(Episode).Name },- OrderBy = new[] { new ValueTuple<string, SortOrder>(ItemSortBy.DatePlayed, SortOrder.Descending) },- SeriesPresentationUniqueKey = presentationUniqueKey,- Limit = limit,- DtoOptions = new DtoOptions+ var items = _libraryManager+ .GetItemList(new InternalItemsQuery(user){- Fields = new ItemFields[]- {- ItemFields.SeriesPresentationUniqueKey- },- EnableImages = false- },- GroupBySeriesPresentationUniqueKey = true-- }, parentsFolders.ToList()).Cast<Episode>().Select(GetUniqueSeriesKey);+ IncludeItemTypes = new[] {typeof(Episode).Name},+ OrderBy = new[] {new ValueTuple<string, SortOrder>(ItemSortBy.DatePlayed, SortOrder.Descending)},+ SeriesPresentationUniqueKey = presentationUniqueKey,+ Limit = limit,+ DtoOptions = new DtoOptions {Fields = new ItemFields[] {ItemFields.SeriesPresentationUniqueKey}, EnableImages = false},+ GroupBySeriesPresentationUniqueKey = true+ }, parentsFolders.ToList())+ .Cast<Episode>()+ .Where(episode => !string.IsNullOrEmpty(episode.SeriesPresentationUniqueKey))+ .Select(GetUniqueSeriesKey);// Avoid implicitly captured closurevar episodes = GetNextUpEpisodes(request, user, items, dtoOptions);