diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2014-03-23 11:45:38 +0400 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2014-03-25 10:12:24 +0400 |
commit | 72792a01a79f67c7764407481d3eb3e44ec79036 (patch) | |
tree | 063ccff15c098e261d93269c210792ce322a6e86 /lib/torrent.js | |
parent | 553821c323a255ec5d22dba9de81dbff47c1710c (diff) |
update manifest.json for new chrome.sockets.* api
Diffstat (limited to 'lib/torrent.js')
-rw-r--r-- | lib/torrent.js | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 2e7a0f8..a5f6506 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -52,7 +52,9 @@ function Torrent (uri, opts) { self.metadata = null self.parsedTorrent = null - self.swarm = new Swarm(self.infoHash, self.peerId, { dht: true }) + self.swarm = new Swarm(self.infoHash, self.peerId, { + handshake: { dht: true } + }) self.storage = null if (self.torrentPort) { @@ -68,6 +70,9 @@ function Torrent (uri, opts) { self.swarm.on('wire', self._onWire.bind(self)) } +/** + * Torrent size (in bytes) + */ Object.defineProperty(Torrent.prototype, 'length', { get: function () { var self = this @@ -89,7 +94,7 @@ Object.defineProperty(Torrent.prototype, 'timeRemaining', { }) /** - * Percentage complete, represented as a number between 0 and 1. + * Percentage complete, represented as a number between 0 and 1 */ Object.defineProperty(Torrent.prototype, 'progress', { get: function () { @@ -99,6 +104,9 @@ Object.defineProperty(Torrent.prototype, 'progress', { } }) +/** + * Bytes downloaded (and verified) + */ Object.defineProperty(Torrent.prototype, 'downloaded', { get: function () { var self = this @@ -106,6 +114,9 @@ Object.defineProperty(Torrent.prototype, 'downloaded', { } }) +/** + * Bytes uploaded + */ Object.defineProperty(Torrent.prototype, 'uploaded', { get: function () { var self = this @@ -113,7 +124,9 @@ Object.defineProperty(Torrent.prototype, 'uploaded', { } }) - +/** + * Ratio of bytes downloaded to uploaded + */ Object.defineProperty(Torrent.prototype, 'ratio', { get: function () { var self = this |