fix: queue/history delete support multi-ID value and del_files - #82
Closed
thedancingdeveloper wants to merge 1 commit into
Closed
fix: queue/history delete support multi-ID value and del_files#82thedancingdeveloper wants to merge 1 commit into
thedancingdeveloper wants to merge 1 commit into
Conversation
Real SABnzbd's _api_queue_delete and _api_history_delete both accept a comma-separated list of nzo_ids in `value`, and _api_history_delete additionally accepts a `del_files` flag that removes the completed output directory from disk. RustNZB's handlers only matched a single ID (or the literal "all") and never freed disk space regardless of del_files. Also fixes a related gap: the POST handler's catch-all mode dispatch hardcoded `value`/`value2` to None instead of forwarding them from the query string, which would have silently broken these (and #72's priority/rename) sub-commands over POST.
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 #75: real SABnzbd's
_api_queue_deleteand_api_history_deleteboth accept a comma-separated list of nzo_ids invalue, and_api_history_deleteadditionally accepts adel_filesflag that removes the entry's completed output directory from disk:RustNZB's
handle_queue_delete/handle_history_deleteonly matched a single ID (or the literal"all"), anddel_fileswasn't even a field onSabApiRequest— history-delete never freed disk space regardless of what the client requested.Fix
SabApiRequestgains adel_filesfield.valueon,and act on every matching job/entry, returning{"status": ..., "nzo_ids": [...] }(queue) matching the real shape.handle_history_deleteremoves the entry'soutput_dirfrom disk whendel_filesis truthy (1/true/yes/on).handle_queue_deletedoesn't need equivalent logic —remove_jobalready always cleans up a job's incomplete work directory.value/value2toNoneinstead of forwarding them from the query string, which would have silently broken these actions (and SABnzbd compat: real priority/rename/purge/sort queue sub-commands are unreachable #72'spriority/renamerouting) whenever called over POST rather than GET.Test plan
cargo test -p nzb-web— addedqueue_delete_removes_multiple_comma_separated_ids,history_delete_with_del_files_removes_output_directory,history_delete_without_del_files_keeps_output_directory.cargo clippy -p nzb-web --all-targets— clean.nzb-webtest suite passes.cargo test -p rustnzb --test global_pause_api(existing consumer ofSabApiRequest) passes unchanged.🤖 Generated with Claude Code