Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var i = 0, interval = setInterval(function () {
cli.progress(++i / 100);
if (i === 100) {
clearInterval(interval);
cli.ok('Finished!');
}
}, 50);
Generator.prototype.process = function(files, cb) {
var self = this;
var ejsFiles = files.filter(function(f) { return f.slice(-4) === '.ejs'; });
var otherFiles = files.filter(function(f) { return ejsFiles.indexOf(f) === -1; });
if (files.length > 1) cli.progress(0);
var doneCount = 0;
var processGroup = function(group, done) {
async.eachLimit(group, Object.keys(cluster.workers).length, function(f, dun) {
self.processFile(f, false, function() {
if (files.length > 1) cli.progress(++doneCount / files.length);
dun.apply(this, arguments);
});
}, done);
};
async.series([
processGroup.bind(this, otherFiles),
processGroup.bind(this, ejsFiles)
], cb);
utils.metadata(songPath, trk, () => {
if (cli.options.song && cli.options.downloadonly) process.exit();
if (cli.options.album) cli.progress(++cli.album.size/ cli.album.total);
deferred.resolve(songPath);
});
});
function onData(data, size) {
cli.progress( (size * (100 / totalSize) / 100) );
}
var i = 0, interval = setInterval(function () {
cli.progress(++i / 100);
if (i === 100) {
clearInterval(interval);
cli.ok('Finished!');
}
}, 50);
var i = 0, interval = setInterval(function () {
cli.progress(++i / 100);
if (i === 100) {
clearInterval(interval);
cli.ok('Finished!');
}
}, 50);
var i = 0, interval = setInterval(function () {
cli.progress(++i / 100);
if (i === 100) {
clearInterval(interval);
cli.ok('Finished!');
}
}, 50);
var i = 0, interval = setInterval(function () {
cli.progress(++i / 100);
if (i === 100) {
clearInterval(interval);
cli.ok('Finished!');
}
}, 50);
var i = 0, interval = setInterval(function () {
cli.progress(++i / 100);
if (i === 100) {
clearInterval(interval);
cli.ok('Finished!');
}
}, 50);
api.on('setInfo', function(info) {
cli.info('Downloading ' + info.total + ' photos from "' + info.title + '" by ' + info.ownername);
numPhotos = info.total;
cli.progress(0);
});