Backport pull request #11882 from jellyfin/release-10.9.z

Fix missing episodes query for seasons

Original-merge: 8e979bdb4b

Merged-by: joshuaboniface <joshua@boniface.me>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
Shadowghost 2024-06-01 18:41:11 -04:00 committed by Joshua M. Boniface
parent 4035f6aa21
commit c1032967c2

View File

@ -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<Episode>().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);