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-08-10 18:02:29 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-08-10 18:02:29 +0300
commit20acdef98f7d6838527f60a4c283499f67e1dc8f (patch)
tree8a0730baf920fc3bf0f13ef896811a31fe7f1417 /bin/cmd.js
parentd254f65543bbab7d0840887ba9f8a222acbc201a (diff)
cmd: use torrent.timeRemaining
Diffstat (limited to 'bin/cmd.js')
-rwxr-xr-xbin/cmd.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index a3eaebf..31bde0b 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -487,10 +487,8 @@ function drawTorrent (torrent) {
})
var linesRemaining = clivas.height
var peerslisted = 0
- var speed = torrent.swarm.downloadSpeed()
- var estimatedSecondsRemaining =
- Math.max(0, torrent.length - torrent.swarm.downloaded) / (speed > 0 ? speed : -1)
- var estimate = moment.duration(estimatedSecondsRemaining, 'seconds').humanize()
+ var speed = torrent.downloadSpeed()
+ var estimate = moment.duration(torrent.timeRemaining / 1000, 'seconds').humanize()
clivas.clear()