Repository navigation
feat(torrent): use files already in place when a download asks to overwrite - #672
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
4694fdf to
df766b6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4694fdf8be
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
4ff0cae to
116af24
Compare
…y why a file blocks a v2 folder
116af24 to
7271f91
Compare
Stacked on #671 (creation); only the commits after it belong to this PR.
What
The "Storage: import existing data" row of #162, and what makes a created torrent seedable.
A torrent always saved beside an existing file or folder of its name, as
name (1), so content already on disk (a torrent just created, or files another client downloaded) could never be reused.fileConflict = OVERWRITEfor a source that writes its own files gets the name Ketch chose although something has it (DownloadExecution.existingPath,OutputPathReservations.reserveExisting), unless a running download reserved the path or another unfinished task saves there. Only the request does this, never the "When a file already exists" setting, as such a source writes in place from its first piece rather than replacing the file once it completes.ketch add --overwrite pack.torrent ~/Videos/, orDownloadRequest.fileConflictin the SDK. Devices list theimportcapability. The server's existing rules for overwriting requests apply unchanged.The adopted files become the task's: removing it with its files deletes them, which the docs say.
Testing
TorrentAdoptFilesTest: created v1, v2 and hybrid torrents, added over the folder they were made from, complete without a single peer and leave the files as they were; without the request a torrent still saves intopack (1). Core, torrent, server and CLI suites pass on this branch.torrent.existingFiles. Only that switch putsOVERWRITEon a torrent's request, never the device's file conflict setting. Translated in every language.A folder that holds another unfinished download is never taken, and a file where a v2 or hybrid torrent's folder goes fails the run saying so (v2 keeps even a single file inside a folder of its name); a v1 torrent uses a single file in place.
Snapshots
New option, so there is no before.