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:
authorFeross Aboukhadijeh <feross@feross.org>2014-11-29 10:58:31 +0300
committerFeross Aboukhadijeh <feross@feross.org>2014-11-29 10:58:31 +0300
commit6abf6bc9a50d6c5b0d34b95a83df3a8dbc4bcc4c (patch)
tree8298eae3658615a6556e8aac401483325c04a055 /lib/torrent.js
parentac43874204fde89f2c8a3f50e634838b24ac271b (diff)
allow Torrent to be initialized from another Torrent instance
Diffstat (limited to 'lib/torrent.js')
-rw-r--r--lib/torrent.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 7834a80..3181c63 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -73,7 +73,7 @@ function Torrent (torrentId, opts) {
self._critical = []
self._storageImpl = opts.storage || Storage
- var parsedTorrent = parseTorrent(torrentId)
+ var parsedTorrent = (torrentId && torrentId.parsedTorrent) || parseTorrent(torrentId)
if (parsedTorrent && parsedTorrent.infoHash) {
onTorrentId(parsedTorrent)