diff options
author | Astro <astro@spaceboyz.net> | 2014-11-22 04:37:54 +0300 |
---|---|---|
committer | Astro <astro@spaceboyz.net> | 2014-11-22 04:38:25 +0300 |
commit | 3a3d661499e79490b906cfe44ad0bee7c3d07afd (patch) | |
tree | 9054c466b6bb7713b20ed016976ea5f1b1025901 /bin/cmd.js | |
parent | 2ed71bcc14d9396971a69b2640c5017307744930 (diff) |
display pieces that are in progress
Diffstat (limited to 'bin/cmd.js')
-rwxr-xr-x | bin/cmd.js | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -366,6 +366,23 @@ function onReady () { clivas.line('{80:}') linesremaining -= 8 + var pieces = torrent.storage.pieces + var piecesBar = [] + for(var i = 0; i < pieces.length; i++) { + var piece = pieces[i] + if (piece.verified || piece.blocksWritten === 0) { + continue; + } + var bar = '' + for(var j = 0; j < piece.blocks.length; j++) { + bar += piece.blocks[j] ? '{green:█}' : '{red:█}'; + } + clivas.line('{4+cyan:' + i + '} ' + bar); + linesremaining -= 1 + } + clivas.line('{80:}') + linesremaining -= 1 + wires.every(function (wire) { var tags = [] if (wire.peerChoking) tags.push('choked') |