Repository navigation
Conversation
Keeps the save root when a torrent moves to a folder that still ends with its add-time subfolder, so multi-file torrents keep a correct content_path.
…older The completed-folder move left the torrent pointing at the download folder, so the WebUI API v2 reported the old save_path and content_path and *arr imports failed. Set and persist the new location, and skip torrents already in the completed folder after a restart. Fixes TheDancingDeveloper-org#321
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.
Fixes #321.
Problem
When
RTBIT_COMPLETED_FOLDERis set, a finished torrent is moved to the completed folder, but the torrent keeps its old location. The WebUI API v2 compat layer then reports the oldsave_pathandcontent_path, so Sonarr, Radarr and Lidarr imports fail.Changes
Session::move_completed_torrentsets the torrent's location to the completed folder and persists it, so a restart keeps it.ManagedTorrentHandle::output_folder_rootkeeps the save root when the new location still ends with the add-time subfolder. Without it, a multi-file torrent would reportcontent_pathascomplete/Album/Album.qbit_save_pathand the persistence code both use it. Output is unchanged for torrents that haven't moved.Known limitation
The live storage keeps its old root until the next restart. Until then, deleting the torrent with its files, or moving it with set_location, still targets the old folder. Before this change these actions were broken even after a restart. Fixing it needs a new storage method, so it is left for a follow-up.
Validation
completed_folder_move_updates_reported_pathsadds a multi-file torrent with a save root, waits for the move, and checkssave_path,content_pathand the persisted location.cargo test -p swarmforge --features http-api --lib: 404 passed, 1 failed. The failure wastests::e2e::test_e2e_download_utp, a timeout waiting for background tasks. It passed when the e2e tests were re-run alone, and those tests don't set a completed folder.cargo clippy --all-targets -- -D warningsandcargo fmt --checkare clean.