Ignore languages with null ids

pull/3250/head
shayaantx 5 years ago
parent 0b0184de2e
commit 4623cb8385

@ -20,7 +20,7 @@
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.4" /> <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="3.1.4" />
<PackageReference Include="OptimizedPriorityQueue" Version="4.2.0" /> <PackageReference Include="OptimizedPriorityQueue" Version="4.2.0" />
<PackageReference Include="PlaylistsNET" Version="1.0.4" /> <PackageReference Include="PlaylistsNET" Version="1.0.4" />
<PackageReference Include="TvDbSharper" Version="3.0.1" /> <PackageReference Include="TvDbSharper" Version="3.2.0" />
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>

@ -90,6 +90,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
{ {
var list = new List<RemoteImageInfo>(); var list = new List<RemoteImageInfo>();
var languages = _tvdbClientManager.GetLanguagesAsync(CancellationToken.None).Result.Data; var languages = _tvdbClientManager.GetLanguagesAsync(CancellationToken.None).Result.Data;
// any languages with null ids are ignored
languages = Array.FindAll(languages, language => language.Id != null);
foreach (Image image in images) foreach (Image image in images)
{ {
var imageInfo = new RemoteImageInfo var imageInfo = new RemoteImageInfo

Loading…
Cancel
Save