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

Clone options when seeding / downloading #418

Merged
merged 1 commit into from Oct 2, 2015
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

Clone options when seeding/downloading

  • Loading branch information
gillesdemey committed Sep 2, 2015
commit 2ca0f17ddb7c31be5ff0dd2333d70888b15009b6
@@ -145,6 +145,7 @@ WebTorrent.prototype.download = function (torrentId, opts, ontorrent) {
if (typeof opts === 'function') return self.add(torrentId, null, opts)
debug('add')
if (!opts) opts = {}
else opts = extend({}, opts)

opts.client = self

@@ -192,6 +193,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {
if (typeof opts === 'function') return self.seed(input, null, opts)
debug('seed')
if (!opts) opts = {}
else opts = extend({}, opts)

// When seeding from filesystem, initialize store from that path (avoids a copy)
if (typeof input === 'string') opts.path = path.dirname(input)
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.