Skip to content

Expose a SABnzbd-compatible download client - #38

Merged
ChrisonSimtian merged 1 commit into
mainfrom
feat/sabnzbd-download-client
Jul 26, 2026
Merged

Expose a SABnzbd-compatible download client#38
ChrisonSimtian merged 1 commit into
mainfrom
feat/sabnzbd-download-client

Conversation

@ChrisonSimtian

Copy link
Copy Markdown
Contributor

What & why

Closes the Sonarr/Radarr round-trip (DR-010): Sonarr grabs a release from the Newznab indexer (#37), hands the synthetic NZB to its download client — us — and we decode the opaque token back into a real download job. Part 3 of the *arr API-surface plan.

Newznab result (token = Episode.Id)  →  Sonarr sends NZB to SABnzbd client (us)
   →  decode token  →  DownloadJob created + enqueued  →  queue/history reflect state

Changes

SABnzbd API on the existing NewznabIndexerApi host (one host, both protocols):

  • mode=version | get_config | addfile | addurl | queue | history (+ queue/history delete).
  • addfile/addurl decode the krautwatch-token from the NZB/link → AddDownloadByTokenHandler resolves the episode's best stream, creates a DownloadJob and enqueues it via the existing IDownloadQueue port (no Wolverine needed here).
  • queue/history project DownloadJob state, split by a new Active flag on DownloadJobResponse.

Application/Downloads: NzbToken — the shared krautwatch-token codec, now the single source of truth the indexer's NZB writer also uses — plus AddDownloadByTokenHandler.

Auth: one instance apikey (Krautwatch:ApiKey) shared by both surfaces via ApiKeyGuard; Newznab caps stays open for Prowlarr.

Scope

Actual stream pulling stays the Downloader agent's job (future work) — this client persists + enqueues the intent, which is the SABnzbd contract Sonarr speaks to. So a live end-to-end grab-to-file needs the Downloader; the client protocol itself is complete and unit-tested here.

Tests

NzbToken round-trip (reads the token back out of the indexer's NZB shape; rejects malformed/absent) and AddDownloadByTokenHandler (known token enqueues; unknown/streamless → null, nothing enqueued). ./build.cmd Test green (Application 44 / Architecture 8 / Infrastructure 47).

Next

PR 4 — internal-API cleanup: collapse PublicApi into the Blazor config UI (in-process) and delete the Api project, moving migration ownership to a dedicated migrator.

🤖 Generated with Claude Code

)

Closes the *arr round-trip: Sonarr grabs a release from the Newznab indexer, hands
the synthetic NZB to its download client (us), and we decode the opaque token back
into a real download job. Part 3 of the *arr API-surface plan.

- SABnzbd API on the NewznabIndexerApi host (mode=version|get_config|addfile|addurl|
  queue|history + queue/history delete). addfile/addurl decode the krautwatch-token
  from the NZB/link → AddDownloadByTokenHandler resolves the episode's best stream,
  creates a DownloadJob and enqueues it (via the existing IDownloadQueue port — no
  Wolverine needed here). queue/history project DownloadJob state (split by a new
  Active flag on DownloadJobResponse).
- Application/Downloads: NzbToken (the shared krautwatch-token codec, now the single
  source of truth the indexer's NZB writer also uses) + AddDownloadByTokenHandler.
- One instance apikey (Krautwatch:ApiKey) shared by both surfaces via ApiKeyGuard;
  Newznab caps stays open.

Actual stream pulling stays the Downloader agent's job (future work) — the client
persists + enqueues the intent. ./build.cmd Test green (Application 44).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ChrisonSimtian
ChrisonSimtian merged commit e0cc827 into main Jul 26, 2026
1 check passed
@ChrisonSimtian
ChrisonSimtian deleted the feat/sabnzbd-download-client branch July 26, 2026 10:34
@ChrisonSimtian ChrisonSimtian added the enhancement New feature or request label Aug 2, 2026
@ChrisonSimtian ChrisonSimtian changed the title feat(download-client): SABnzbd-compatible client (closes the *arr round-trip) Expose a SABnzbd-compatible download client Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant