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 upCustomize files fragments checking, when torrent is added #1553
Comments
This comment has been minimized.
This comment has been minimized.
|
Hi BarushevEA,
There is a option on torrents called `skipVerify` which will mark all
pieces in a torrent as downloaded. Note that depending how the torrent is
added, the metadata will still be needed before the torrent will function
normally so saving the .torrent or `parse-torrent` output and recreating
the torrent using this is ideal instead of relying on other peers for
metadata incase you're the only client.
Kind Regards
Brad
…On Fri, 23 Nov 2018, 13:35 BarushevEA ***@***.*** wrote:
Please help me solve a problem.
*What version of WebTorrent?* - 0.102.4
*What operating system and Node.js version?* - OS Win 10 64, Node.js -
v10.11.0
*What actually happened?*
Situation by step:
1. Add torrent "test" with many files
2. Some files are 100% downloaded, some files are still downloading
3. Stop and close the application
4. Start application
5. Add torrent "test" again
6. Before torrent is ready, webtorrent checks fragments and this
process takes a lot of time
*What did you expect to happen?*
How i can stop files check, if they are 100% downloaded?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1553>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOXi4Q0n6o-qt1kQdFAJuR0qMGZ8XNEoks5ux_mXgaJpZM4Ywqw->
.
|
This comment has been minimized.
This comment has been minimized.
|
Thanks, I will try to use it. |
This comment has been minimized.
This comment has been minimized.
|
This works for the whole torrent. |
This comment has been minimized.
This comment has been minimized.
|
May be need to create new options/function similar to this:
But with options for example:
|
This comment has been minimized.
This comment has been minimized.
|
Hey BarushevEA, As it stands, like you've said, there is currently no way to do it selectively for each file, only per torrent. Creating a |
This comment has been minimized.
This comment has been minimized.
|
Ok. |
This comment has been minimized.
This comment has been minimized.
|
Something possibly like this, which uses parse-numeric-range to select the files to be marked as verified, similar to how I handled select only (BEP53) above. if(this.selectiveVerify){
const selectiveVerifyFiles = parseRange(this.selectiveVerify)
this.files.forEach((v, i)=>{
if(selectiveVerifyFiles.includes(i)){
for(let index = v._startPiece; index <= v._endPiece; index++){
this._markVerified(index)
}
}
})
} |
This comment has been minimized.
This comment has been minimized.
|
Yes, it is very similar to what I need. |
This comment has been minimized.
This comment has been minimized.
|
@BarushevEA It could be implemented and I see no reason as to why it wouldn't be as it's quite useful in combination with select only. I don't have the time at the moment to implement it properly myself, mainly writing the tests for it, but the code above should be functional. Yourself or anybody else is more than welcome to create the PR to add this feature, sorry I'm not able to do it myself at the moment. |
This comment has been minimized.
This comment has been minimized.
|
I understand. |
This comment has been minimized.
This comment has been minimized.
|
I am try to use new functionality, but found error flow. I am write code: constructor add rewvrite _markAllVerified()
add function
add to _onMetadata(metadata)
Use options |
This comment has been minimized.
This comment has been minimized.
|
I guess I found a mistake. Function - _verifyPieces()
Fix:
|
This comment has been minimized.
This comment has been minimized.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Please help me solve a problem.
What version of WebTorrent? - 0.102.4
What operating system and Node.js version? - OS Win 10 64, Node.js - v10.11.0
What actually happened?
Situation by step:
What did you expect to happen?
How i can stop files check, if they are 100% downloaded?