fixed eslint errors, removed cli and bin defaults

This commit is contained in:
Jake K 2021-07-06 11:24:02 -04:00 committed by GitHub
parent 370cff37e3
commit a69f83fea1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

28
funi.js
View file

@ -37,31 +37,23 @@ let cfg = {
cli: getYamlCfg(cliCfgFile),
};
// make sure cfg params aren't empty
// If they are, update them with some defaults
// make sure cfg params aren't null
if (cfg.bin === null){
cfg.bin = {};
console.log('[WARN] bin-path.yml is empty or does not exist!\n');
cfg.bin = {};
console.log('[WARN] bin-path.yml is empty or does not exist!\n');
}
if (!cfg.bin.hasOwnProperty('ffmpeg')) cfg.bin.ffmpeg = './bin/ffmpeg';
if (!cfg.bin.hasOwnProperty('mkvmerge')) cfg.bin.mkvmerge = './bin/mkvmerge';
if (cfg.dir === null){
cfg.dir = {};
console.log('[WARN] dir-path.yml is empty or does not exist!\n');
cfg.dir = {};
console.log('[WARN] dir-path.yml is empty or does not exist!\n');
}
if (!cfg.dir.hasOwnProperty('content')) cfg.dir.content = './videos/';
if (!Object.prototype.hasOwnProperty.call(cfg.dir, 'content')) cfg.dir.content = './videos/';
if (cfg.cli === null){
cfg.cli = {};
console.log('[WARN] cli-defaults.yml is empty or does not exist!\n');
cfg.cli = {};
console.log('[WARN] cli-defaults.yml is empty or does not exist!\n');
}
if (!cfg.cli.hasOwnProperty('releaseGroup')) cfg.cli.releaseGroup = "Funimation";
if (!cfg.cli.hasOwnProperty('videoLayer')) cfg.cli.videoLayer = 7;
if (!cfg.cli.hasOwnProperty('nServer')) cfg.cli.nServer = 1;
if (!cfg.cli.hasOwnProperty('mp4mux')) cfg.cli.mp4mux = false;
if (!cfg.cli.hasOwnProperty('muxSubs')) cfg.cli.muxSubs = false;
if (!cfg.cli.hasOwnProperty('noCleanUp')) cfg.cli.noCleanUp = false;
/* Normalise paths for use outside the current directory */
for (let key of Object.keys(cfg.dir)) {
@ -950,4 +942,4 @@ function parseFileName(input, title, episode, showTitle, season, width, height)
}
}
return shlp.cleanupFilename(input);
}
}