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:
authorgrunjol <grunjol@argenteam.net>2015-02-16 01:09:52 +0300
committergrunjol <grunjol@argenteam.net>2015-02-16 01:09:52 +0300
commit5ab42fd4fd2d41589a851f81911a00c6b0c46d9f (patch)
tree39d2d3eb48cc28ec84bec9bd561e0b142c7c2f5a /bin
parente0af2a8c79f7cffa33ac0edc46fdbced84d8df22 (diff)
show reserved blocks in cmd
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 44cd60c..ac650ad 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -452,12 +452,12 @@ function drawTorrent (torrent) {
var pieces = torrent.storage.pieces
for (var i = 0; i < pieces.length; i++) {
var piece = pieces[i]
- if (piece.verified || piece.blocksWritten === 0) {
+ if (piece.verified || (piece.blocksWritten === 0 && !piece.blocks[0])) {
continue
}
var bar = ''
for (var j = 0; j < piece.blocks.length; j++) {
- bar += piece.blocks[j] ? '{green:█}' : '{red:█}'
+ bar += piece.blocks[j] ? (piece.blocks[j] === 1 ? '{blue:█}' : '{green:█}') : '{red:█}'
}
clivas.line('{4+cyan:' + i + '} ' + bar)
linesremaining -= 1