Fixed: Duplicate searches when Anime Standard Format Search enabled on indexer and series has multiple aliases
This commit is contained in:
parent
377fce6fe1
commit
d581de00c9
|
@ -157,8 +157,8 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
|
|||
var pages = results.GetTier(0).Select(t => t.First()).ToList();
|
||||
|
||||
pages[0].Url.FullUri.Should().Contain("rid=10&q=100");
|
||||
pages[1].Url.FullUri.Should().Contain("q=Monkey%20Island+100");
|
||||
pages[2].Url.FullUri.Should().Contain("rid=10&season=5&ep=4");
|
||||
pages[1].Url.FullUri.Should().Contain("rid=10&season=5&ep=4");
|
||||
pages[2].Url.FullUri.Should().Contain("q=Monkey%20Island+100");
|
||||
pages[3].Url.FullUri.Should().Contain("q=Monkey%20Island&season=5&ep=4");
|
||||
}
|
||||
|
||||
|
|
|
@ -390,27 +390,35 @@ namespace NzbDrone.Core.Indexers.Newznab
|
|||
var pageableRequests = new IndexerPageableRequestChain();
|
||||
|
||||
if (SupportsSearch)
|
||||
{
|
||||
var queryTitles = TextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.CleanSceneTitles;
|
||||
foreach (var queryTitle in queryTitles)
|
||||
{
|
||||
AddTvIdPageableRequests(pageableRequests,
|
||||
Settings.AnimeCategories,
|
||||
searchCriteria,
|
||||
$"&q={searchCriteria.AbsoluteEpisodeNumber:00}");
|
||||
|
||||
pageableRequests.Add(GetPagedRequests(MaxPages,
|
||||
Settings.AnimeCategories,
|
||||
"search",
|
||||
$"&q={NewsnabifyTitle(queryTitle)}+{searchCriteria.AbsoluteEpisodeNumber:00}"));
|
||||
var includeAnimeStandardFormatSearch = Settings.AnimeStandardFormatSearch &&
|
||||
searchCriteria.SeasonNumber > 0 &&
|
||||
searchCriteria.EpisodeNumber > 0;
|
||||
|
||||
if (Settings.AnimeStandardFormatSearch && searchCriteria.SeasonNumber > 0 && searchCriteria.EpisodeNumber > 0)
|
||||
if (includeAnimeStandardFormatSearch)
|
||||
{
|
||||
AddTvIdPageableRequests(pageableRequests,
|
||||
Settings.AnimeCategories,
|
||||
searchCriteria,
|
||||
$"&season={NewznabifySeasonNumber(searchCriteria.SeasonNumber)}&ep={searchCriteria.EpisodeNumber}");
|
||||
}
|
||||
|
||||
var queryTitles = TextSearchEngine == "raw" ? searchCriteria.SceneTitles : searchCriteria.CleanSceneTitles;
|
||||
|
||||
foreach (var queryTitle in queryTitles)
|
||||
{
|
||||
pageableRequests.Add(GetPagedRequests(MaxPages,
|
||||
Settings.AnimeCategories,
|
||||
"search",
|
||||
$"&q={NewsnabifyTitle(queryTitle)}+{searchCriteria.AbsoluteEpisodeNumber:00}"));
|
||||
|
||||
if (includeAnimeStandardFormatSearch)
|
||||
{
|
||||
pageableRequests.Add(GetPagedRequests(MaxPages,
|
||||
Settings.AnimeCategories,
|
||||
"tvsearch",
|
||||
|
|
Loading…
Reference in New Issue