diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f22944a8b..d69e6330b 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -30,6 +30,7 @@ - [Khinenw](https://github.com/HelloWorld017) - [fhriley](https://github.com/fhriley) - [nevado](https://github.com/nevado) + - [mark-monteiro](https://github.com/mark-monteiro) # Emby Contributors diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs index e5287048d..4269d3420 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeProvider.cs @@ -35,9 +35,8 @@ namespace MediaBrowser.Providers.TV.TheTVDB { var list = new List(); - // The search query must either provide an episode number or date - if (!searchInfo.IndexNumber.HasValue - || !searchInfo.PremiereDate.HasValue + // Either an episode number or date must be provided; and the dictionary of provider ids must be valid + if ((searchInfo.IndexNumber == null && searchInfo.PremiereDate == null) || !TvdbSeriesProvider.IsValidSeries(searchInfo.SeriesProviderIds)) { return list; diff --git a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs index 10ed4f073..72ceadaf1 100644 --- a/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs +++ b/MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs @@ -170,11 +170,16 @@ namespace MediaBrowser.Providers.TV.TheTVDB return result?.Data.First().Id.ToString(); } + /// + /// Check whether a dictionary of provider IDs includes an entry for a valid TV metadata provider. + /// + /// The dictionary to check. + /// True, if the dictionary contains a valid TV provider ID, otherwise false. internal static bool IsValidSeries(Dictionary seriesProviderIds) { - return seriesProviderIds.TryGetValue(MetadataProviders.Tvdb.ToString(), out _) || - seriesProviderIds.TryGetValue(MetadataProviders.Imdb.ToString(), out _) || - seriesProviderIds.TryGetValue(MetadataProviders.Zap2It.ToString(), out _); + return seriesProviderIds.ContainsKey(MetadataProviders.Tvdb.ToString()) || + seriesProviderIds.ContainsKey(MetadataProviders.Imdb.ToString()) || + seriesProviderIds.ContainsKey(MetadataProviders.Zap2It.ToString()); } ///