From 3a4c8db98c41454cfa3706b036ce11707a8d76b2 Mon Sep 17 00:00:00 2001 From: Bogdan Date: Thu, 8 Jun 2023 17:52:37 +0300 Subject: [PATCH] Add all search types in TorrentRssIndexer For apps who don't support all categories with normal search, eg. Sonarr --- .../TorrentRss/TorrentRssIndexer.cs | 20 ++++++++++++++++++- .../TorrentRssIndexerRequestGenerator.cs | 13 ++++++++---- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs b/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs index 717409395..c971f28e9 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexer.cs @@ -79,7 +79,25 @@ namespace NzbDrone.Core.Indexers.Definitions.TorrentRss private IndexerCapabilities SetCapabilities() { - var caps = new IndexerCapabilities(); + var caps = new IndexerCapabilities + { + TvSearchParams = new List + { + TvSearchParam.Q + }, + MovieSearchParams = new List + { + MovieSearchParam.Q + }, + MusicSearchParams = new List + { + MusicSearchParam.Q + }, + BookSearchParams = new List + { + BookSearchParam.Q + } + }; caps.Categories.AddCategoryMapping(1, NewznabStandardCategory.Other); diff --git a/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexerRequestGenerator.cs b/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexerRequestGenerator.cs index 715e1ecf1..58ffb97ff 100644 --- a/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexerRequestGenerator.cs +++ b/src/NzbDrone.Core/Indexers/Definitions/TorrentRss/TorrentRssIndexerRequestGenerator.cs @@ -12,25 +12,30 @@ namespace NzbDrone.Core.Indexers.Definitions.TorrentRss public virtual IndexerPageableRequestChain GetSearchRequests(MovieSearchCriteria searchCriteria) { - return new IndexerPageableRequestChain(); + return BuildPageableRssRequests(searchCriteria); } public virtual IndexerPageableRequestChain GetSearchRequests(MusicSearchCriteria searchCriteria) { - return new IndexerPageableRequestChain(); + return BuildPageableRssRequests(searchCriteria); } public virtual IndexerPageableRequestChain GetSearchRequests(TvSearchCriteria searchCriteria) { - return new IndexerPageableRequestChain(); + return BuildPageableRssRequests(searchCriteria); } public virtual IndexerPageableRequestChain GetSearchRequests(BookSearchCriteria searchCriteria) { - return new IndexerPageableRequestChain(); + return BuildPageableRssRequests(searchCriteria); } public virtual IndexerPageableRequestChain GetSearchRequests(BasicSearchCriteria searchCriteria) + { + return BuildPageableRssRequests(searchCriteria); + } + + private IndexerPageableRequestChain BuildPageableRssRequests(SearchCriteriaBase searchCriteria) { var pageableRequests = new IndexerPageableRequestChain();