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

Loading…
Cancel
Save