From c1032967c2c58db90c547984d0d563c79cf6b540 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Sat, 1 Jun 2024 18:41:11 -0400 Subject: [PATCH] Backport pull request #11882 from jellyfin/release-10.9.z Fix missing episodes query for seasons Original-merge: 8e979bdb4bd33fb152a351c4f42d5d0542bad98c Merged-by: joshuaboniface Backported-by: Joshua M. Boniface --- MediaBrowser.Controller/Entities/TV/Series.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index 76fe7389e9..d704208cde 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -261,9 +261,13 @@ namespace MediaBrowser.Controller.Entities.TV IncludeItemTypes = new[] { BaseItemKind.Episode, BaseItemKind.Season }, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) }, DtoOptions = options, - IsMissing = shouldIncludeMissingEpisodes }; + if (!shouldIncludeMissingEpisodes) + { + query.IsMissing = false; + } + var allItems = LibraryManager.GetItemList(query); var allSeriesEpisodes = allItems.OfType().ToList(); @@ -359,10 +363,14 @@ namespace MediaBrowser.Controller.Entities.TV SeriesPresentationUniqueKey = queryFromSeries ? seriesKey : null, IncludeItemTypes = new[] { BaseItemKind.Episode }, OrderBy = new[] { (ItemSortBy.SortName, SortOrder.Ascending) }, - DtoOptions = options, - IsMissing = shouldIncludeMissingEpisodes + DtoOptions = options }; + if (!shouldIncludeMissingEpisodes) + { + query.IsMissing = false; + } + var allItems = LibraryManager.GetItemList(query); return GetSeasonEpisodes(parentSeason, user, allItems, options, shouldIncludeMissingEpisodes);