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>2015-05-16 05:34:39 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-05-16 05:34:39 +0300
commitde8b5ea260504cb6f5b45c8dabd68ccf8a0c4d70 (patch)
tree4aeced01bfc7510429fada814125607d6fad16a2
parentf559337a461bb949a0190948ab288f12743ab6ed (diff)
dedupe parsedTorrent.announce
have to do this after adding new tracker to the array
-rw-r--r--lib/torrent.js2
-rw-r--r--package.json1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 8dd33d4..6a72736 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -12,6 +12,7 @@ var parallel = require('run-parallel')
var parseTorrent = require('parse-torrent')
var reemit = require('re-emitter')
var Swarm = require('bittorrent-swarm') // `webtorrent-swarm` in browser
+var uniq = require('uniq')
var ut_metadata = require('ut_metadata')
var ut_pex = require('ut_pex') // browser exclude
@@ -130,6 +131,7 @@ function Torrent (torrentId, opts) {
global.WEBTORRENT_ANNOUNCE.forEach(function (url) {
self.parsedTorrent.announce.push(url)
})
+ uniq(self.parsedTorrent.announce)
}
// create swarm
diff --git a/package.json b/package.json
index 8ad3838..f812011 100644
--- a/package.json
+++ b/package.json
@@ -56,6 +56,7 @@
"speedometer": "^0.1.2",
"thunky": "^0.1.0",
"torrent-discovery": "^3.0.0",
+ "uniq": "^1.0.1",
"ut_metadata": "^2.1.0",
"ut_pex": "^1.0.1",
"windows-no-runnable": "0.0.6",