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:
-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')