diff options
author | Diego RodrÃguez B <DiegoRBaquero@users.noreply.github.com> | 2015-12-02 23:47:35 +0300 |
---|---|---|
committer | Diego RodrÃguez B <DiegoRBaquero@users.noreply.github.com> | 2015-12-02 23:47:35 +0300 |
commit | 16e44457fa5a5d8c84e80cbac9a5cbbb59f43c8f (patch) | |
tree | 245e5fccb3746090a417cbe52c2d582981cfb9a9 /lib | |
parent | cfca533063b6ffcf6fd231949762314c8bd73d5e (diff) |
timeRemaining should be 0 once done (Fix #503)
timeRemaining property should be 0 once a torrent has been downloaded (or is being seeded)
Diffstat (limited to 'lib')
-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 } |