Merge pull request #4220 from Spacetech/TvdbEpisodeImageProvider_nullable_check

Fix invalid operation exception in TvdbEpisodeImageProvider.GetImages
pull/4243/head
dkanada 4 years ago committed by GitHub
commit c94d774ee7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -56,6 +56,10 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
{ {
// Process images // Process images
try try
{
string episodeTvdbId = null;
if (episode.IndexNumber.HasValue && episode.ParentIndexNumber.HasValue)
{ {
var episodeInfo = new EpisodeInfo var episodeInfo = new EpisodeInfo
{ {
@ -64,14 +68,17 @@ namespace MediaBrowser.Providers.Plugins.TheTvdb
SeriesProviderIds = series.ProviderIds, SeriesProviderIds = series.ProviderIds,
SeriesDisplayOrder = series.DisplayOrder SeriesDisplayOrder = series.DisplayOrder
}; };
string episodeTvdbId = await _tvdbClientManager
episodeTvdbId = await _tvdbClientManager
.GetEpisodeTvdbId(episodeInfo, language, cancellationToken).ConfigureAwait(false); .GetEpisodeTvdbId(episodeInfo, language, cancellationToken).ConfigureAwait(false);
}
if (string.IsNullOrEmpty(episodeTvdbId)) if (string.IsNullOrEmpty(episodeTvdbId))
{ {
_logger.LogError( _logger.LogError(
"Episode {SeasonNumber}x{EpisodeNumber} not found for series {SeriesTvdbId}", "Episode {SeasonNumber}x{EpisodeNumber} not found for series {SeriesTvdbId}",
episodeInfo.ParentIndexNumber, episode.ParentIndexNumber,
episodeInfo.IndexNumber, episode.IndexNumber,
series.GetProviderId(MetadataProvider.Tvdb)); series.GetProviderId(MetadataProvider.Tvdb));
return imageResult; return imageResult;
} }

Loading…
Cancel
Save