Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosip Janžić <josip.janzic@gmail.com>2015-06-14 01:53:56 +0300
committerJosip Janžić <josip.janzic@gmail.com>2015-06-14 01:53:56 +0300
commit13cfc27d7a864b51237a0482509c4e75a981cea8 (patch)
tree87bc40284bede22d4ab8533ce796cbd7f4ea4105 /index.js
parent7c6e151ad02dc4150df210af4cc3f7e34d71b988 (diff)
use input file/dir path as download path
closes #357
Diffstat (limited to 'index.js')
-rw-r--r--index.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/index.js b/index.js
index 62026f3..c33c9c7 100644
--- a/index.js
+++ b/index.js
@@ -12,6 +12,7 @@ var parallel = require('run-parallel')
var parseTorrent = require('parse-torrent')
var speedometer = require('speedometer')
var zeroFill = require('zero-fill')
+var path = require('path')
var FSStorage = require('./lib/fs-storage') // browser exclude
var Storage = require('./lib/storage')
@@ -208,6 +209,7 @@ WebTorrent.prototype.seed = function (input, opts, onseed) {
if (!opts) opts = {}
opts.noVerify = true
opts.createdBy = 'WebTorrent/' + VERSION
+ opts.path = typeof input === 'string' ? path.dirname(input) : opts.path
var streams
var torrent = self.add(undefined, opts, function (torrent) {