feat: add content_path filter for precise torrent deletion#207
Open
sysit wants to merge 1 commit into
Open
Conversation
Add support for filtering torrents by their download directory (content_path).
This allows users to apply different retention policies based on where
torrents are downloaded.
Features:
- Filter by exact path match
- Filter by parent directory (e.g., /downloads/tv matches /downloads/tv/show)
- Support multiple content paths
- Support excluded_content_paths for fine-grained control
- Works with qBittorrent and Transmission clients
Example configuration:
strategies:
movies_cleanup:
content_paths:
- /downloads/movies
remove: seeding_time > 2592000 or ratio > 2
tv_cleanup:
content_paths:
- /downloads/tv
excluded_content_paths:
- /downloads/tv/important
remove: seeding_time > 1209600
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
Add support for filtering torrents by their download directory (
content_path), allowing users to apply different retention policies based on where torrents are downloaded.Motivation
Currently, users can filter torrents by tracker, category, and status. However, there's no way to differentiate torrents based on their download location. This feature enables more precise cleanup strategies, e.g.:
Changes
New Files
autoremovetorrents/filter/contentpath.py- ContentPathFilter implementationModified Files
autoremovetorrents/client/qbittorrent.py- Fetchcontent_pathfrom qBittorrent APIautoremovetorrents/client/transmission.py- FetchdownloadDirfrom Transmission APIautoremovetorrents/strategy.py- Register ContentPathFilterautoremovetorrents/torrent.py- Documentcontent_pathattributeUsage Example
Features
/downloads/tvmatches/downloads/tv/show)excluded_content_pathsfor fine-grained controlTesting
Tested with:
Checklist