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 uptorrent with multifile #977
Comments
This comment has been minimized.
This comment has been minimized.
|
I personnaly do this:
note: there might be a better way to find the file extension, I'm using node so I do I can then easily select files, because I only display those who have
|
This comment has been minimized.
This comment has been minimized.
|
@f1atlux You should do something like what @vankasteelj suggests. All the information is the |
This comment has been minimized.
This comment has been minimized.
|
it does have the inconvenient of being heavy to process on v8 with a 100+ file torrent on a slow CPU like an Atom Z |
This comment has been minimized.
This comment has been minimized.
|
@vankasteelj Looping through an array one time is not a heavyweight operation. Anyway, what you're suggesting would have to be done internally in webtorrent either way, so it makes no performance difference: var files = torrent.files.filter(function (file) {
var ext = path.extname(file)
return ext === '.mp4'
})
console.log(files) // now this array only contains mp4 files |
This comment has been minimized.
This comment has been minimized.
|
it's not the looping array that is heavy, it's the 99 occurrences of |
This comment has been minimized.
This comment has been minimized.
|
torrent.deselect() could be a useful api (if you're not internally looping and deselecting each file^^) |
This comment has been minimized.
This comment has been minimized.
|
Yeah, there is already an open issue about improving the way we do selections. For now, we only have file.deselect(). You can follow that issue here: #164 |
This comment has been minimized.
This comment has been minimized.
|
This thread has been automatically locked because it has not had recent activity. To discuss futher, please open a new issue. |
webtorrent.js latest
firefox latest
hi there, i've a torrent file which has multiple files. myname.txt, blabla.jpg and stream.mp4
webtorrent.js is not start streaming on that situation. is there any idea to modify it like "detect that file type" thing?
best.