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

Don't force non-virtual when all episodes in season are isMissing=true

Original-merge: be949af59e

Merged-by: Bond-009 <bond.009@outlook.com>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
This commit is contained in:
scampower3 2024-08-25 02:46:34 -04:00 committed by Joshua M. Boniface
parent bdb2d81687
commit 1ca2c4b4e1

View File

@ -211,8 +211,12 @@ namespace MediaBrowser.Providers.TV
}
else if (existingSeason.IsVirtualItem)
{
existingSeason.IsVirtualItem = false;
await existingSeason.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
var episodeCount = seriesChildren.OfType<Episode>().Count(e => e.ParentIndexNumber == seasonNumber && !e.IsMissingEpisode);
if (episodeCount > 0)
{
existingSeason.IsVirtualItem = false;
await existingSeason.UpdateToRepositoryAsync(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
}
}
}
}