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
path: root/bin
diff options
context:
space:
mode:
authorAstro <astro@spaceboyz.net>2014-11-22 04:37:54 +0300
committerAstro <astro@spaceboyz.net>2014-11-22 04:38:25 +0300
commit3a3d661499e79490b906cfe44ad0bee7c3d07afd (patch)
tree9054c466b6bb7713b20ed016976ea5f1b1025901 /bin
parent2ed71bcc14d9396971a69b2640c5017307744930 (diff)
display pieces that are in progress
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 8c8d1bc..b7bb649 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -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')