From 918071903ba0724ef47992f9c417fece3faaa498 Mon Sep 17 00:00:00 2001 From: Qstick Date: Wed, 6 Oct 2021 19:32:22 -0500 Subject: [PATCH] New: Raw search engine support in caps --- .../Indexers/IndexerCapabilities.cs | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/NzbDrone.Core/Indexers/IndexerCapabilities.cs b/src/NzbDrone.Core/Indexers/IndexerCapabilities.cs index b6a2c04dc..92f66de27 100644 --- a/src/NzbDrone.Core/Indexers/IndexerCapabilities.cs +++ b/src/NzbDrone.Core/Indexers/IndexerCapabilities.cs @@ -52,6 +52,8 @@ public class IndexerCapabilities public int? LimitsMax { get; set; } public int? LimitsDefault { get; set; } + public bool SupportsRawSearch { get; set; } + public List SearchParams; public bool SearchAvailable => SearchParams.Count > 0; @@ -87,6 +89,7 @@ public class IndexerCapabilities public IndexerCapabilities() { + SupportsRawSearch = false; SearchParams = new List { SearchParam.Q }; TvSearchParams = new List(); MovieSearchParams = new List(); @@ -364,22 +367,28 @@ public XDocument GetXDocument() new XElement("searching", new XElement("search", new XAttribute("available", SearchAvailable ? "yes" : "no"), - new XAttribute("supportedParams", SupportedSearchParams())), + new XAttribute("supportedParams", SupportedSearchParams()), + SupportsRawSearch ? new XAttribute("searchEngine", "raw") : null), new XElement("tv-search", new XAttribute("available", TvSearchAvailable ? "yes" : "no"), - new XAttribute("supportedParams", SupportedTvSearchParams())), + new XAttribute("supportedParams", SupportedTvSearchParams()), + SupportsRawSearch ? new XAttribute("searchEngine", "raw") : null), new XElement("movie-search", new XAttribute("available", MovieSearchAvailable ? "yes" : "no"), - new XAttribute("supportedParams", SupportedMovieSearchParams())), + new XAttribute("supportedParams", SupportedMovieSearchParams()), + SupportsRawSearch ? new XAttribute("searchEngine", "raw") : null), new XElement("music-search", new XAttribute("available", MusicSearchAvailable ? "yes" : "no"), - new XAttribute("supportedParams", SupportedMusicSearchParams())), + new XAttribute("supportedParams", SupportedMusicSearchParams()), + SupportsRawSearch ? new XAttribute("searchEngine", "raw") : null), new XElement("audio-search", new XAttribute("available", MusicSearchAvailable ? "yes" : "no"), - new XAttribute("supportedParams", SupportedMusicSearchParams())), + new XAttribute("supportedParams", SupportedMusicSearchParams()), + SupportsRawSearch ? new XAttribute("searchEngine", "raw") : null), new XElement("book-search", new XAttribute("available", BookSearchAvailable ? "yes" : "no"), - new XAttribute("supportedParams", SupportedBookSearchParams()))), + new XAttribute("supportedParams", SupportedBookSearchParams()), + SupportsRawSearch ? new XAttribute("searchEngine", "raw") : null)), new XElement("categories", from c in Categories.GetTorznabCategoryTree(true) select new XElement("category",