-
Notifications
You must be signed in to change notification settings - Fork 1
Rules Engine
The rules engine is the core of Prunerr. You create rules that describe what content you want to clean up, and Prunerr finds matches in your library.
When you click Create Rule, the first tab shows templates based on your actual library data. Each one tells you how many items it would match and how much space you'd get back. Pick one, tweak it if you want, and save.
The sentence builder. You build a rule in plain English:
"Mark for deletion movies that haven't been watched in 90 days and are larger than 10 GB"
Pick conditions from the chip list, adjust the values, done. Good for straightforward rules.
The full-featured editor. You get nested AND/OR/NOT condition groups, 28+ fields to filter on, and every operator you'd need. This is where you build complex rules like "delete movies with an IMDb rating under 5 that nobody's watched, unless they're in a protected collection."
The field dropdown is searchable — just start typing to find what you need.
There are 28 condition fields across 6 categories:
Basics — Title, media type, release year, days since added, days since watched, play count, file size
Quality — Resolution (480p-4K), video codec, audio codec, HDR format, bitrate
Ratings — IMDb, TMDB, Rotten Tomatoes, content rating (PG, R, TV-MA, etc.)
Watching — Per-user watch status with time windows (e.g. "user X hasn't watched in 90 days")
Collections — Whether an item is in any protected collection, or a specific collection
Metadata — Genres, tags, studio, runtime, season/episode count, series status, original language
Each field supports relevant operators:
- Numeric: equals, not equals, greater than, less than, between, is empty, is not empty
- Text: contains, not contains, is one of, is not one of, regex match
- Lists: contains any of, contains all of, matches any
- Collections: is in a protected collection, is not in any protected collection, is in specific collection
- Watch status: watched in last X days, not watched in last X days, ever watched, never watched
As you build your rule, the preview panel on the right shows:
- How many items would match
- How much storage you'd reclaim
- Which items would be queued vs. skipped (protected)
- The top matches by file size with poster art
The preview updates in real-time as you change conditions (with a short debounce so it doesn't hammer the server).
Each rule has a priority (0-100). Higher priority rules win when an item matches multiple rules. If two rules have the same priority, the older one takes precedence.
When a rule matches items, you choose what happens:
| Action | What it does |
|---|---|
| Unmonitor Only | Stops monitoring in Sonarr/Radarr, keeps all files |
| Delete Files Only | Removes the media files, keeps the entry for re-download |
| Unmonitor & Delete | Removes files and stops monitoring (most common) |
| Full Removal | Completely removes from Sonarr/Radarr, everything gone |
Every rule has a grace period (in days). When items match, they go into the deletion queue and wait that many days before actually being removed. This gives you time to review and cancel if something got flagged by mistake.
Rules run automatically on the scan schedule. You can also run any rule manually from the Rules page — click the play button next to a rule.