Leaving Soon¶
Deleterr's signature feature - a "death row" pattern that gives users time to watch content before it's deleted.
How It Works¶
Unlike traditional cleanup tools that delete content immediately, Deleterr implements a two-phase deletion process:
graph LR
A[Media matches<br/>deletion criteria] --> B[First Run:<br/>Tag item]
B --> C[User gets<br/>notification]
C --> D[Next Run:<br/>Delete item]
- First run: Items matching deletion criteria are tagged (added to a Plex collection and/or labeled), but NOT deleted
- Users are notified: Email, Discord, Slack, or Telegram alerts inform users about expiring content
- Subsequent runs: Previously tagged items are deleted, new candidates are tagged
This gives your users a "warning period" to watch content before it's removed.
Configuration¶
Basic Setup¶
Add the leaving_soon section to your library configuration:
libraries:
- name: "Movies"
radarr: "Radarr"
action_mode: "delete"
leaving_soon:
batch_size: 10
duration: "7d"
collection:
name: "Leaving Soon"
Batch Size¶
| Property | Type | Default | Description |
|---|---|---|---|
batch_size | integer | max_actions_per_run | How many items enter the Leaving Soon collection per cycle |
When batch_size is set, preview_next is no longer required and can be omitted or set to 0.
max_actions_per_run is ignored
When leaving_soon is configured, max_actions_per_run has no effect on the death row path. Use batch_size to control the number of items per cycle instead. If max_actions_per_run is explicitly set, Deleterr will log a warning.
Duration¶
The duration property controls how long items stay in the "Leaving Soon" state before deletion. When set, the exact deletion date is displayed in notifications and the Plex collection description, giving users a clear deadline.
| Property | Type | Default | Description |
|---|---|---|---|
duration | string | (none) | How long items stay before deletion. Format: <number>d for days or <number>h for hours |
Examples: 7d (7 days), 24h (24 hours), 30d (30 days)
An item counts as due up to one hour before its duration is up (or half the duration, if that is shorter). A run tags items a few minutes after it starts, so without this the run exactly one duration later would start just short of it and the deletion would slip to the following run.
With duration set, a new batch only enters once the current one is cleared. The run that deletes a batch tags nothing new, and the next batch is tagged on the run after it. So one cycle lasts the duration plus one run. For example, with duration: "7d" and a daily schedule, a batch tagged on day 0 is deleted on day 7 and the next batch is tagged on day 8.
Deleterr remembers when each item was tagged in /config/.deleterr_state.json and keeps a copy in /config/.deleterr_state.json.bak after every save. If the state file is damaged, Deleterr reads the copy instead. If neither can be read, it logs an error and starts over, so the timers restart and items can be announced again. The unreadable file is kept as .deleterr_state.json.reset-<date> when the new state is first saved.
If duration is not set, Deleterr will try to derive the deletion date from the scheduler interval. If neither is available, notifications will use the generic "next cleanup cycle" text.
Collection Settings¶
| Property | Type | Default | Description |
|---|---|---|---|
name | string | - | Name of the Plex collection to create |
Label Settings¶
You can also add labels to items instead of (or in addition to) collections:
| Property | Type | Default | Description |
|---|---|---|---|
name | string | - | Label to apply to items scheduled for deletion |
User Notifications¶
Configure notifications to alert users about content leaving soon. See Notifications for full setup details.
notifications:
leaving_soon:
subject: "Content leaving your Plex server soon!"
email:
smtp_server: "smtp.gmail.com"
smtp_port: 587
smtp_username: !env SMTP_USERNAME
smtp_password: !env SMTP_PASSWORD
use_tls: true
from_address: "plex@yourdomain.com"
to_addresses:
- "user1@example.com"
- "user2@example.com"
Example Workflow¶
Here's what happens during a typical Deleterr run with Leaving Soon enabled:
Week 1: First Run¶
- Deleterr identifies 15 movies matching deletion criteria
- Movies are added to the "Leaving Soon" collection in Plex
- Users receive email notification listing the 15 movies
- No deletions occur
Week 2: Second Run¶
- Deleterr identifies the same 15 movies are still tagged
- Those 15 movies are deleted from Radarr
- Without
duration, new movies matching criteria are tagged for the next cycle in this same run, and users receive a notification about them - With
durationset, nothing new is tagged in this run. The next batch is tagged on the following run, so a cycle is the duration plus one run (see Duration)
User Watches a Movie¶
If a user watches a movie that's in the "Leaving Soon" collection:
- The watch history is updated in Tautulli
- On next run, the movie no longer matches the
last_watched_thresholdcriteria - The movie is removed from the "Leaving Soon" collection
- The movie survives deletion
Keep an item that is leaving soon¶
Deleterr only deletes an item that is still in the Leaving Soon collection or still has the Leaving Soon label. The item must also still match your deletion rules.
To keep an item after it has been tagged:
- Open the Leaving Soon collection in Plex.
- Remove the item from the collection.
- If you also configured a Leaving Soon label, remove that label from the item. Deleterr still treats the item as leaving soon if either the collection or the label remains.
The next run does not delete that item.
This is not a permanent exclusion. If the item still matches your deletion rules, Deleterr can add it back when it next looks for new candidates. If you have not set duration, that can happen in the same run. If you have set duration, it happens after the current batch is cleared.
If you clear every Leaving Soon marker while a duration batch is still waiting, Deleterr treats the batch as cleared and can tag a new batch on that run. When both a collection and a label are configured, emptying only the collection is not enough. The items stay in the batch until the label is removed too.
To keep the item permanently, add an exclusion. The most direct option is a Plex label listed under exclude.plex_labels.
Tips¶
Adjust Thresholds for Your Schedule¶
Match your thresholds to your Deleterr schedule:
| Schedule | Recommended last_watched_threshold |
|---|---|
| Weekly | 90+ days |
| Daily | 14+ days |
| Monthly | 180+ days |
Use Plex Home Screen¶
Pin the "Leaving Soon" collection to your Plex home screen so users see it prominently:
- In Plex, navigate to the "Leaving Soon" collection
- Click the three dots menu
- Select "Add to Home"
Combine with Disk Thresholds¶
Leaving Soon works well with disk thresholds - items are only tagged when disk space is low:
libraries:
- name: "Movies"
radarr: "Radarr"
action_mode: "delete"
disk_size_threshold:
- path: "/data/media"
threshold: 500GB
leaving_soon:
batch_size: 10
collection:
name: "Leaving Soon"
Troubleshooting¶
Collection Not Appearing in Plex¶
- Verify Plex URL and token are correct in your config
- Check Deleterr logs for Plex API errors
- Ensure
batch_sizeorpreview_nextis greater than 0 - Run with
dry_run: false- collections are only created in non-dry-run mode
Items Not Being Deleted¶
- Confirm items were tagged in a previous run
- Check that items still match deletion criteria
- Verify
action_mode: "delete"is set - Look for exclusion rules that might be protecting the content
- Check whether someone removed the item from the Leaving Soon collection or removed its Leaving Soon label
Notifications Not Sending¶
See Notifications Troubleshooting for notification-specific issues.