Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd torrent.rescanFiles() to allow manual verify #1650
Conversation
|
Generally looks good. See inline comments. Also, can you add documentation? |
|
LGTM, except for the documentation not being right. Lmk if you agree |
| @@ -366,6 +366,13 @@ connections, nor does it pause the streams of existing connections or their wire | |||
|
|
|||
| Resume connecting to new peers. | |||
|
|
|||
| ## `torrent.verifyPieces([function callback (err) {}])` | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| ## `torrent.verifyPieces([function callback (err) {}])` | ||
|
|
||
| Verify the hashes of all pieces in the store. Useful if the store has been modified | ||
| outside WebTorrent. If a piece hash is incorrect, the torrent will be destroyed, and |
This comment has been minimized.
This comment has been minimized.
feross
Jul 9, 2019
Member
If a piece hash is incorrect, nothing happens. The underlying _verifyPieces method just marks the valid pieces as verified and ignores the invalid pieces. So I think this should say that the callback is called when verification is complete, and an error is returned if the torrent is destroyed during verification for any reason. But, null will be returned if verification completes successfully, whether or not all the pieces hash correctly or not.
This comment has been minimized.
This comment has been minimized.
jhiesey
Jul 9, 2019
Author
Contributor
Yes, you're right. I made this change a while ago and didn't look at it closely enough again.
Useful if files are modified externally to webtorrent.
|
LGTM! Thanks for making all the changes! |
This comment has been minimized.
This comment has been minimized.
|
Released as 0.105.0. |
jhiesey commentedJun 24, 2019
Useful if files are modified externally to webtorrent. Needed for Internet Archive use case.