Skip to content

feat(deluge): optional Deluge tab — full torrent management via deluge-web JSON-RPC#76

Open
ndandan wants to merge 10 commits into
Shoshuo:mainfrom
ndandan:pr/deluge-tab
Open

feat(deluge): optional Deluge tab — full torrent management via deluge-web JSON-RPC#76
ndandan wants to merge 10 commits into
Shoshuo:mainfrom
ndandan:pr/deluge-tab

Conversation

@ndandan

@ndandan ndandan commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Adds an optional Deluge tab — a full torrent-management page for Deluge mirroring the existing qBittorrent tab, wired through the same service conventions (setup wizard, /admin/settings card with kill switch + Test connection, health chip, sidebar badge, circuit breaker, SSRF protocol locks). Fully additive: no behaviour change for anyone who doesn't configure it.

What's included

DelugeClient — deluge-web JSON-RPC (POST {url}/json):

  • deluge-web answers HTTP 200 even on failure, so success is judged on the response envelope (error === null), with _session_id cookie auth.
  • Empty password = authenticating-reverse-proxy mode.
  • Auto web.connect when the web UI is daemon-disconnected.
  • Same circuit breaker + ServiceHealthCache + SSRF guards as every other client.

DelugeController + /deluge page — feature parity with the qBit tab where Deluge supports it:

  • Live torrent table (2 s-refresh API, server-side pagination/filter/sort/search), state filters, card/table views.
  • Read-only Label filter (Label plugin): labels are set by Sonarr/Radarr and never written from Prismarr.
  • Seeding-focused Ratio / Uploaded / Completed columns.
  • Detail panel (status, files, trackers, peers) with Radarr/Sonarr resolve.
  • Single + bulk pause / resume / delete(±data) / recheck, reannounce, move storage; session-wide Pause All / Resume All via core.pause_session / core.resume_session.
  • Add via magnet / URL / .torrent upload (SSRF-guarded, bencode-validated) with save-path; per-torrent and global speed limits.
  • Sidebar badge + download-complete toasts.
  • Strict 40-char torrent-hash validation on every action route (no all sentinel — session-wide ops use the dedicated RPCs).

Deliberately absent (Deluge doesn't map cleanly): tags, rename, force-start, sequential download, per-file priorities, VPN column.

Shared-file touchpoints (kept minimal)

ApiClientErrorTrait union, HealthService (client + toggle/invalidate lists), route-guard subscriber, setup wizard, admin-settings card registration, display prefs, sidebar + poll in base.html.twig, en/fr translations.

Verification

  • New tests: DelugeClientTest (envelope/auth/reconnect/normalization), DelugeControllerTest, health-diagnose + route-guard + smoke coverage.
  • make check (lint + Twig lint + full PHPUnit suite) green on this branch.
  • Live-verified against a real deluge-web instance (43-torrent seeding box): label filter, detail modal, pause/resume round-trip, add-torrent, speed limits.

CHANGELOG entry included under [Unreleased] → Added.

🤖 Generated with Claude Code

ndandan and others added 10 commits July 6, 2026 13:30
…d, admin settings, prefs, i18n, icon

Wires Deluge into app chrome: sidebar entry + global poll (badge/toasts,
mirrors qBit), ServiceRouteGuardSubscriber rule, HealthService (ping,
toggle, color, chip label, isConfigured, invalidate, diagnoseFromResponse
for the JSON-RPC envelope, probeFor for auth.login/web.get_config),
setup wizard step + admin settings card + display refresh preference,
en/fr translations, and an original service icon.
…e progress scale, turbo timer cleanup, savepath in add modal

Fixes 5 findings from the whole-branch final review of feat/deluge-tab:
1. XSS: escape the raw tracker-status string fallback in the trackers
   renderer before it hits innerHTML.
2. File progress was scaled to 0-100 in DelugeClient but the template
   multiplies by 100 again (qBit contract expects 0-1); emit 0-1.
3. Detail modal was missing name/eta/seeds/peers/speed fields because
   getTorrentDetail() fetched them but never mapped them into
   properties; added download_payload_rate/upload_payload_rate to
   DETAIL_KEYS and mapped all seven fields the template actually reads.
4. The Deluge poll timer wasn't cleared on Turbo navigation, unlike
   its qBittorrent/Usenet counterparts; added it to the cleanup list.
5. Removed the no-op Category select from the add-torrent modal (the
   controller never read it) and replaced it with a save-path input,
   wired through to both api/add and api/add-file as `savepath`.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…downloads group, kill switch, test fields, subtitle i18n)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ndandan added a commit to ndandan/Prismarr that referenced this pull request Jul 6, 2026
…ests, SABnzbd, Plex activity, Prowlarr), add Deluge coverage, update pending-PR list (Shoshuo#74/Shoshuo#75/Shoshuo#76)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant