Skip to content

fix: implement mode=get_scripts - #81

Closed
thedancingdeveloper wants to merge 1 commit into
mainfrom
fix/74-get-scripts
Closed

fix: implement mode=get_scripts#81
thedancingdeveloper wants to merge 1 commit into
mainfrom
fix/74-get-scripts

Conversation

@thedancingdeveloper

Copy link
Copy Markdown
Collaborator

Summary

Fixes #74: mode=get_scripts is 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 through dispatch_mode's default arm and returned {"status": false, "error": "Unknown mode: get_scripts"}.

# sabnzbd/api.py:796-797
def _api_get_scripts(name, kwargs):
    return report(keyword="scripts", data=list_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_mode now answers get_scripts with {"scripts": ["None"]}.

Test plan

  • cargo test -p nzb-web — added get_scripts_reports_none_when_unsupported.
  • cargo clippy -p nzb-web --all-targets — clean.
  • Full nzb-web test suite passes.

🤖 Generated with Claude Code

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.
@thedancingdeveloper

Copy link
Copy Markdown
Collaborator Author

Superseded — this change landed via #84, which stacked all of #71-#77's fixes together and was squash-merged to save on redundant CI runs. Closing without merging to avoid re-applying the same diff.

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.

SABnzbd compat: mode=get_scripts is not implemented

1 participant