mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-05-07 12:10:20 +02:00
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) <noreply@anthropic.com>
This commit is contained in:
parent
15eed25107
commit
163bd28efd
3 changed files with 27 additions and 4 deletions
|
|
@ -188,6 +188,28 @@ private QuiIndexer BuildQuiIndexer(IndexerDefinition indexer, IndexerCapabilitie
|
|||
{
|
||||
var supportedCategories = indexerCapabilities.Categories.SupportedCategories(Settings.SyncCategories.ToArray());
|
||||
|
||||
var capabilities = new List<string> { "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<string> { "search" },
|
||||
Capabilities = capabilities,
|
||||
Categories = supportedCategories.Select(c => c.ToString()).ToList()
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue