diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index f22944a8b6..d69e6330bb 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 e5287048dc..4269d34201 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 10ed4f0731..72ceadaf1d 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()); } ///