Skip to content

feat: add keep_downloads option and prune completed TODO items - #39

Open
bugrax wants to merge 2 commits into
wouterdebie:mainfrom
bugrax:keep-downloads-option
Open

feat: add keep_downloads option and prune completed TODO items#39
bugrax wants to merge 2 commits into
wouterdebie:mainfrom
bugrax:keep-downloads-option

Conversation

@bugrax

@bugrax bugrax commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Summary

Works through the README TODO list — implements the one actionable item and prunes the rest.

keep_downloads option (new)

Adds a keep_downloads config flag (default false, so existing behaviour is unchanged). 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 (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.

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.
Copilot AI review requested due to automatic review settings July 18, 2026 11:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_downloads to configuration (serde + Figment defaults) and document it in templates/README.
  • Gate local post-import deletion in watch_for_import on keep_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.

Comment thread src/download_system/orchestration.rs Outdated
Comment thread README.md Outdated
- 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.
@bugrax

bugrax commented Jul 18, 2026

Copy link
Copy Markdown
Contributor Author

Both addressed in 934cb1f:

  1. Blocking delete + panic — the post-import cleanup now uses async tokio::fs and logs a failure (warn!) instead of unwrap()/panic!, so a failed delete (permissions, a concurrent removal, the path already gone) can't take the process down or stall the runtime.
  2. Doc accuracy — the keep_downloads note now says *arr instead of listing sonarr/radarr/whisparr, since lidarr and [arrs.*] instances are supported too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants