diff --git a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs index 1c874e991..9c1e61b10 100644 --- a/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs +++ b/src/NzbDrone.Core.Test/IndexerTests/NewznabTests/NewznabRequestGeneratorFixture.cs @@ -219,6 +219,21 @@ public void should_use_aggregrated_id_search_if_supported() 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] public void should_fallback_to_q() { diff --git a/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs index 8b4844ca5..3ecec8450 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/NewznabRequestGenerator.cs @@ -183,7 +183,7 @@ public virtual IndexerPageableRequestChain GetSearchRequests(SpecialEpisodeSearc private void AddTvIdPageableRequests(IndexerPageableRequestChain chain, int maxPages, IEnumerable categories, SearchCriteriaBase searchCriteria, string parameters) { - if (SupportsAggregatedIdSearch) + if (SupportsAggregatedIdSearch && (SupportsTvdbSearch || SupportsTvRageSearch || SupportsTvMazeSearch)) { var ids = "";