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:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/cmd.js34
1 files changed, 14 insertions, 20 deletions
diff --git a/bin/cmd.js b/bin/cmd.js
index 5cc5b96..2ca529d 100755
--- a/bin/cmd.js
+++ b/bin/cmd.js
@@ -12,7 +12,6 @@ var networkAddress = require('network-address')
var parseTorrent = require('parse-torrent')
var path = require('path')
var prettyBytes = require('pretty-bytes')
-var Storage = require('../lib/storage')
var WebTorrent = require('../')
var zeroFill = require('zero-fill')
@@ -511,7 +510,7 @@ function drawTorrent (torrent) {
linesRemaining -= 1
}
- var seeding = torrent.storage.done
+ var seeding = torrent.done
if (!seeding) clivas.line('')
clivas.line(
@@ -540,34 +539,29 @@ function drawTorrent (torrent) {
linesRemaining -= 5
if (argv.verbose) {
- var pieces = torrent.storage.pieces
- var memoryUsage = 0
+ var pieces = torrent.pieces
for (var i = 0; i < pieces.length; i++) {
var piece = pieces[i]
- if (piece.buffer) memoryUsage += piece.buffer.length
if (piece.verified || (piece.blocksWritten === 0 && !piece.blocks[0])) continue
var bar = ''
for (var j = 0; j < piece.blocks.length; j++) {
- switch (piece.blocks[j]) {
- case Storage.BLOCK_BLANK:
- bar += '{red:█}'
- break
- case Storage.BLOCK_RESERVED:
- bar += '{blue:█}'
- break
- case Storage.BLOCK_WRITTEN:
- bar += '{green:█}'
- break
- }
+ // switch (piece.blocks[j]) {
+ // case Storage.BLOCK_BLANK:
+ // bar += '{red:█}'
+ // break
+ // case Storage.BLOCK_RESERVED:
+ // bar += '{blue:█}'
+ // break
+ // case Storage.BLOCK_WRITTEN:
+ // bar += '{green:█}'
+ // break
+ // }
}
clivas.line('{4+cyan:' + i + '} ' + bar)
linesRemaining -= 1
}
- clivas.line(
- '{red:memory usage:} {bold:' + prettyBytes(memoryUsage) + '}'
- )
clivas.line('{80:}')
- linesRemaining -= 2
+ linesRemaining -= 1
}
torrent.swarm.wires.every(function (wire) {