diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2015-12-02 23:59:40 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2015-12-02 23:59:40 +0300 |
commit | 5385c9d89c514f7fadbb0e05c75c904f1480318a (patch) | |
tree | 245e5fccb3746090a417cbe52c2d582981cfb9a9 | |
parent | cfca533063b6ffcf6fd231949762314c8bd73d5e (diff) | |
parent | 16e44457fa5a5d8c84e80cbac9a5cbbb59f43c8f (diff) |
Merge pull request #504 from feross/DiegoRBaquero-patch-1
timeRemaining should be 0 once done (Fix #503)
-rw-r--r-- | lib/torrent.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 6b58f77..64d38ff 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -94,6 +94,7 @@ function Torrent (torrentId, opts) { // Time remaining (in milliseconds) Object.defineProperty(Torrent.prototype, 'timeRemaining', { get: function () { + if (this.done) return 0 if (this.swarm.downloadSpeed() === 0) return Infinity else return ((this.length - this.downloaded) / this.swarm.downloadSpeed()) * 1000 } |