From 163bd28efdffef223eca189dcf552844232df1a3 Mon Sep 17 00:00:00 2001 From: nitrobass24 Date: Mon, 6 Apr 2026 23:11:22 -0500 Subject: [PATCH] Improve Qui application: dynamic capabilities, Backend sync, correct port - Build Capabilities from indexer's actual search support instead of hardcoding ["search"] - Include Backend in Equals/GetHashCode so drift is detected during sync - Fix default qui port from 7474 to 7476 Co-Authored-By: Claude Opus 4.6 (1M context) --- src/NzbDrone.Core/Applications/Qui/Qui.cs | 24 ++++++++++++++++++- .../Applications/Qui/QuiIndexer.cs | 3 ++- .../Applications/Qui/QuiSettings.cs | 4 ++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Applications/Qui/Qui.cs b/src/NzbDrone.Core/Applications/Qui/Qui.cs index 752171ece..451036da5 100644 --- a/src/NzbDrone.Core/Applications/Qui/Qui.cs +++ b/src/NzbDrone.Core/Applications/Qui/Qui.cs @@ -188,6 +188,28 @@ private QuiIndexer BuildQuiIndexer(IndexerDefinition indexer, IndexerCapabilitie { var supportedCategories = indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray()); + var capabilities = new List { "search" }; + + if (indexerCapabilities.TvSearchAvailable) + { + capabilities.Add("tv-search"); + } + + if (indexerCapabilities.MovieSearchAvailable) + { + capabilities.Add("movie-search"); + } + + if (indexerCapabilities.MusicSearchAvailable) + { + capabilities.Add("music-search"); + } + + if (indexerCapabilities.BookSearchAvailable) + { + capabilities.Add("book-search"); + } + return new QuiIndexer { Id = id, @@ -201,7 +223,7 @@ private QuiIndexer BuildQuiIndexer(IndexerDefinition indexer, IndexerCapabilitie LimitDefault = 100, LimitMax = 200, IndexerId = indexer.Id.ToString(), - Capabilities = new List { "search" }, + Capabilities = capabilities, Categories = supportedCategories.Select(c => c.ToString()).ToList() }; } diff --git a/src/NzbDrone.Core/Applications/Qui/QuiIndexer.cs b/src/NzbDrone.Core/Applications/Qui/QuiIndexer.cs index ae34e48fa..99e69f560 100644 --- a/src/NzbDrone.Core/Applications/Qui/QuiIndexer.cs +++ b/src/NzbDrone.Core/Applications/Qui/QuiIndexer.cs @@ -65,6 +65,7 @@ public bool Equals(QuiIndexer other) return other.BaseUrl == BaseUrl && other.ApiKey == ApiKey && other.Name == Name && + other.Backend == Backend && other.Enabled == Enabled && other.Priority == Priority && other.IndexerId == IndexerId && @@ -73,7 +74,7 @@ public bool Equals(QuiIndexer other) public override int GetHashCode() { - return HashCode.Combine(BaseUrl, ApiKey, Name, Enabled, Priority, IndexerId); + return HashCode.Combine(BaseUrl, ApiKey, Name, Backend, Enabled, Priority, IndexerId); } } } diff --git a/src/NzbDrone.Core/Applications/Qui/QuiSettings.cs b/src/NzbDrone.Core/Applications/Qui/QuiSettings.cs index e0492bd82..a9e834b16 100644 --- a/src/NzbDrone.Core/Applications/Qui/QuiSettings.cs +++ b/src/NzbDrone.Core/Applications/Qui/QuiSettings.cs @@ -24,14 +24,14 @@ public class QuiSettings : IApplicationSettings public QuiSettings() { ProwlarrUrl = "http://localhost:9696"; - BaseUrl = "http://localhost:7474"; + BaseUrl = "http://localhost:7476"; SyncCategories = new[] { 2000, 3000, 4000, 5000, 6000, 7000, 8000 }; } [FieldDefinition(0, Label = "Prowlarr Server", HelpText = "Prowlarr server URL as qui sees it, including http(s)://, port, and urlbase if needed", Placeholder = "http://localhost:9696")] public string ProwlarrUrl { get; set; } - [FieldDefinition(1, Label = "qui Server", HelpText = "URL used to connect to qui server, including http(s)://, port, and urlbase if required", Placeholder = "http://localhost:7474")] + [FieldDefinition(1, Label = "qui Server", HelpText = "URL used to connect to qui server, including http(s)://, port, and urlbase if required", Placeholder = "http://localhost:7476")] public string BaseUrl { get; set; } [FieldDefinition(2, Label = "API Key", Privacy = PrivacyLevel.ApiKey, HelpText = "The ApiKey generated by qui in Settings")]