Use Task.WhenAll properly

This commit is contained in:
Claus Vium 2019-02-12 21:44:10 +01:00
parent 5e2e190f3e
commit 1aaa8de1f9

View File

@ -65,9 +65,9 @@ namespace MediaBrowser.Providers.People
.Where(i => TvdbSeriesProvider.IsValidSeries(i.ProviderIds))
.ToList();
var infos = await Task.WhenAll(seriesWithPerson.Select(async i => await GetImageFromSeriesData(i, item.Name, cancellationToken))
var infos = (await Task.WhenAll(seriesWithPerson.Select(async i => await GetImageFromSeriesData(i, item.Name, cancellationToken))))
.Where(i => i != null)
.Take(1));
.Take(1);
return infos;
}