Repository navigation
feat(torrent): create v1, v2 and hybrid torrents - #671
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 273f2da185
ℹ️ 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".
273f2da to
7699014
Compare
7699014 to
25612b6
Compare
25612b6 to
a67d57a
Compare
Stacked on #670 (recheck); only the last three commits belong to this PR.
What
The "Creation: v1/v2/hybrid metainfo and magnets" row of #162.
TorrentCreator.create(path, TorrentCreateOptions, onProgress)hashes a file or folder in one pass and returns aCreatedTorrent: the.torrentbytes, the info hashes and the magnet link (none for a private torrent).TorrentFormatisV1(default),V2orHYBRID, with BEP 47 padding in hybrids. Options: piece length (a power of two from 16 KiB to 16 MiB, or picked for about a thousand pieces), name, tracker tiers, web seeds, private, comment, creator, creation date and a private tracker's source tag.ketch create <path>saves<name>.torrentand prints its path and magnet link;--format,--tracker,--web-seed,--private,--piece-length,--name,--comment,--source,-o,--overwrite,--json.Testing
TorrentCreatorTest: created v1, v2 and hybrid torrents are byte for byte the hand-written fixtures the engine's interoperability tests use; single files, file order, options, piece length choice, progress and refusals.CreatedTorrentInteropTest(JVM): libtorrent opens a created torrent of each format and, checking the files against its hashes, becomes a seed. It would stay a downloader if one piece hash or tree root were wrong.CreateTorrentTestfor the command. Core, torrent, remote, server, app and CLI suites pass on this branch; the creator compiles for iOS.Not built here: a screen for it in the apps. Seeding a created torrent comes with the next PR in the stack (using files already in place).