Repository navigation
feat(torrent): check a torrent's files again and download what is missing - #670
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. |
b64819b to
dc6c421
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b64819bd12
ℹ️ 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".
8cef31d to
42e296d
Compare
Stacked on #669 (trackers); only the last two commits belong to this PR.
What
Implements the reserved
recheckcapability, for the "Product controls" and "Storage" rows of #162. A finished torrent was never checked again by itself, so files edited, restored from a backup or damaged stayed "completed".TorrentController.recheck(taskId). Every start of a torrent already checks its files, so the command acts by state: a completed task stops its seeder (a run would take it over unchecked) and runs again from what it has, downloads what is missing or wrong, completes anew and seeds again if it was meant to; a downloading task starts its check over; paused, queued and failed ones are left to their next start; a canceled one isinvalid_state.SourceHost.reopen(task)queues a completed task as a resume under its control lock.POST /api/torrents/{id}/recheckanswers the snapshot; the remote controller fails closed without the capability.Snapshots
New menu entry, so there is no before.
Testing
TorrentSeedingControlTestagainst a real engine and a loopback seeder: a completed torrent with one corrupted and one deleted file downloads them again and completes; a seeding torrent is checked by a session of its own and seeds again.KetchTorrentControllerTest(each state, unknown and unsupported),TorrentRoutesTest,RemoteTorrentControllerTest,RowContentTest; localization and hard-coded text checks.