added custom filenames
This commit is contained in:
parent
361c6cf54c
commit
4dc90aeb00
@ -149,6 +149,7 @@ function parse(args: string[]): IConfigLine
|
||||
.option('-f, --format <s>', 'The subtitle format. (Default: ass)')
|
||||
.option('-o, --output <s>', 'The output path.')
|
||||
.option('-s, --series <s>', 'The series override.')
|
||||
.option('-n, --filename <s>', 'The name override.')
|
||||
.option('-t, --tag <s>', 'The subgroup. (Default: CrunchyRoll)')
|
||||
.parse(args);
|
||||
}
|
||||
|
||||
@ -196,7 +196,17 @@ function name(config: IConfig, page: IEpisodePage, series: string, extra: string
|
||||
const volume = (volumeNum < 10 ? '0' : '') + page.volume;
|
||||
const tag = config.tag || 'CrunchyRoll';
|
||||
|
||||
return series + ' - s' + volume + 'e' + episode + ' - [' + tag + ']' + extra;
|
||||
if (!config.filename) {
|
||||
return page.series + ' - s' + volume + 'e' + episode + ' - [' + tag + ']' + extra;
|
||||
}
|
||||
|
||||
return config.filename
|
||||
.replace(/{EPISODE_ID}/g, page.id.toString())
|
||||
.replace(/{EPISODE_NUMBER}/g, episode)
|
||||
.replace(/{SEASON_NUMBER}/g, volume)
|
||||
.replace(/{VOLUME_NUMBER}/g, volume)
|
||||
.replace(/{SERIES_TITLE}/g, series)
|
||||
.replace(/{TAG}/g, tag) + extra;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
1
src/interface/IConfig.d.ts
vendored
1
src/interface/IConfig.d.ts
vendored
@ -12,5 +12,6 @@ interface IConfig {
|
||||
format?: string;
|
||||
output?: string;
|
||||
series?: string;
|
||||
filename?: string;
|
||||
tag?: string;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user