diff --git a/lib/share.js b/lib/share.js index f9a8c46..47334a5 100644 --- a/lib/share.js +++ b/lib/share.js @@ -117,6 +117,9 @@ module.exports = function sync (type, opts, dat) { }) if (debug.enabled && importStatus) { + importStatus.on('file imported', function (file) { + debug(`Imported ${file.path}`) + }) setInterval(function () { if (!importDone) debug(`Imported ${prettyBytes(importStatus.bytesImported)} of ${prettyBytes(importStatus.countStats.bytes)}`) }, opts.logspeed) diff --git a/lib/ui/import-progress.js b/lib/ui/import-progress.js index 88516f7..69aa7fc 100644 --- a/lib/ui/import-progress.js +++ b/lib/ui/import-progress.js @@ -7,8 +7,9 @@ module.exports = function () { return function (importer) { if (!importer || !importer.bytesImported) return '' var importedBytes = importer.bytesImported + var importedFiles = importer.fileCount - 1 // counted before import finishes so -1 TODO: fix? var speed = importer.bytesImported * 1000 / (Date.now() - start) var progress = Math.round(importedBytes * 100 / importer.countStats.bytes) - return bar(progress) + ` ${importer.fileCount} of ${importer.countStats.files} ${importer.countStats.files === 1 ? 'file' : 'files'}` + ' (' + prettyBytes(speed) + '/s' + ')' + return bar(progress) + ` ${importedFiles} of ${importer.countStats.files } ${importer.countStats.files === 1 ? 'file' : 'files'}` + ' (' + prettyBytes(speed) + '/s' + ')' } }