diff --git a/lib/torrent.js b/lib/torrent.js index 6b58f776..64d38ffe 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 }