diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2020-07-16 16:30:55 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-16 16:30:55 -0400 |
| commit | 55dafd41495c2b8821ae059eeaa97d7b32b7dc17 (patch) | |
| tree | 53abee5459c10eef09690b42f26e52f626dedcd6 | |
| parent | 0c64ad9b1634d37c09d1160411eb75f98f7a47ce (diff) | |
| parent | 90fa1149fa8d7b770c91fd881bf150fd3fec521e (diff) | |
Merge pull request #3563 from cvium/fix_next_up
Only fetch Next Up for episodes that have been fully matched
| -rw-r--r-- | Emby.Server.Implementations/TV/TVSeriesManager.cs | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/Emby.Server.Implementations/TV/TVSeriesManager.cs b/Emby.Server.Implementations/TV/TVSeriesManager.cs index 21c12ae79..d1818deff 100644 --- a/Emby.Server.Implementations/TV/TVSeriesManager.cs +++ b/Emby.Server.Implementations/TV/TVSeriesManager.cs @@ -117,23 +117,20 @@ namespace Emby.Server.Implementations.TV limit = 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 - { - Fields = new ItemFields[] + var items = _libraryManager + .GetItemList( + new InternalItemsQuery(user) { - 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.SeriesPresentationUniqueKey }, EnableImages = false }, + GroupBySeriesPresentationUniqueKey = true + }, parentsFolders.ToList()) + .Cast<Episode>() + .Where(episode => !string.IsNullOrEmpty(episode.SeriesPresentationUniqueKey)) + .Select(GetUniqueSeriesKey); // Avoid implicitly captured closure var episodes = GetNextUpEpisodes(request, user, items, dtoOptions); |
