fix: route mode=queue&name=priority/rename/purge sub-commands - #79
Closed
thedancingdeveloper wants to merge 1 commit into
Closed
fix: route mode=queue&name=priority/rename/purge sub-commands#79thedancingdeveloper wants to merge 1 commit into
thedancingdeveloper wants to merge 1 commit into
Conversation
Real SABnzbd has no top-level mode=priority or mode=rename -- those are sub-commands of mode=queue, dispatched via the name parameter (_api_queue_table: delete, rename, priority, purge, pause, resume, change_complete_action, ...). handle_queue only recognized delete/pause/resume, so a compliant client's real priority-change or rename request silently fell through to a plain queue listing. Adds routing for name=priority, name=rename, name=purge, and a change_complete_action no-op, alongside the existing (non-standard but harmless) top-level mode=priority/mode=rename aliases.
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 #72: real SABnzbd has no top-level
mode=priorityormode=rename. Those (andpurge,change_complete_action,sort,delete_nzf) are sub-commands ofmode=queue, dispatched via thenameparameter through_api_queue_table:handle_queueonly recognizedname ∈ {"delete", "pause", "resume"}— any other sub-command (in particularpriorityandrename, the ones a real client actually calls to change a job's priority or rename it) silently fell through to a plain queue listing instead of performing the action. Meanwhile rustnzb had invented top-levelmode=priority/mode=renamethat don't exist in the real protocol, so no compliant client would ever call them.Fix
Add
name=priority,name=rename,name=purge, andname=change_complete_actionrouting tohandle_queue, matching the realvalue/value2contract (value= nzo_id(s),value2= new priority/name).sortanddelete_nzfare left as a follow-up — RustNZB's queue manager has no equivalent capability yet (custom sort criteria / per-file removal within an NZB). The existing top-levelmode=priority/mode=renamealiases are left in place as a harmless compatibility bonus.Test plan
cargo test -p nzb-web— addedqueue_priority_subcommand_changes_job_priorityandqueue_rename_subcommand_renames_job, which drive the realmode=queue&name=priority|renamerequest throughdispatch_modeand assert the queue manager's job state actually changed.cargo clippy -p nzb-web --all-targets— clean.nzb-webtest suite passes.🤖 Generated with Claude Code