Skip to content

Feature: optionally delete upstream TorBox task on job removal (opt-in) #3

Description

@calmcacil

Feature request: optionally delete the TorBox task when a job is removed

Problem

When Sonarr/Radarr (or a user) removes a torrent through the qBittorrent/SABnzbd API, TorBoxarr deletes its local job record but leaves the corresponding task alive in the TorBox account. Over time this accumulates orphaned entries in TorBox — the *arr apps consider the download gone, but it still occupies the TorBox library/queue and has to be pruned manually.

Proposal

Add an opt-in flag, TORBOXARR_UPSTREAM_REMOVE (default false), that makes a job removal also issue a delete against the TorBox API for the associated remote_id.

  • Enabled: removing a torrent in the *arr app cleans up both sides (local payload + TorBox task).
  • Disabled (default): behavior is unchanged — local-only removal, TorBox content retained.

Design sketch

  • A DeleteTask(ctx, sourceType, remoteID) method on the TorBox Client interface, with an HTTP implementation calling the TorBox control endpoints (/api/torrents/controltorrent and /api/usenet/controlusenetdownload with {"operation":"delete", ...}).
  • The remover worker checks the config flag; when set and a remote_id exists, it calls DeleteTask before local cleanup.
  • Retryable errors bubble up so the job is retried; non-retryable errors log a warning and proceed with local cleanup (removal is never blocked by an upstream failure).
  • Log/state messages distinguish "upstream torbox task deleted" from "torbox content retained".

Why opt-in

Some users deliberately keep content in TorBox after the *arr app has grabbed it (re-use, seeding credit, manual re-import). A flag respects both workflows and keeps the change non-breaking for existing deployments.

I have a working implementation and would be happy to open a PR if this direction sounds good.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions