feat(download): add Remove & Delete Files torrent completion action - #1401
Open
classicluna wants to merge 2 commits into
Open
classicluna wants to merge 2 commits into
classicluna wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Moderate issues remain with client-specific deletion behavior and unchecked removal failures.
Review effort: Lite
Findings: None
What changed in this PR
Adds a remove_and_delete torrent completion action that deletes downloaded data after successful imports.
Changes:
- Adds the new setting and documentation.
- Passes
delete_files=Trueduring cleanup. - Adds tests for deletion and failed imports.
- Review found unresolved client support and removal-failure handling issues.
| File | Summary |
|---|---|
tests/prowlarr/test_handler.py |
Tests the new cleanup behavior. |
shelfmark/download/clients/settings.py |
Adds the new option and description. |
shelfmark/download/clients/base_handler.py |
Applies conditional deletion; client support and failure-result handling need changes. |
docs/environment-variables.md |
Documents the new configuration value. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Author
|
@calibrain I opened this for #1027, where you offered to review a PR. The follow-up commit addresses the client-specific deletion and cleanup-failure concerns raised by the automated review; focused tests pass. No rush given your schedule, but I would appreciate a review when you have time. Thanks! |
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.
Closes #1027
Summary
remove_and_delete) option to the Torrent Completion Action settingdelete_files=True), matching what the usenet "move" flow already doesPROWLARR_TORRENT_ACTIONentry indocs/environment-variables.mdBehavior
The deletion runs from
post_process_cleanup, the same place as the existing Remove and Change Category actions, so it only happens after output transfer and post-processing have succeeded. At that point every file has already been copied or hardlinked into the library, and transfer size checks have passed. A failed import never removes or deletes anything. The torrent client deletes its own data, so Shelfmark does not delete paths itself and remote path mappings are not involved. Keep, Remove, and Change Category behave as before, and Keep is still the default.If a request matched a completed torrent that was already in the client, this option deletes that torrent's data too. That is the same scope the existing Remove action already applies to.
Validation
make python-checks(ruff check, ruff format, basedpyright on backend and tests, vulture): passedmake python-test: 3363 passed, 5 skipped, 9 failed. All 9 are intests/config/test_entrypoint_permissions.pyand happen because macOS/bin/bash3.2 does not support${1,,}inentrypoint.sh. They do not touch this change.tests/prowlarr/test_handler.py:delete_files=Falseand Remove & Delete Files passesdelete_files=TruePROWLARR_TORRENT_ACTION=remove_and_deleteset through real config loading, with a stub client that deletes its folder. The torrent folder was deleted and the hardlinked library file stayed intact.