Skip to content

SABnzbd compat: queue/history delete don't support multi-ID value or del_files #75

Description

@thedancingdeveloper

Summary

Real SABnzbd's mode=queue&name=delete and mode=history&name=delete accept a comma-separated list of nzo_ids in value, plus a del_files flag to also remove files from disk. rustnzb's equivalents only handle a single ID and never honor del_files.

Real behavior

# sabnzbd/api.py:197-207
def _api_queue_delete(value, kwargs):
    if value.lower() == "all":
        ...
    elif items := clean_comma_separated_list(value):
        delete_all_data = bool_conv(kwargs.get("del_files"))
        removed = sabnzbd.NzbQueue.remove_multiple(items, delete_all_data=delete_all_data)
        return report(keyword="", data={"status": bool(removed), "nzo_ids": removed})
    ...

# sabnzbd/api.py:511-554 (_api_history_delete) similarly accepts
# a comma-separated `value` and a `del_files` flag that removes
# completed/incomplete files from disk.

What rustnzb does instead

handle_queue_delete and handle_history_delete (crates/nzb-web/src/sabnzbd_compat.rs) each only look for a single job/entry ID (or the literal "all"), and del_files isn't even a field on SabApiRequest — files are never removed from disk regardless of what the client requests.

Impact

  • Multi-select delete (bulk cleanup) from a SAB-compatible client silently only removes (or fails to find) whichever single ID happens to match, rather than deleting the whole batch.
  • Clients that set del_files=1 expecting a failed/superseded download's files to be freed from disk won't see that happen, so disk usage grows unexpectedly compared to real SABnzbd.

Fix

  • Parse value as a comma-separated list in both delete handlers (mirroring clean_comma_separated_list).
  • Add a del_files field to SabApiRequest and, when true, remove the job's on-disk output (and/or incomplete work directory) as part of the delete.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions