We want to save the video format/quality infos in the config file.

This commit is contained in:
Godzil 2020-04-27 22:37:23 +01:00
parent b3a96cd0e7
commit e058b8e699
3 changed files with 24 additions and 15 deletions

View File

@ -38,19 +38,14 @@ export default function(args: string[], done: (err?: Error) => void)
config.nametmpl = '{SERIES_TITLE} - s{SEASON_NUMBER}e{EPISODE_NUMBER} - {EPISODE_TITLE} - [{TAG}]'; config.nametmpl = '{SERIES_TITLE} - s{SEASON_NUMBER}e{EPISODE_NUMBER} - {EPISODE_TITLE} - [{TAG}]';
} }
// Update the config file with new parameters if (config.tag === undefined)
cfg.save(config);
if (config.unlog)
{ {
config.crDeviceId = undefined; config.tag = 'CrunchyRoll';
config.user = undefined; }
config.pass = undefined;
my_request.eatCookies(config);
cfg.save(config);
log.info('Unlogged!');
process.exit(0); if (config.sublang === undefined)
{
config.sublang = [ 'enUS' ];
} }
// set resolution // set resolution
@ -75,6 +70,21 @@ export default function(args: string[], done: (err?: Error) => void)
config.video_quality = resol_table['1080'].quality; config.video_quality = resol_table['1080'].quality;
} }
// Update the config file with new parameters
cfg.save(config);
if (config.unlog)
{
config.crDeviceId = undefined;
config.user = undefined;
config.pass = undefined;
my_request.eatCookies(config);
cfg.save(config);
log.info('Unlogged!');
process.exit(0);
}
if (config.debug) if (config.debug)
{ {
/* Ugly but meh */ /* Ugly but meh */
@ -388,8 +398,8 @@ function parse(args: string[]): IConfigLine
.option('-s, --series <s>', 'The series name override.') .option('-s, --series <s>', 'The series name override.')
.option('--ignoredub', 'Experimental: Ignore all seasons where the title end with \'Dub)\'') .option('--ignoredub', 'Experimental: Ignore all seasons where the title end with \'Dub)\'')
.option('-n, --nametmpl <s>', 'Output name template') .option('-n, --nametmpl <s>', 'Output name template')
.option('-t, --tag <s>', 'The subgroup.', 'CrunchyRoll') .option('-t, --tag <s>', 'The subgroup.')
.option('-r, --resolution <s>', 'The video resolution. (valid: 360, 480, 720, 1080)', '1080') .option('-r, --resolution <s>', 'The video resolution. (valid: 360, 480, 720, 1080)')
.option('-b, --batch <s>', 'Batch file', 'CrunchyRoll.txt') .option('-b, --batch <s>', 'Batch file', 'CrunchyRoll.txt')
.option('--verbose', 'Make tool verbose') .option('--verbose', 'Make tool verbose')
.option('--debug', 'Create a debug file. Use only if requested!') .option('--debug', 'Create a debug file. Use only if requested!')

View File

@ -71,8 +71,6 @@ export function save(config: IConfig)
tmp.cache = undefined; tmp.cache = undefined;
tmp.episodes = undefined; tmp.episodes = undefined;
tmp.series = undefined; tmp.series = undefined;
tmp.video_format = undefined;
tmp.video_quality = undefined;
tmp.rebuildcrp = undefined; tmp.rebuildcrp = undefined;
tmp.batch = undefined; tmp.batch = undefined;
tmp.verbose = undefined; tmp.verbose = undefined;

View File

@ -8,6 +8,7 @@ interface IConfig {
episodes?: string; episodes?: string;
// Settings // Settings
crlang?: string; crlang?: string;
sublang?: any;
format?: string; format?: string;
output?: string; output?: string;
series?: string; series?: string;