fix: implement mode=get_scripts - #81
Closed
thedancingdeveloper wants to merge 1 commit into
Closed
Conversation
get_scripts is a real top-level SABnzbd API mode (sabnzbd/api.py::_api_table["get_scripts"]) that fell through dispatch_mode's default arm as "Unknown mode". RustNZB doesn't support post-processing scripts, so ["None"] -- the same value real SABnzbd reports with no scripts configured -- is the correct permanent response. Clients that fetch categories and scripts together to populate an add-download dialog may abort populating the whole dialog (category picker included) if either call errors, so this is a plausible second contributor to #65 alongside #73.
Collaborator
Author
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
Fixes #74:
mode=get_scriptsis a real, top-level SABnzbd API mode (sabnzbd/api.py:1107,_api_table["get_scripts"] = (_api_get_scripts, 2)) that RustNZB didn't handle — it fell throughdispatch_mode's default arm and returned{"status": false, "error": "Unknown mode: get_scripts"}.With no script directory / no scripts present, real SABnzbd's
list_scripts()returns["None"]— RustNZB doesn't support post-processing scripts at all, so that's the correct permanent response here too.Impact
Several SAB-compatible clients (including download-from-search "add" dialogs) fetch categories and scripts together to populate the add dialog, and some abort populating the whole dialog — category picker included — if either call errors. Possibly a second contributor to #65, alongside #73.
Fix
dispatch_modenow answersget_scriptswith{"scripts": ["None"]}.Test plan
cargo test -p nzb-web— addedget_scripts_reports_none_when_unsupported.cargo clippy -p nzb-web --all-targets— clean.nzb-webtest suite passes.🤖 Generated with Claude Code