1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-10 04:52:42 +01:00

Fixed issues with searching and the results being filtered before the SearchProvider could properly handle them.

This commit is contained in:
Mark McDowall 2012-01-23 12:25:14 -08:00
parent 413991485f
commit fb17765d3a
2 changed files with 0 additions and 27 deletions

View File

@ -202,10 +202,6 @@ public void nzbsorg_search_returns_valid_results(string title, int season, int e
Mark500Inconclusive(); Mark500Inconclusive();
result.Should().NotBeEmpty(); 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));
} }
[TestCase("simpsons", 21, 23)] [TestCase("simpsons", 21, 23)]
@ -227,9 +223,6 @@ public void newzbin_search_returns_valid_results(string title, int season, int e
Mark500Inconclusive(); Mark500Inconclusive();
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().OnlyContain(r => r.CleanTitle == Parser.NormalizeTitle(title));
result.Should().OnlyContain(r => r.SeasonNumber == season);
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(episode));
} }
[Test] [Test]
@ -250,17 +243,12 @@ public void nzbmatrix_search_returns_valid_results()
Mark500Inconclusive(); Mark500Inconclusive();
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().OnlyContain(r => r.CleanTitle == "simpsons");
result.Should().OnlyContain(r => r.SeasonNumber == 21);
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(23));
} }
[Test] [Test]
public void nzbmatrix_multi_word_search_returns_valid_results() public void nzbmatrix_multi_word_search_returns_valid_results()
{ {
Mocker.GetMock<ConfigProvider>() Mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NzbMatrixUsername) .SetupGet(c => c.NzbMatrixUsername)
.Returns(""); .Returns("");
@ -276,9 +264,6 @@ public void nzbmatrix_multi_word_search_returns_valid_results()
Mark500Inconclusive(); Mark500Inconclusive();
result.Should().NotBeEmpty(); result.Should().NotBeEmpty();
result.Should().OnlyContain(r => r.CleanTitle == "bluebloods");
result.Should().OnlyContain(r => r.SeasonNumber == 1);
result.Should().OnlyContain(r => r.EpisodeNumbers.Contains(19));
} }

View File

@ -100,8 +100,6 @@ public virtual IList<EpisodeParseResult> FetchSeason(string seriesTitle, int sea
var searchUrls = GetSeasonSearchUrls(GetQueryTitle(seriesTitle), seasonNumber); var searchUrls = GetSeasonSearchUrls(GetQueryTitle(seriesTitle), seasonNumber);
var result = Fetch(searchUrls); var result = Fetch(searchUrls);
result = result.Where(e => e.CleanTitle == Parser.NormalizeTitle(seriesTitle)).ToList();
_logger.Info("Finished searching {0} for {1}-S{2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count); _logger.Info("Finished searching {0} for {1}-S{2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count);
return result; return result;
} }
@ -115,9 +113,6 @@ public virtual IList<EpisodeParseResult> FetchPartialSeason(string seriesTitle,
var result = Fetch(searchUrls); var result = Fetch(searchUrls);
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); _logger.Info("Finished searching {0} for {1}-S{2}, Found {3}", Name, seriesTitle, seasonNumber, result.Count);
return result; return result;
} }
@ -130,10 +125,6 @@ public virtual IList<EpisodeParseResult> FetchEpisode(string seriesTitle, int se
var result = Fetch(searchUrls); var result = Fetch(searchUrls);
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); _logger.Info("Finished searching {0} for {1}-S{2}E{3:00}, Found {4}", Name, seriesTitle, seasonNumber, episodeNumber, result.Count);
return result; return result;
@ -147,9 +138,6 @@ public virtual IList<EpisodeParseResult> FetchDailyEpisode(string seriesTitle, D
var result = Fetch(searchUrls); var result = Fetch(searchUrls);
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); _logger.Info("Finished searching {0} for {1}-{2}, Found {3}", Name, seriesTitle, airDate.ToShortDateString(), result.Count);
return result; return result;