Add qBittorrent and SABnzbd: a Download clients page with stuck, disconnected, paused and full-disk alerts

Each client is read every five minutes (read-only; qBittorrent's sign-in is the only POST): speed, queue and item states, network connection or paused queue, free space, SABnzbd's failures and warnings. Shared adapter, sync service, download_state table, /api/downloads, metrics and docs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bobbanandClaude Sonnet 5.5 committed 2026-11-04 23:13:03 +01:00
1 parent c7775e5dd9
commit 7618bf0f0a
32 files changed
+10715 -12

No files matched your search

+57 -1
View File
@@ -1543,6 +1543,59 @@ export interface ArrApp {
problems: { key: string; message: string; severity: "warning" | "critical" }[];
}
export type DownloadState = "downloading" | "queued" | "waiting" | "stalled" | "paused" | "processing" | "error" | "seeding" | "completed" | "failed" | "other";
export interface DownloadItem {
id: string;
name: string;
state: DownloadState;
/** The client's own word for it ("stalledDL", "Verifying" …). */
rawState: string;
/** 0 to 1. */
progress: number | null;
size: number | null;
left: number | null;
speed: number | null;
eta: number | null;
addedAt: string | null;
/** The last time anything moved; for a failed download, when it failed. */
activityAt: string | null;
category: string | null;
message: string | null;
}
/** One qBittorrent or SABnzbd (an integration of that type), as the download clients page shows it. */
export interface DownloadClient {
id: number;
kind: "qbittorrent" | "sabnzbd";
name: string;
enabled: boolean;
url: string;
status: { at: string; ok: boolean; error: string | null } | null;
fresh: boolean;
state: {
version: string | null;
speedDown: number | null;
speedUp: number | null;
paused: boolean;
connection: "connected" | "firewalled" | "disconnected" | null;
counts: Record<DownloadState, number>;
total: number;
/** The items that are not finished and idle (at most 100). */
items: DownloadItem[];
/** Failed downloads (SABnzbd); null when none were reported. */
failed: DownloadItem[] | null;
disks: { label: string; free: number; total: number | null }[] | null;
warnings: { count: number; recent: string[] } | null;
since: { pausedSince: string | null; disconnectedSince: string | null; idleSince: string | null };
updatedAt: string;
/** The ids of the items that are stuck, and of the downloads that failed in the last day. */
stuck: string[];
failedRecent: string[];
} | null;
problems: { key: string; message: string; severity: "warning" | "critical" }[];
}
/** One AdGuard Home (an integration of type adguard), as its page shows it. */
export interface AdguardInstance {
id: number;
@@ -2928,7 +2981,7 @@ export interface ManualTaskInput {
enabled?: boolean;
}
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin" | "authentik" | "prometheus" | "immich" | "paperless" | "nextcloud" | "netbox" | "n8n" | "hetzner" | "speedtest" | "fragnet" | "sonarr" | "radarr" | "prowlarr" | "adguard" | "technitium" | "grafana" | "lidarr" | "readarr";
export type IntegrationType = "proxmox" | "synology" | "semaphore" | "tailscale" | "gitea" | "dockhand" | "uptimekuma" | "phpipam" | "pbs" | "osticket" | "unifi" | "npm" | "homeassistant" | "ups" | "jellyfin" | "authentik" | "prometheus" | "immich" | "paperless" | "nextcloud" | "netbox" | "n8n" | "hetzner" | "speedtest" | "fragnet" | "sonarr" | "radarr" | "prowlarr" | "adguard" | "technitium" | "grafana" | "lidarr" | "readarr" | "qbittorrent" | "sabnzbd";
export interface IntegrationField {
key: string;
@@ -3547,6 +3600,9 @@ export const api = {
arr: {
list: () => request<{ apps: ArrApp[] }>("/api/arr"),
},
downloads: {
list: () => request<{ clients: DownloadClient[] }>("/api/downloads"),
},
fragnet: {
list: () => request<{ accounts: FragnetAccount[] }>("/api/fragnet"),
power: (integrationId: number, serverId: string, signal: FragnetSignal) => request<void>(`/api/fragnet/${integrationId}/servers/${serverId}/power`, { method: "POST", body: JSON.stringify({ signal }) }),