feat(leaving-soon): add duration property for explicit deletion dates#245
Merged
feat(leaving-soon): add duration property for explicit deletion dates#245
Conversation
Allow users to configure how long items stay in the "Leaving Soon" state before deletion, replacing vague "next cleanup cycle" text with a concrete date in notifications and Plex collection descriptions. The duration field accepts formats like "7d" (days) or "24h" (hours). When set, all notification providers (email, Discord, Slack, Telegram) and the Plex collection summary display the exact removal date. Falls back to schedule-derived date if duration is not configured.
Contributor
|
🐳 A Docker image for this PR will be available after the build completes: docker run -e LOG_LEVEL=DEBUG --rm \
-v ./config:/config \
-v ./logs:/config/logs \
ghcr.io/rfsbraz/deleterr:pr-245
|
Items added to the leaving soon collection were deleted on the very next run regardless of the configured duration. The duration property was display-only — used for notifications and collection summaries but never checked before deleting. Add a state file (/config/.deleterr_state.json) that records when each item was tagged to the leaving soon collection. On each run, items are only eligible for deletion once tagged_at + duration has elapsed. Key behaviors: - No duration configured: existing behavior (delete on next run) - Duration not elapsed: skip deletion, log remaining time - Duration elapsed: delete as normal - State file missing/corrupt: treat items as newly tagged (conservative) - Daily schedule with 7d duration: items wait the full 7 days across multiple runs, staying in the collection until eligible Fixes #244
|
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
durationproperty toleaving_soonconfig (e.g.,7d,24h) that defines how long items stay before deletionTest plan
parse_leaving_soon_duration) — valid formats, invalid formats, edge casescompute_deletion_date— duration priority, schedule fallback, neither setLeavingSoonConfig.durationfieldtests/configs/0.3.0_leaving_soon_duration.yaml)durationis setdurationis omitted