1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-27 18:17:13 +00: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();
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)]
@ -227,9 +223,6 @@ public void newzbin_search_returns_valid_results(string title, int season, int e
Mark500Inconclusive();
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]
@ -250,17 +243,12 @@ public void nzbmatrix_search_returns_valid_results()
Mark500Inconclusive();
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]
public void nzbmatrix_multi_word_search_returns_valid_results()
{
Mocker.GetMock<ConfigProvider>()
.SetupGet(c => c.NzbMatrixUsername)
.Returns("");
@ -276,9 +264,6 @@ public void nzbmatrix_multi_word_search_returns_valid_results()
Mark500Inconclusive();
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 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);
return result;
}
@ -115,9 +113,6 @@ public virtual IList<EpisodeParseResult> FetchPartialSeason(string seriesTitle,
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);
return result;
}
@ -130,10 +125,6 @@ public virtual IList<EpisodeParseResult> FetchEpisode(string seriesTitle, int se
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);
return result;
@ -147,9 +138,6 @@ public virtual IList<EpisodeParseResult> FetchDailyEpisode(string seriesTitle, D
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);
return result;