chore: bump version to 1.6.0, update CHANGELOG and ARCHITECTURE docs
Build and Push Docker Image / build (push) Successful in 48s
CI / Security audit (push) Successful in 1m23s
Docs Check / Markdown lint (push) Successful in 1m10s
CI / Tests & coverage (push) Successful in 1m47s
Licence Check / Licence compatibility and copyright header verification (push) Successful in 1m18s
Docs Check / Mermaid diagram parse check (push) Successful in 1m44s

This commit is contained in:
2026-05-21 11:49:46 +01:00
parent adbb0c12c1
commit 5d0da45e10
3 changed files with 54 additions and 6 deletions
+7 -5
View File
@@ -85,7 +85,7 @@ flowchart TB
login -->|"POST /api/auth/login"| auth_r
dash -->|"GET /api/dashboard/stream (SSE)"| dash_r
status -->|"GET /api/status/status"| stat_r
status -->|"GET /api/status"| stat_r
history -->|"GET /api/history/recent"| hist_r
auth_r --> tokenstore
@@ -452,10 +452,10 @@ Every `POLL_INTERVAL` ms the poller fetches all services in parallel:
| SABnzbd History | `GET /api?mode=history` | `limit=10` |
| Sonarr Tags | `GET /api/v3/tag` | — |
| Sonarr Queue | `GET /api/v3/queue` | `includeSeries=true`, `includeEpisode=true` |
| Sonarr History | `GET /api/v3/history` | `pageSize=10`, `includeEpisode=true` |
| Sonarr History | `GET /api/v3/history` | `pageSize=50`, `includeEpisode=true` |
| Radarr Tags | `GET /api/v3/tag` | — |
| Radarr Queue | `GET /api/v3/queue` | `includeMovie=true` |
| Radarr History | `GET /api/v3/history` | `pageSize=10` |
| Radarr History | `GET /api/v3/history` | `pageSize=50` |
| qBittorrent | `GET /api/v2/sync/maindata?rid=N` | Fallback: `GET /api/v2/torrents/info` |
Results are stored in `MemoryCache` under `poll:*` keys with TTL `POLL_INTERVAL × 3`. Per-task timings are recorded in `lastPollTimings` for the admin status panel.
@@ -718,7 +718,9 @@ DownloadClient (abstract — server/clients/DownloadClient.js)
### 7.2 Queue & History Processing
**`server/utils/historyFetcher.js`** fetches history records from all Sonarr/Radarr instances for a configurable date window. Results are cached under `history:sonarr` / `history:radarr` for 5 minutes. Exports `classifySonarrEvent` / `classifyRadarrEvent` (returns `'imported'` | `'failed'` | `'other'`) and `invalidateHistoryCache`.
**`server/utils/historyFetcher.js`** fetches history records from all Sonarr/Radarr instances for a configurable date window. Results are cached under `history:sonarr` / `history:radarr` for 5 minutes. Exports `classifySonarrEvent` / `classifyRadarrEvent` (returns `'imported'` | `'failed'` | `'other'`), `invalidateHistoryCache`, and `onHistoryUpdate` / `emitHistoryUpdate` for SSE staging.
**Staged loading** — the fetcher returns up to `INITIAL_PAGE_SIZE` (100) records immediately from the cache or a quick fetch. If fewer than `MAX_TOTAL_RECORDS` (1,000) are present, a background fetch of up to `MAX_PAGES` (10) is triggered automatically. As the background fetch completes, `emitHistoryUpdate()` notifies all registered subscribers, which causes the SSE layer to push a `history-update` frame to every connected browser. The frontend (`client/src/ui/history.js`) listens for these events and re-renders the "Recently Completed" tab incrementally.
**`server/routes/history.js`** (`GET /api/history/recent`) returns recently completed (imported or failed) downloads filtered for the authenticated user. Supports `?days=N` (default `RECENT_COMPLETED_DAYS`, capped at 90) and `?showAll=true` for admins. Results are sorted newest first.
@@ -844,7 +846,7 @@ sofarr/
│ ├── routes/
│ │ ├── auth.js POST /login, GET /me, GET /csrf, POST /logout
│ │ ├── dashboard.js SSE /stream, /user-downloads, /blocklist-search
│ │ ├── status.js GET /api/status/status — admin server/polling/webhook status
│ │ ├── status.js GET /api/status — admin server/polling/webhook status
│ │ ├── history.js GET /api/history/recent
│ │ ├── webhook.js POST /api/webhook/sonarr|radarr
│ │ ├── sonarr.js Sonarr API proxy + webhook management