From 197385586dbd58269902e428e068a33e5f7a991f Mon Sep 17 00:00:00 2001 From: Chia-liang Kao Date: Sat, 16 May 2015 22:04:38 +0800 Subject: [PATCH] Sort peers displayed by downloadSpeed --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index 91a45ed..2ff76a8 100755 --- a/app.js +++ b/app.js @@ -364,7 +364,7 @@ var ontorrent = function (torrent) { clivas.line('') linesremaining -= 9 - wires.every(function (wire) { + wires.sort(function(a,b) { return b.downloadSpeed() - a.downloadSpeed() }).every(function (wire) { var tags = [] if (wire.peerChoking) tags.push('choked') clivas.line('{25+magenta:' + wire.peerAddress + '} {10:' + bytes(wire.downloaded) + '} {10 + cyan:' + bytes(wire.downloadSpeed()) + '/s} {15 + grey:' + tags.join(', ') + '} ')