Skip to content

Conversation

@Baz00k
Copy link

@Baz00k Baz00k commented Sep 11, 2025

Description

This PR introduces a new job that removes torrents from qBittorrent that are determined to be finished and no longer needed. The job automatically removes torrents that are done seeding, filtering them by user defined tags and categories.

Use case

The remove_completed job is particularly useful in the following scenarios:

  1. Automated Cleanup of Seeded Torrents: For users who seed torrents to a certain ratio or for a specific duration, this job automates the removal of those torrents once the seeding goals have been met. This helps to keep the download client's queue clean and manageable without manual intervention.

  2. Integration with Private Trackers and obsolete_tag: When using private trackers, it's often necessary to seed torrents to maintain a good ratio. Other decluttarr jobs can be configured to tag torrents with an obsolete_tag instead of removing them immediately, leaving them dangling. The remove_completed job can then be configured to target this obsolete_tag. This creates a powerful workflow where decluttarr identifies releasess to be replaced, tags them, and then remove_completed cleans them up once they have finished seeding, ensuring that ratio requirements are met. This makes decluttarr a one-stop shop for keeping *arr downloads completely automated.

  3. Category-Based Cleanup: If you organize your downloads into categories within your download client, you can use remove_completed to target specific categories for cleanup. For example, if you have a category for downloads from a specific source (e.g., autobrr automations for boosting private trackers ratio), you can have remove_completed automatically remove items from that category once they are completed.

@ManiMatter
Copy link
Owner

hi @Baz00k , thanks again for this PR. Just wanted to check when you'll be able to have a look at my review? I'll wait with merging dev to latest, with this being the last feature to make it to v2 :)

@Baz00k
Copy link
Author

Baz00k commented Sep 30, 2025

Hi, I'm not seeing any code review, did you forget to finish/publish it? 😅

Copy link
Owner

@ManiMatter ManiMatter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, many thanks for your contribution. I like the idea.

I reviewed the code and added few comments. Could you please have a look? Thank you.

README.md Outdated
- Permissible Values: True, False
- Is Mandatory: No (Defaults to False)

#### REMOVE_COMPLETED
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to call it remove_seeding_completed?

README.md Outdated
- Steers whether completed downloads are removed from your download client's queue. This is particularly useful for cleaning up torrents that have finished seeding and are no longer needed.
- Permissible Values:
- `target_tags`: A list of tags to identify completed items for removal.
- `target_categories`: A list of categories to identify completed items for removal.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you perhaps make 2 examples (one for target tags, one for target categories) to explain how those come into play?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these examples make sense?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the settings of qbitorrent, we can define what should happen when seeding targets are reached (such as: remove torrent & files).

If I understand correctly, the feature you want to introduce in decluttarr is a more granular removal mechanism, which only applies to specific tags & categories.

Is that right?

What I'm a bit missing from the description is how this is different from just using the "onboard" functionality in qbit.

Also, could you add what happens if you don't specify "target_tags" or "target_categories" (ie it will consider all tags / categories, is my understanding).
If both are provided, it will only consider those that match both the tags + categories ("and" condition between the two, or is it either "or" condition between the two)?

@ManiMatter

This comment was marked as off-topic.

@Baz00k

This comment was marked as resolved.

@Baz00k
Copy link
Author

Baz00k commented Oct 15, 2025

@ManiMatter Could you take a look once again?

@ManiMatter

This comment was marked as resolved.

@Baz00k

This comment was marked as resolved.

@ManiMatter
Copy link
Owner

ManiMatter commented Oct 20, 2025

Here's what I changed:

  1. Renamed the job to "remove_done_seeding", hope that makes sense?
  2. If user adds remove_done_seeding but provides neither target_tags nor target_categories, the configured obsolete tag is set as target_tag. My idea here was to keep the config as short as possible, thus added this default
  3. Fixed some items in the dev branch and rebased your branch by pulling those changes in

Pls let me know if you spot any issues or any feedback you may have.

Cheers

Copy link
Author

@Baz00k Baz00k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ManiMatter I've been testing the latest version on my server for the past few days and everything seems to work as expected. Only one small comment regarding the docs, otherwise, this feature looks completed to me.

- Removes downloads that are completed and are done with seeding from the download client's queue when they meet your selection criteria (tags and/or categories).
- "Done Seeding" means the seeding goals configured in your download client are met:
- Either the ratio limit is reached
- Or the seeding time limit (per-torrent overrides or the global limits).
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line suggests that per-torrent overrides only apply to the seeding time and not to ratio

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be more accurate?

  • "Done Seeding" means that the Ratio limit or Seeding Time limit for your download has been reached
  • The limits are taken from your global settings in your download client, or the download-specific overrides

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, looks great

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.

2 participants