Skip to content

Commit

Permalink
Sort the wires by speed so output looks less boring
Browse files Browse the repository at this point in the history
  • Loading branch information
clkao committed Jul 14, 2016
1 parent 4b293b4 commit 2eebc53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,9 @@ 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(', ') + '} ')
Expand Down

0 comments on commit 2eebc53

Please sign in to comment.