Fixed torznab searching without any id or q.

Fixes #849
This commit is contained in:
Taloth Saldono 2015-10-11 21:37:25 +02:00
parent 897937a778
commit 74403815d9
2 changed files with 16 additions and 1 deletions

View File

@ -219,6 +219,21 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
page.Url.Query.Should().Contain("rid=10"); page.Url.Query.Should().Contain("rid=10");
} }
[Test]
public void should_not_use_aggregrated_id_search_if_no_ids_supported()
{
_capabilities.SupportedTvSearchParameters = new[] { "q", "season", "ep" };
_capabilities.SupportsAggregateIdSearch = true; // Turns true if indexer supplies supportedParams.
var results = Subject.GetSearchRequests(_singleEpisodeSearchCriteria);
results.Tiers.Should().Be(1);
results.GetTier(0).Should().HaveCount(1);
var page = results.GetTier(0).First().First();
page.Url.Query.Should().Contain("q=");
}
[Test] [Test]
public void should_fallback_to_q() public void should_fallback_to_q()
{ {

View File

@ -183,7 +183,7 @@ namespace NzbDrone.Core.Indexers.Newznab
private void AddTvIdPageableRequests(IndexerPageableRequestChain chain, int maxPages, IEnumerable<int> categories, SearchCriteriaBase searchCriteria, string parameters) private void AddTvIdPageableRequests(IndexerPageableRequestChain chain, int maxPages, IEnumerable<int> categories, SearchCriteriaBase searchCriteria, string parameters)
{ {
if (SupportsAggregatedIdSearch) if (SupportsAggregatedIdSearch && (SupportsTvdbSearch || SupportsTvRageSearch || SupportsTvMazeSearch))
{ {
var ids = ""; var ids = "";