Skip to content

erasedata: delete the data of downloads rtorrent has not opened - #3154

Merged
xirvik merged 1 commit into
Novik:masterfrom
xirvik:fix/erasedata-closed-download-paths
Aug 10, 2026
Merged

erasedata: delete the data of downloads rtorrent has not opened#3154
xirvik merged 1 commit into
Novik:masterfrom
xirvik:fix/erasedata-closed-download-paths

Conversation

@xirvik

@xirvik xirvik commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

d.base_path and f.frozen_path are filled in when rtorrent opens a download's file list, and are not restored from the session. A download that has not been opened since rtorrent started therefore reports both as empty -- which is every torrent that was stopped when the session was loaded.

removewithdata collected no paths for those, skipped writing the .list that the garbage collector consumes, and erased the torrent anyway, leaving the data on disk with nothing left to identify it. Both "Delete Data" and "Delete Path" were affected, because the list is skipped before the delete mode is read. Starting the torrent or forcing a recheck opens the file list and makes the next attempt succeed, which is why this looks like "old torrents do not delete their data".

Fall back to d.directory and f.path, which are always available, and keep the torrent when neither source resolves rather than erasing a download whose files can no longer be identified.

d.base_path and f.frozen_path are filled in when rtorrent opens a
download's file list, and are not restored from the session. A download
that has not been opened since rtorrent started therefore reports both
as empty -- which is every torrent that was stopped when the session was
loaded.

removewithdata collected no paths for those, skipped writing the
<hash>.list that the garbage collector consumes, and erased the torrent
anyway, leaving the data on disk with nothing left to identify it. Both
"Delete Data" and "Delete Path" were affected, because the list is
skipped before the delete mode is read. Starting the torrent or forcing
a recheck opens the file list and makes the next attempt succeed, which
is why this looks like "old torrents do not delete their data".

Fall back to d.directory and f.path, which are always available, and
keep the torrent when neither source resolves rather than erasing a
download whose files can no longer be identified.
@xirvik
xirvik merged commit 403f6cc into Novik:master Aug 10, 2026
5 checks passed
@xirvik
xirvik deleted the fix/erasedata-closed-download-paths branch August 10, 2026 16:15
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.

1 participant