Merge pull request #12425 from scampower3/10.9.z-dont-force-virtual

Don't force non-virtual when all episodes in season are isMissing=true
This commit is contained in:
Bond-009 2024-08-14 16:10:30 +02:00 committed by GitHub
commit be949af59e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -210,12 +210,16 @@ namespace MediaBrowser.Providers.TV
await CreateSeasonAsync(series, seasonName, seasonNumber, cancellationToken).ConfigureAwait(false);
}
else if (existingSeason.IsVirtualItem)
{
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);
}
}
}
}
/// <summary>
/// Creates a new season, adds it to the database by linking it to the [series] and refreshes the metadata.