Merge pull request #6923 from cvium/query_a_bit_less

pull/5894/head
Bond-009 3 years ago committed by GitHub
commit 2a09d4244c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -130,11 +130,12 @@ namespace MediaBrowser.Providers.TV
/// <returns>The async task.</returns> /// <returns>The async task.</returns>
private async Task FillInMissingSeasonsAsync(Series series, CancellationToken cancellationToken) private async Task FillInMissingSeasonsAsync(Series series, CancellationToken cancellationToken)
{ {
var episodesInSeriesFolder = series.GetRecursiveChildren(i => i is Episode) var seriesChildren = series.GetRecursiveChildren(i => i is Episode || i is Season);
.Cast<Episode>() var episodesInSeriesFolder = seriesChildren
.OfType<Episode>()
.Where(i => !i.IsInSeasonFolder); .Where(i => !i.IsInSeasonFolder);
List<Season> seasons = series.Children.OfType<Season>().ToList(); List<Season> seasons = seriesChildren.OfType<Season>().ToList();
// Loop through the unique season numbers // Loop through the unique season numbers
foreach (var episode in episodesInSeriesFolder) foreach (var episode in episodesInSeriesFolder)

Loading…
Cancel
Save