diff --git a/NzbDrone.Core.Test/IndexerTests.cs b/NzbDrone.Core.Test/IndexerTests.cs index 97da632b4..6daec9ebd 100644 --- a/NzbDrone.Core.Test/IndexerTests.cs +++ b/NzbDrone.Core.Test/IndexerTests.cs @@ -209,6 +209,8 @@ public void nzbsorg_search_returns_valid_results(string title, int season, int e ExceptionVerification.MarkInconclusive(typeof(WebException)); result.Should().NotBeEmpty(); + result.Should().OnlyContain(r => r.SeasonNumber == season); + result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(episode)); result.Should().OnlyContain(r => r.CleanTitle == Parser.NormalizeTitle(title)); result.Should().Contain(r => r.SeasonNumber == season && r.EpisodeNumbers.Contains(episode)); } diff --git a/NzbDrone.Core/Providers/Indexer/IndexerBase.cs b/NzbDrone.Core/Providers/Indexer/IndexerBase.cs index a24d3bef7..be285c1a2 100644 --- a/NzbDrone.Core/Providers/Indexer/IndexerBase.cs +++ b/NzbDrone.Core/Providers/Indexer/IndexerBase.cs @@ -115,7 +115,8 @@ public virtual IList FetchPartialSeason(string seriesTitle, var result = Fetch(searchUrls); - result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle)).ToList(); + result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle) && + e.SeasonNumber == seasonNumber).ToList(); _logger.Info("Finished searching {0} for {1}-S{2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count); return result; @@ -129,7 +130,9 @@ public virtual IList FetchEpisode(string seriesTitle, int se var result = Fetch(searchUrls); - result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle)).ToList(); + result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle) && + e.SeasonNumber == seasonNumber && e.EpisodeNumbers.Contains(episodeNumber)) + .ToList(); _logger.Info("Finished searching {0} for {1}-S{2}E{3:00}, Found {4}", Name, seriesTitle, seasonNumber, episodeNumber, result.Count); return result; @@ -144,7 +147,8 @@ public virtual IList FetchDailyEpisode(string seriesTitle, D var result = Fetch(searchUrls); - result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle)).ToList(); + result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle) && + e.AirDate.HasValue && e.AirDate.Value.Date == airDate.Date).ToList(); _logger.Info("Finished searching {0} for {1}-{2}, Found {3}", Name, seriesTitle, airDate.ToShortDateString(), result.Count); return result;