feat: indexers and download clients you add and configure (M502 #5518)
release / govulncheck (push) Successful in 34s
release / web (push) Successful in 1m13s
release / go (push) Successful in 2m12s
release / integration (push) Successful in 4m6s
release / Build signed APK (releases and dev) (push) Successful in 8m41s
release / android (push) Successful in 9m47s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 59s
release / Verify release artifacts (tag releases only) (push) Skipped

Admin → Integrations gains "Indexers and download clients": two lists of
connections the operator adds, Fabled Librarian's model. Nothing is seeded
or copied from Lidarr.

- Indexers: Prowlarr (its native /api/v1/search, which asks every indexer
  at once; Prowlarr has no aggregate Torznab feed) and any Torznab feed.
- Download clients: qBittorrent (WebUI v2, with re-login on an expired
  session) and FabledExchange, one entry with a switch per job:
  downloads (/api/downloads), search (/api/search) and release details
  (/api/torrents/{infohash}). All three start on; its key is optional.
- Each entry: enable, name, address, a write-only key or password, Test.
  A download client's Test lists its torrents and checks the downloads
  folder is visible and writable from Minstrel; an Exchange's Test
  reports each job switched on.
- Download clients carry a path mapping (Minstrel's /downloads vs the
  client's own name for it); search sources carry searches per hour.

Migration 0079 adds acquisition_services with its CHECKs. Ported from
Fabled Librarian: internal/indexer (Torznab, 429 Retry-After, magnet
redirects), internal/prowlarr, internal/exchange, internal/downloader,
and internal/acquire's one builder per kind, which Test already uses
so a passing Test vouches for the path a grab will take.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-09 20:34:51 -04:00
co-authored by Claude Opus 5.5
parent 5306a261c1
commit a2e1890d4c
35 changed files with 4966 additions and 2 deletions
+79
View File
@@ -1009,3 +1009,82 @@ export async function updateNotificationEmailSettings(
): Promise<NotificationEmailSettings> {
return api.put<NotificationEmailSettings>('/api/admin/notification-email', s);
}
// Indexers and download clients (M502 #5518) -------------------------------
export type AcquisitionProtocol = 'prowlarr' | 'torznab' | 'qbittorrent' | 'exchange';
/** One indexer or download client. Secrets never come back, only whether set. */
export type AcquisitionService = {
code: string;
kind: 'search' | 'download';
protocol: AcquisitionProtocol;
label: string;
enabled: boolean;
base_url: string;
has_api_key: boolean;
has_password: boolean;
username: string;
category: string;
timeout_ms: number;
/** The three switches mean something on an exchange row only. */
serves_search: boolean;
serves_downloads: boolean;
serves_enrichment: boolean;
local_path: string;
remote_path: string;
searches_per_hour: number;
/** Switched on and addressed. */
usable: boolean;
};
export type AcquisitionUpdate = Omit<
AcquisitionService,
'code' | 'kind' | 'protocol' | 'has_api_key' | 'has_password' | 'usable'
>;
export type AcquisitionTestResult = { ok: boolean; detail: string };
const acquisitionBase = '/api/admin/acquisition/services';
export async function listAcquisitionServices(): Promise<AcquisitionService[]> {
const res = await api.get<{ services: AcquisitionService[] }>(acquisitionBase);
return res.services;
}
export async function addAcquisitionService(
protocol: AcquisitionProtocol
): Promise<AcquisitionService> {
return api.post<AcquisitionService>(acquisitionBase, { protocol });
}
export async function updateAcquisitionService(
code: string,
u: AcquisitionUpdate
): Promise<AcquisitionService> {
return api.put<AcquisitionService>(`${acquisitionBase}/${encodeURIComponent(code)}`, u);
}
export async function removeAcquisitionService(code: string): Promise<void> {
await api.del(`${acquisitionBase}/${encodeURIComponent(code)}`);
}
export async function testAcquisitionService(code: string): Promise<AcquisitionTestResult> {
return api.post<AcquisitionTestResult>(`${acquisitionBase}/${encodeURIComponent(code)}/test`, {});
}
/** Stores a key or password. Write-only: nothing comes back. */
export async function setAcquisitionSecret(
code: string,
which: 'api-key' | 'password',
value: string
): Promise<void> {
await api.put(`${acquisitionBase}/${encodeURIComponent(code)}/${which}`, { value });
}
export async function clearAcquisitionSecret(
code: string,
which: 'api-key' | 'password'
): Promise<void> {
await api.del(`${acquisitionBase}/${encodeURIComponent(code)}/${which}`);
}