feat: admin-only manual torrent download (magnet link / .torrent upload) - #290
Open
zpersichetti wants to merge 2 commits into
Open
feat: admin-only manual torrent download (magnet link / .torrent upload)#290zpersichetti wants to merge 2 commits into
zpersichetti wants to merge 2 commits into
Conversation
Adds a "Manual Torrent" entry point so a user can attach a torrent they found themselves to an existing request, bypassing Prowlarr search. The supplied magnet (or a magnet derived server-side from an uploaded .torrent) is queued as a normal download_torrent job, so monitoring, organization and Plex/Audiobookshelf import are unchanged. - POST /api/requests/[id]/manual-download (multipart/form-data): auth + ownership/admin checks, status guard (pending, failed, awaiting_search, awaiting_release), magnet/.torrent validation (<=5 MB), configured torrent-client check, job enqueue, request set to downloading. - .torrent files are parsed with parse-torrent and converted to a magnet URI, keeping every download client on the existing magnet path - no download-client or processor changes needed. - ManualTorrentModal (magnet input + .torrent drop zone) wired into the AudiobookDetailsModal action bar, gated by the same permission pattern as Interactive Search. - Tests: route (auth/status/validation/happy paths), component (visibility rules, magnet submit, error surfacing), processor (manual-magnet candidate). - Docs: phase3/manual-torrent-download.md + TABLEOFCONTENTS entries. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…in request actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lets admins attach a manually-supplied magnet link or
.torrentfile to arequest and hand it to the configured download client through the normal
pipeline — without relying on indexer search.
What changed
POST /api/requests/[id]/manual-downloadroute: accepts a multipartbody (
magnetfield and/or.torrentfile), validates it (info hash,5 MB cap), and queues a download job.
ManualTorrentModalfor pasting a magnet link or dropping a.torrentfile.
Manual Search / Interactive Search.
Access control (admin-only)
user.role === 'admin'.req.user.role === 'admin'server-side (403 fornon-admins), so it can't be reached via a direct API call.
pending,failed,awaiting_search,awaiting_release) accept a manual torrent; others return 409.Testing
requests-manual-download.routes.test.ts): auth, statusgating, magnet/file validation, and job queueing.
AudiobookDetailsModaltests for the admin-only gate.tsc --noEmitclean; full suite passes (2667 passed, 0 failed).