fixed requirements

This commit is contained in:
Daniel Sommer 2017-03-24 22:11:22 +01:00
parent 02d21aa23a
commit 2673a6e2fa
3 changed files with 7 additions and 6 deletions

View file

@ -3,12 +3,9 @@
// requirements
const os = require('os');
const path = require('path');
const fs = require('fs');
const fse = require('fs-extra');
const async = require('async');
const commander = require('commander');
const recursive = require('recursive-readdir');
const app = require('./package.json');
const audio = require('./lib/audio');
const util = require('./lib/util');
@ -60,7 +57,7 @@ function sort(input, output, options) {
const bar = util.createProgressBar(files.length);
// handle each file
async.eachLimit(files, concurrency, function (file, eachCallback) {
processFile(output, file, function (err) {
processFileSort(output, file, function (err) {
bar.tick();
if (err) {
return eachCallback(err);
@ -84,7 +81,7 @@ function sort(input, output, options) {
}
// move file to location defined by its metadata
function processFile(output, sourceFile, callback) {
function processFileSort(output, sourceFile, callback) {
async.waterfall([
function (asyncCallback) {
audio.extractMetadata(sourceFile, asyncCallback)

View file

@ -1,4 +1,5 @@
// requirements
const fs = require('fs');
const metadata = require('musicmetadata');
// extract metadata for further processing

View file

@ -1,4 +1,7 @@
// requirements
const path = require('path');
const async = require('async');
const fse = require('fs-extra');
const progress = require('progress');
// print logo
@ -70,7 +73,7 @@ exports.moveFile = function moveFile(source, target, callback) {
}
callback();
});
}
};
// fill a string beginning from the front
exports.frontfill = function frontFill(string, fill, length) {