Skip to content

Move completed torrents to another folder - #671

Closed
denisnikulin wants to merge 4 commits into
ikatson:mainfrom
denisnikulin:move-completed-to
Closed

denisnikulin wants to merge 4 commits into
ikatson:mainfrom
denisnikulin:move-completed-to

Conversation

@denisnikulin

@denisnikulin denisnikulin commented Sep 19, 2026 •

Copy link
Copy Markdown

Adds --move-completed-to <folder> (RQBIT_MOVE_COMPLETED_TO, SessionOptions::move_completed_to). When a torrent finishes downloading, its files move from the output folder to that folder, keeping their sub-folder, and it keeps seeding from there.

Closes #599.

  • Includes feat: release file handles when a torrent is paused or stopped #621 (release file handles on pause) — merged since, so this is rebased on top of it. Resuming after such a pause is still fixed here: it otherwise fails with "file is None".
  • Files are renamed, or copied and removed across filesystems. An existing destination is an error unless overwrite is allowed, as when creating files.
  • Pause and delete are refused while a torrent is being moved, and the web UI shows "Moving".
  • The new folder is saved to session persistence (JSON and Postgres).
  • Covered by new e2e tests, and tested on a server moving from a local disk to an sshfs mount.

🤖 Generated with Claude Code

@denisnikulin denisnikulin changed the title Move completed torrents to another folder (#599), on top of #621 Move completed torrents to another folder Sep 19, 2026
denisnikulin and others added 4 commits September 20, 2026 19:14
Resuming a torrent whose files were released by a pause failed on the
first write with "file is None, torrent was probably paused", and the
torrent went into the error state. A released file is now reopened
from its path on first use.

release_files() is also forwarded through the storage middlewares.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Adds `--move-completed-to <folder>` (RQBIT_MOVE_COMPLETED_TO), and
`SessionOptions::move_completed_to` for library users. When a torrent
finishes downloading, its files are moved from the output folder to the
given folder, keeping their sub-folder, and the torrent keeps seeding
from there. Torrents with an explicit output folder outside the
session's one are left where they are.

Files are renamed, or copied and removed when the destination is on
another filesystem. As when creating files, an existing destination is
an error unless the torrent allows overwriting. The new folder is saved
to session persistence, and the old one is removed if it is empty.

Closes ikatson#599

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Deleting a torrent while it was being moved left the files that hadn't
been moved yet in the old folder, with "error moving """ in the log.
Pause and delete now return "torrent is being moved" until the move is
done, and the move doesn't start for a torrent that was just paused or
deleted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Torrent stats get a "moving" flag, and the web UI shows "Moving"
instead of "Seeding"/"Done" until the move to the completed folder is
done.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@denisnikulin

Copy link
Copy Markdown
Author

not sure if this feature it needed - can re-open later

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.

Request: ability to move downloaded torrents' files to another location

1 participant