Merge pull request #3250 from shayaantx/master

Ignore languages with null ids when fetching images from tvdb
This commit is contained in:
dkanada 2020-06-07 14:50:46 +09:00 committed by GitHub
commit 686066b134
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -89,7 +89,8 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
private IEnumerable<RemoteImageInfo> GetImages(Image[] images, string preferredLanguage)
{
var list = new List<RemoteImageInfo>();
var languages = _tvdbClientManager.GetLanguagesAsync(CancellationToken.None).Result.Data;
// any languages with null ids are ignored
var languages = _tvdbClientManager.GetLanguagesAsync(CancellationToken.None).Result.Data.Where(x => x.Id.HasValue);
foreach (Image image in images)
{
var imageInfo = new RemoteImageInfo