Fix missing episodes query for seasons

This commit is contained in:
Shadowghost 2024-05-30 20:26:26 +02:00
parent ae584beaac
commit e099fd6141

View File

@ -287,9 +287,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();
@ -386,10 +390,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);