feat: add keep_downloads option and prune completed TODO items - #39
Open
bugrax wants to merge 2 commits into
Open
feat: add keep_downloads option and prune completed TODO items#39bugrax wants to merge 2 commits into
bugrax wants to merge 2 commits into
Conversation
Adds a `keep_downloads` config option (default false). When true, the locally downloaded files are kept in `download_directory` after the *arr imports them instead of being deleted — useful when the *arr copies imports and you want to keep the original. put.io transfers/files are still cleaned up as usual. Also prunes the README TODO list of items that are done or no longer relevant: - "Better error handling and retry behavior" — addressed across the download resume/retry, request/stream timeouts, and worker-resilience work (wouterdebie#21, wouterdebie#30, wouterdebie#32, wouterdebie#34). - "The session ID provided is hard coded. Not sure if it matters." — it doesn't; sonarr/radarr/whisparr work fine against the fixed session id. - "Add option to not delete downloads" — implemented here.
There was a problem hiding this comment.
Pull request overview
Adds a keep_downloads configuration option so users can preserve locally downloaded files after *arr import (useful for copy-based imports), and updates docs/templates accordingly. Also removes completed items from the README TODO list.
Changes:
- Add
keep_downloadsto configuration (serde + Figment defaults) and document it in templates/README. - Gate local post-import deletion in
watch_for_importonkeep_downloads. - Prune completed TODO bullets from README.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/utils.rs | Updates the generated config template to include keep_downloads. |
| src/main.rs | Adds keep_downloads to the config struct and Figment defaults. |
| src/download_system/orchestration.rs | Makes local cleanup after import conditional on keep_downloads. |
| README.md | Documents keep_downloads and prunes completed TODO items. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- orchestration: delete the imported local copy with async fs and log failures instead of blocking std::fs + unwrap/panic, so a failed delete (permissions, concurrent removal, path already gone) can't take the process down or stall the runtime. - README: the keep_downloads note referred to sonarr/radarr/whisparr; use "*arr" since lidarr and [arrs.*] instances are supported too.
Contributor
Author
|
Both addressed in 934cb1f:
|
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
Works through the README TODO list — implements the one actionable item and prunes the rest.
keep_downloadsoption (new)Adds a
keep_downloadsconfig flag (defaultfalse, so existing behaviour is unchanged). Whentrue, the locally downloaded files are kept indownload_directoryafter the *arr imports them, instead of being deleted. Useful when the *arr copies imports (rather than hardlink/move) and you want to keep the original. Only affects local files — put.io transfers/files are still cleaned up as usual.Wired through the config struct, the Figment defaults, and the generated config template, and gated in
watch_for_import.TODO cleanup
Left the two genuinely open items (better transfer→import mapping for samples; auto-selecting the fastest put.io proxy).
Testing
Builds cleanly; default (
keep_downloads = false) keeps the current delete-after-import behaviour.