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:
1 parent
c7775e5dd9
commit
7618bf0f0a
32 files changed
+10715
-12
No files matched your search
+25
-2
@@ -24,8 +24,8 @@ what the app actually creates.
|
||||
| **File** | `DATABASE_PATH`, default `../data/homelab-manager.sqlite` (relative to `server/`; `/app/data/...` in Docker). The folder is created if missing. |
|
||||
| **Foreign keys** | Switched on for every connection (`PRAGMA foreign_keys = ON`), so the `ON DELETE` rules below are enforced. |
|
||||
| **Writes** | SQLite lets one writer in at a time and refuses a second at once ("database is locked"). While a transaction of the app is open, its other writes wait for it ([`server/src/db/writeGate.ts`](server/src/db/writeGate.ts)) rather than being refused — a refused write also leaves its connection unable to commit the next transaction. Reads are never held; a wait over 10 seconds is given up. A lock held by *another* process (a backup tool reading the file, a second copy of the app) is still refused as before. |
|
||||
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0082`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 91 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
| **Migrations** | SQL files in [`server/drizzle/`](server/drizzle) (`0000` … `0083`), applied automatically when the server starts. Which ones have run is recorded in the table `__drizzle_migrations`. |
|
||||
| **Tables** | 92 application tables, plus drizzle's own `__drizzle_migrations`. |
|
||||
|
||||
**Not in the database, but beside it in the data folder:** the backups of the database itself (`backups/homelab-manager-….sqlite`, taken daily and on request; see [BACKUP.md](BACKUP.md)), and, only while a restore is waiting or has just happened, `restore-pending.sqlite` / `restore-pending.json` and `restore-result.json`.
|
||||
|
||||
@@ -78,6 +78,7 @@ erDiagram
|
||||
integrations ||--o| hetzner_state : "cascade"
|
||||
integrations ||--o| fragnet_state : "cascade"
|
||||
integrations ||--o| arr_state : "cascade"
|
||||
integrations ||--o| download_state : "cascade"
|
||||
integrations ||--o| adguard_state : "cascade"
|
||||
integrations ||--o| technitium_state : "cascade"
|
||||
integrations ||--o| grafana_state : "cascade"
|
||||
@@ -1045,6 +1046,28 @@ How a Sonarr, Radarr or Prowlarr (an integration of type `sonarr`, `radarr` or `
|
||||
|
||||
How the last read went is kept in `settings`, key `_internal:arrSync`.
|
||||
|
||||
#### `download_state`
|
||||
|
||||
How a qBittorrent or SABnzbd (an integration of type `qbittorrent` or `sabnzbd`) is right now, one row each, replaced at every read (every five minutes). `integration_id` is the primary key and a foreign key with **cascade**. There is no history: what is stored is the last good read, plus since when it has been paused, disconnected or idle with work waiting — which only this app can know, and which is carried from read to read.
|
||||
|
||||
| Column | Type | Notes |
|
||||
|---|---|---|
|
||||
| `integration_id` | integer PK | |
|
||||
| `version` | text | |
|
||||
| `speed_down`, `speed_up` | integer | Bytes per second; null when not said (SABnzbd does not say its upload speed). |
|
||||
| `paused` | integer (boolean) NOT NULL, default false | The whole queue is paused (SABnzbd). |
|
||||
| `connection` | text | `connected`, `firewalled` or `disconnected` (qBittorrent); null for SABnzbd or when not said. |
|
||||
| `counts` | text NOT NULL | JSON: how many items are in each state — all of them, not just the ones listed. |
|
||||
| `total` | integer NOT NULL, default 0 | How many items there are. |
|
||||
| `items` | text NOT NULL, default `[]` | JSON: the items that are not finished and idle (seeding and stopped ones are only counted), the ones with something to say first, at most 100. |
|
||||
| `failed` | text | JSON: downloads that failed (SABnzbd's history, the last 50 entries); null when not said or could not be read. |
|
||||
| `disks` | text | JSON: label, free bytes and total bytes (null where the client does not say how big the disk is); null when it could not be read. |
|
||||
| `warnings` | text | JSON `{ count, recent }`: SABnzbd's own list of warnings; null when not read. |
|
||||
| `since` | text NOT NULL, default `{}` | JSON `{ pausedSince, disconnectedSince, idleSince }`: the time of the first read that showed each; null while it is not so. |
|
||||
| `updated_at` | text NOT NULL | ISO. |
|
||||
|
||||
How the last read went is kept in `settings`, key `_internal:downloadsSync`.
|
||||
|
||||
#### `adguard_state`
|
||||
|
||||
How an AdGuard Home (an integration of type `adguard`) is right now, one row each, replaced at every read (every two minutes). `integration_id` is the primary key and a foreign key with **cascade**. No history: what is stored is the last good read, plus two clocks only this app can keep.
|
||||
|
||||
Reference in new issue
Block a user