From 18435f58f82849dcc86ab2042491828b2873b39a Mon Sep 17 00:00:00 2001 From: Florrie Date: Fri, 5 Jan 2018 23:20:58 -0400 Subject: WIP(?) metadata processing tool --- src/download-playlist.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/download-playlist.js') diff --git a/src/download-playlist.js b/src/download-playlist.js index b41c240..852cb64 100755 --- a/src/download-playlist.js +++ b/src/download-playlist.js @@ -12,6 +12,7 @@ const { } = require('./playlist-utils') const { getDownloaderFor, makePowerfulDownloader } = require('./downloaders') +const { showTrackProcessStatus } = require('./general-util') const { promisify } = require('util') const { spawn } = require('child_process') @@ -24,12 +25,8 @@ async function downloadCrawl(playlist, topOut = './out/') { const flat = flattenGrouplike(playlist) let doneCount = 0 - const showStatus = function() { - const total = flat.items.length - const percent = Math.trunc(doneCount / total * 10000) / 100 - console.log( - `\x1b[1mDownload crawler - ${percent}% completed ` + - `(${doneCount}/${total} tracks)\x1b[0m`) + const showStatus = () => { + showTrackProcessStatus(flat.items.length, doneCount) } // First off, we go through all tracks and see which are already downloaded. -- cgit 1.3.0-6-gf8a5