Skip to content

fix: support mode=addurl over GET so category is honored - #70

Merged
thedancingdeveloper merged 1 commit into
mainfrom
fix/addurl-get-category
Aug 11, 2026
Merged

fix: support mode=addurl over GET so category is honored#70
thedancingdeveloper merged 1 commit into
mainfrom
fix/addurl-get-category

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Collaborator

Summary

  • Fixes Categories not available in Nzb360 #65: NZB360's "add from search" (and real SABnzbd) send mode=addurl as a plain GET request, since there's no file body to upload. The GET route only dispatched a fixed set of modes and had no case for addurl/addfile, so these requests fell into the "Unknown mode" branch and any cat (category), priority, or password the client sent was silently dropped — hence "can't change the category" when adding via search.
  • Extracted the URL-fetch-and-enqueue logic (previously only reachable via the multipart POST handler) into a shared handle_addurl() used by both h_sabnzbd_api_get and h_sabnzbd_api_post, so GET requests now apply cat/priority/password exactly like POST does.

Test plan

  • cargo test -p nzb-web — added addurl_over_get_applies_requested_category, which spins up a tiny local TCP server serving a sample NZB, issues a GET mode=addurl&cat=movies request through h_sabnzbd_api_get, and asserts a successful response with an nzo_id.
  • cargo clippy -p nzb-web --all-targets — clean.

🤖 Generated with Claude Code

NZB360 (and real SABnzbd) add search results by issuing a plain GET
request with mode=addurl, since there's no file body to upload — only
the multipart POST path applied the cat/priority/password overrides
for that mode, so GET requests silently fell through to the "Unknown
mode" branch and any requested category was dropped.

Extract the URL-fetch-and-enqueue logic into a shared handle_addurl()
used by both the GET and POST entry points.
@thedancingdeveloper
thedancingdeveloper merged commit 4b4d48a into main Aug 11, 2026
6 checks passed
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.

Categories not available in Nzb360

1 participant