Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provide the torrent instance in the opts.store() options #692

Merged
merged 1 commit into from Mar 25, 2016
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -63,6 +63,13 @@ If you want access to the torrent object immediately in order to listen to event
metadata is fetched from the network, then use the return value of `client.add`. If you
just want the file data, then use `ontorrent` or the 'torrent' event.

If you provide `opts.store`, it will be called as
`opts.store(chunkLength, storeOpts)` with:

* `storeOpts.length` - size of all the files in the torrent
* `storeOpts.files` - an array of torrent file objects
* `storeOpts.torrent` - the torrent instance being stored

## `client.seed(input, [opts], [function onseed (torrent) {}])`

Start seeding a new torrent.
@@ -344,6 +344,7 @@ Torrent.prototype._onMetadata = function (metadata) {

self.store = new ImmediateChunkStore(
new self._store(self.pieceLength, {
torrent: self,
files: self.files.map(function (file) {
return {
path: path.join(self.path, file.path),
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.