### TQM Configuration Examples Source: https://github.com/autobrr/tqm/blob/main/README.md Provides examples of TQM configuration, including setting modes (full, remove), upload limits, and update conditions based on torrent properties like seeds, private status, and seeding days. ```yaml mode: full update: - Seeds <= 3 # Example: Limit upload speed for public torrents that have seeded for over 2 days # - name: limit-public-seed-time # mode: add # Add tag (optional, could just limit speed without tagging) # uploadKb: 100 # Limit to 100 KiB/s # update: # - IsPrivate == false # Only target public torrents # - SeedingDays > 2.0 # Example: Tag without mode specification (defaults to "full") # - name: completed-torrents # update: # - Downloaded == true ``` -------------------------------- ### regexp2 Pattern Case Sensitivity Source: https://github.com/autobrr/tqm/blob/main/README.md Illustrates how to specify case sensitivity for individual patterns when using RegexMatchAny in autobrr/tqm. Shows examples for mixed case sensitivity and uniform case insensitivity. ```yaml # First pattern is case-insensitive, second is case-sensitive - RegexMatchAny("(?i)pattern1, pattern2") # Both patterns are case-insensitive - RegexMatchAny("(?i)pattern1, (?i)pattern2") ``` -------------------------------- ### Labeling Rules Source: https://github.com/autobrr/tqm/blob/main/README.md Defines rules for applying labels to torrents based on multiple conditions. Examples include labeling 'permaseed-btn' for specific BTN season packs and 'autoremove-btn' for others that don't meet the permaseed criteria. ```yaml label: # btn 1080p season packs to permaseed (all must evaluate to true) - name: permaseed-btn update: - Label == "sonarr-imported" - TrackerName == "landof.tv" - Name contains "1080p" - len(Files) >= 3 # cleanup btn season packs to autoremove-btn (all must evaluate to true) - name: autoremove-btn update: - Label == "sonarr-imported" - TrackerName == "landof.tv" - not (Name contains "1080p") - len(Files) >= 3 ``` -------------------------------- ### Filter Rules (Ignore, Remove, Pause) Source: https://github.com/autobrr/tqm/blob/main/README.md Defines rules for ignoring, removing, or pausing torrents based on various criteria such as registration status, seeding time, ratio, labels, and tags. Includes examples for specific tracker rules and general conditions. ```yaml filters: default: # if true, data will be deleted from disk when removing torrents (default: true) #DeleteData: false ignore: # general - IsTrackerDown() - Downloaded == false && !IsUnregistered() - SeedingHours < 26 && !IsUnregistered() # permaseed / un-sorted (unless torrent has been deleted) - Label startsWith "permaseed-" && !IsUnregistered() # Filter based on qbittorrent tags (only qbit at the moment) - '"permaseed" in Tags && !IsUnregistered()' # Example: Ignore private torrents unless they are unregistered # - IsPrivate == true && !IsUnregistered() remove: # general - IsUnregistered() # Example: Remove non-private torrents that meet ratio/seed time criteria # - IsPrivate == false && (Ratio > 2.0 || SeedingDays >= 7.0) # imported - Label in ["sonarr-imported", "radarr-imported", "lidarr-imported"] && (Ratio > 4.0 || SeedingDays >= 15.0) # ipt - Label in ["autoremove-ipt"] && (Ratio > 3.0 || SeedingDays >= 15.0) # hdt - Label in ["autoremove-hdt"] && (Ratio > 3.0 || SeedingDays >= 15.0) # bhd - Label in ["autoremove-bhd"] && (Ratio > 3.0 || SeedingDays >= 15.0) # ptp - Label in ["autoremove-ptp"] && (Ratio > 3.0 || SeedingDays >= 15.0) # btn - Label in ["autoremove-btn"] && (Ratio > 3.0 || SeedingDays >= 15.0) # hdb - Label in ["autoremove-hdb"] && (Ratio > 3.0 || SeedingDays >= 15.0) # Qbit tag utilities - HasAllTags("480p", "bad-encode") # match if all tags are present - HasAnyTag("remove-me", "gross") # match if at least 1 tag is present pause: # New section for pausing torrents # Pause public torrents - IsPrivate == false #- IsPublic # same as above, but easier to remember # Pause torrents seeding for more than 7 days with a ratio below 0.5 - Ratio < 0.5 && SeedingDays > 7 # Pause incomplete torrents older than 2 weeks - Downloaded == false && AddedDays > 14 ``` -------------------------------- ### Filter Torrents by Public/Private Status Source: https://github.com/autobrr/tqm/blob/main/README.md Demonstrates how to filter torrents based on their public or private status using explicit comparisons like 'IsPublic == true' or 'IsPrivate == false'. It shows complementary fields and provides examples for ignoring and removing torrents based on this status. ```yaml filters: default: ignore: # These achieve the same result: - IsPublic == false && !IsUnregistered() # private torrents - IsPrivate == true && !IsUnregistered() # private torrents remove: # These achieve the same result: - IsPublic == true && Ratio > 2.0 # public torrents - IsPrivate == false && Ratio > 2.0 # public torrents tag: - name: public-torrent mode: full update: # These achieve the same result: - IsPublic == true # public torrents - IsPrivate == false # public torrents ``` -------------------------------- ### Client Configuration (Deluge, qBittorrent) Source: https://github.com/autobrr/tqm/blob/main/README.md Configures connections to torrent clients like Deluge and qBittorrent, specifying download paths, mappings, authentication, and client-specific options like Deluge's v2 protocol and qBittorrent's tag management. ```yaml clients: deluge: enabled: true filter: default download_path: /mnt/local/downloads/torrents/deluge free_space_path: /mnt/local/downloads/torrents/deluge # Required for Deluge with path that exists on server download_path_mapping: /downloads/torrents/deluge: /mnt/local/downloads/torrents/deluge host: localhost login: localclient password: password-from-/opt/deluge/auth port: 58846 type: deluge v2: true qbt: download_path: /mnt/local/downloads/torrents/qbittorrent/completed # free_space_path is not needed for qBittorrent as it checks globally via API download_path_mapping: /downloads/torrents/qbittorrent/completed: /mnt/local/downloads/torrents/qbittorrent/completed enabled: true filter: default create_tags_upfront: false # Only sets tags that matches torrents, prevents empty tags type: qbittorrent url: https://qbittorrent.domain.com/ user: user password: password # NEW: If this option is set to true, AutoTmm aka Auto Torrent Managment Mode, # will be enabled for torrents after a relabel. # This ensures the torrent is also moved in the filesystem to the new category path, and not only changes category in qbit # enableAutoTmmAfterRelabel: true ``` -------------------------------- ### Helper Filtering Functions Source: https://github.com/autobrr/tqm/blob/main/README.md Lists available helper functions for use in torrent filtering, such as checking registration status, tracker availability, tag presence, and file integrity. ```go IsUnregistered() bool // Evaluates to true if torrent is unregistered in the tracker IsTrackerDown() bool // Evaluates to true if the tracker appears to be down/unreachable HasAllTags(tags ...string) bool // True if torrent has ALL tags specified HasAnyTag(tags ...string) bool // True if torrent has at least one tag specified HasMissingFiles() bool // True if any of the torrent's files are missing from disk Log(n float64) float64 // The natural logarithm function ``` -------------------------------- ### Tracker API Key Configuration Source: https://github.com/autobrr/tqm/blob/main/README.md Configuration section for various trackers, requiring API keys or user credentials for integration with their services. ```yaml trackers: bhd: api_key: your-api-key btn: api_key: your-api-key ptp: api_user: your-api-user api_key: your-api-key hdb: username: your-username passkey: your-passkey red: api_key: your-api-key ops: api_key: your-api-key unit3d: aither: api_key: your_api_key domain: aither.cc blutopia: api_key: your_api_key domain: blutopia.cc ``` -------------------------------- ### regexp2 Pattern Matching Functions Source: https://github.com/autobrr/tqm/blob/main/README.md Demonstrates the usage of regexp2 functions for single, multiple (any), and all pattern matching within the autobrr/tqm filters. Supports case-insensitive matching and word boundaries. ```yaml filters: default: tag: # Single pattern matching - RegexMatch("(?i)\bpattern\b") # Match any of multiple patterns (comma-separated) - RegexMatchAny("(?i)\bpattern1\b, (?i)\bpattern2\b") # Match all patterns (comma-separated) - RegexMatchAll("(?i)\bpattern1\b, (?i)\bpattern2\b") ``` -------------------------------- ### Tagging Rules (qBittorrent) Source: https://github.com/autobrr/tqm/blob/main/README.md Configures rules to add or remove tags in qBittorrent based on filter matches. The 'mode' parameter can specify 'full' (add/remove), 'add' (only add), or 'remove' (only remove). ```yaml tag: - name: low-seed # Mode is optional and defaults to "full" if not specified # "mode: full" means tag will be added to # torrent if matched and removed from torrent if not # use `add` or `remove` to only add/remove respectivly # NOTE: Mode does not change the way torrents are flagged, # meaning, even with "mode: remove", ``` -------------------------------- ### TQM Relabel Command Source: https://github.com/autobrr/tqm/blob/main/README.md Relabels torrents in the client queue that match the configured filters. Use `--dry-run` to preview the changes. ```bash tqm relabel qbt --dry-run tqm relabel qbt ``` -------------------------------- ### Free Space Tracking in Filters Source: https://github.com/autobrr/tqm/blob/main/README.md Enables tracking of available disk space using `FreeSpaceSet` and `FreeSpaceGB()`. These can be used in filter expressions to make decisions based on remaining disk space. `free_space_path` is required for Deluge but not for qBittorrent. ```yaml filters: default: remove: - FreeSpaceSet == true && FreeSpaceGB() < 100 && SeedingDays > 30 ``` -------------------------------- ### Notification Settings Source: https://github.com/autobrr/tqm/blob/main/README.md Configures notification preferences, including the level of detail (detailed vs. summary) and whether to skip notifications for runs that result in no changes. Also includes Discord webhook settings. ```yaml notifications: # if detailed is true, TQM will send detailed information about each action it takes # if it is false it will only send a summary notification detailed: true # if skip_empty_run is true, TQM will skip sending a notification if the action didn't change anything skip_empty_run: true service: discord: webhook_url: https://discord.com/api/webhooks/yourwebhookid/yourwebhooktoken # Both username and avatar_url are optional and only needed if you want to # change the name and the picture of the webhook account username: yourusername avatar_url: youravatarurl ``` -------------------------------- ### Clone Autobrr TQM Repository Source: https://github.com/autobrr/tqm/blob/main/CONTRIBUTING.md Clones the forked autobrr/tqm project repository to your local machine. ```git git clone http://github.com//tqm ``` -------------------------------- ### Orphan Configuration Source: https://github.com/autobrr/tqm/blob/main/README.md Configuration for handling orphaned files, including a grace period for recently modified files and paths to ignore during the orphaned files check. ```yaml orphan: # grace period for recently modified files (default: 10m) # valid time units are: ns, us (or µs), ms, s, m, h grace_period: 10m # paths that will be ignored during the orphaned files check ignore_paths: - /mnt/local/downloads/torrents/qbittorrent/completed/tv-4k - /mnt/local/downloads/torrents/qbittorrent/completed/movie-4k ``` -------------------------------- ### TQM Retag Command Source: https://github.com/autobrr/tqm/blob/main/README.md Retags torrents in the client queue that match the configured filters. Currently only supported for qBittorrent. The `--dry-run` option allows for a preview. ```bash tqm retag qbt --dry-run tqm retag qbt ``` -------------------------------- ### TQM Orphan Command Source: https://github.com/autobrr/tqm/blob/main/README.md Identifies and removes orphan files and folders from the torrent client queue and local storage. Files modified within a grace period (default 10 minutes) are skipped. `--dry-run` is available for previewing. ```bash tqm orphan qbt --dry-run tqm orphan qbt ``` -------------------------------- ### TQM Clean Command Source: https://github.com/autobrr/tqm/blob/main/README.md Cleans the torrent client queue by removing torrents that match the configured filters. The `--dry-run` flag simulates the action without making changes. ```bash tqm clean qbt --dry-run tqm clean qbt ``` -------------------------------- ### Torrent Filterable Fields Definition Source: https://github.com/autobrr/tqm/blob/main/README.md Defines the structure of a Torrent object, listing all fields that can be used for filtering within the TQM configuration. Includes types and notes on supported operations. ```go type Torrent struct { Hash string Name string Path string TotalBytes int64 DownloadedBytes int64 State string Files []string Tags []string Downloaded bool Seeding bool Ratio float32 AddedSeconds int64 AddedHours float32 AddedDays float32 SeedingSeconds int64 SeedingHours float32 SeedingDays float32 Label string Seeds int64 Peers int64 IsPrivate bool IsPublic bool FreeSpaceGB func() float64 FreeSpaceSet bool TrackerName string TrackerStatus string } ``` -------------------------------- ### TQM Pause Command Source: https://github.com/autobrr/tqm/blob/main/README.md Pauses torrents in the client queue that match the configured filters. The `--dry-run` flag can be used to see which torrents would be paused. ```bash tqm pause qbt --dry-run tqm pause qbt ``` -------------------------------- ### Bypass Ignore If Unregistered Configuration Source: https://github.com/autobrr/tqm/blob/main/README.md When set to true, torrents marked as unregistered will not be ignored by filters. This simplifies filter configurations by removing the need to explicitly check `!IsUnregistered()` in ignore rules. ```yaml bypassIgnoreIfUnregistered: true filters: default: ignore: # general - IsTrackerDown() - Downloaded == false - SeedingHours < 26 - HardlinkedOutsideClient == true # permaseed / un-sorted (unless torrent has been deleted) - Label startsWith "permaseed-" # Filter based on qbittorrent tags (only qbit at the moment) - "permaseed" in Tags ``` -------------------------------- ### Manage Hardlink Scanning with MapHardlinksFor Source: https://github.com/autobrr/tqm/blob/main/README.md Details the 'MapHardlinksFor' setting within autobrr's TQM configuration. This setting controls when the system scans torrent files for hardlinks. It's recommended to use this setting only when filter rules utilize the 'HardlinkedOutsideClient' field to optimize performance. ```yaml filters: default: MapHardlinksFor: - clean ignore: - Downloaded == false - IsTrackerDown() - HardlinkedOutsideClient == true && !isUnregistered() # this makes sure we never remove torrents that has a hardlink (unless they are unregistered) ``` -------------------------------- ### Create Feature Branch Source: https://github.com/autobrr/tqm/blob/main/CONTRIBUTING.md Creates a new feature branch from the 'develop' branch to work on new features. ```git git checkout -b 'feature/my-new-feature' develop ``` -------------------------------- ### Per-Tracker Unregistered Statuses Configuration Source: https://github.com/autobrr/tqm/blob/main/README.md Allows overriding the default list of unregistered torrent status messages on a per-tracker basis. If a tracker is listed, only its specified statuses are used; otherwise, the default list applies. Matching is case-insensitive. ```yaml tracker_errors: per_tracker_unregistered_statuses: "passthepopcorn.me": - "torrent not found" - "unregistered torrent" "torrentleech.org": - "unregistered torrent" ``` -------------------------------- ### Conditional Upload Speed Limiting with Tags Source: https://github.com/autobrr/tqm/blob/main/README.md Explains how to apply upload speed limits to torrents conditionally using tags. By adding an 'uploadKb' field to tag rules, users can set specific upload speed limits (in KiB/s) for groups of torrents, with -1 indicating unlimited speed. This limit is applied during the 'tqm retag' command. ```yaml filters: default: tag: # Tag public torrents AND limit their upload speed to 50 KiB/s - name: public mode: add uploadKb: 50 update: - IsPrivate == false # Tag private torrents AND remove any upload speed limit - name: private mode: add uploadKb: -1 update: - IsPrivate == true ``` -------------------------------- ### Understanding IsUnregistered and IsTrackerDown Functions Source: https://github.com/autobrr/tqm/blob/main/README.md Clarifies the behavior and relationship between the 'IsUnregistered()' and 'IsTrackerDown()' functions in autobrr filters. 'IsUnregistered()' returns false if the tracker is down, while 'IsTrackerDown()' specifically checks for tracker unavailability. The documentation outlines different states a torrent can be in regarding registration and tracker status. ```autobrr # IsUnregistered() has built-in protection against tracker down states - it will return `false` if the tracker is down # IsTrackerDown() checks if the tracker status indicates the tracker is unreachable/down # The functions are independent but related - a torrent can be: # - Unregistered with tracker up (IsUnregistered: true, IsTrackerDown: false) # - Status unknown with tracker down (IsUnregistered: false, IsTrackerDown: true) # - Registered with tracker up (IsUnregistered: false, IsTrackerDown: false) # Note: While `IsUnregistered()` automatically handles tracker down states, you may still want to explicitly check for `IsTrackerDown()` in your ignore filters to prevent any actions when tracker status is uncertain. ``` -------------------------------- ### Commit Changes Source: https://github.com/autobrr/tqm/blob/main/CONTRIBUTING.md Stages and commits the changes made to the feature branch with a descriptive message. ```git git commit -am 'Added some feature' ``` -------------------------------- ### Push Feature Branch Source: https://github.com/autobrr/tqm/blob/main/CONTRIBUTING.md Pushes the committed changes from the local feature branch to the remote repository. ```git git push origin feature/my-new-feature ``` -------------------------------- ### Update Local Branch Source: https://github.com/autobrr/tqm/blob/main/CONTRIBUTING.md Keeps the local feature branch up-to-date with the latest changes from the 'upstream/develop' branch using rebase. ```git git pull --rebase upstream develop ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.