Crunchy season fix

- The number of the season will now be correctly inserted
 - The default filename templated has been altered to include the season
This commit is contained in:
Izuco 2021-11-25 11:58:08 +01:00
parent 3ae1269ac7
commit d1972e3725
No known key found for this signature in database
GPG key ID: 41DFCB1835A5695E
5 changed files with 10 additions and 7 deletions

View file

@ -10,7 +10,8 @@ export type CrunchyEpMeta = {
seasonTitle: string,
episodeNumber: string,
episodeTitle: string,
seasonID: string
seasonID: string,
season: number
}
export type DownloadedMedia = {

View file

@ -672,7 +672,8 @@ async function getSeasonById(){
seasonTitle: item.season_title,
episodeNumber: item.episode,
episodeTitle: item.title,
seasonID: item.season_id
seasonID: item.season_id,
season: item.season_number
};
if(item.playback){
epMeta.data[0].playback = item.playback;
@ -972,7 +973,8 @@ const itemSelectMultiDub = (eps: Record<string, {
seasonTitle: itemE.items.find(a => !a.season_title.includes('('))?.season_title as string,
episodeNumber: item.episode,
episodeTitle: item.title,
seasonID: item.season_id
seasonID: item.season_id,
season: item.season_number
};
if(item.playback){
epMeta.data[0].playback = item.playback;
@ -1142,7 +1144,7 @@ async function downloadMediaList(medias: CrunchyEpMeta) : Promise<{
['episode', medias.episodeNumber],
['service', 'CR'],
['showTitle', medias.seasonTitle],
['season', medias.seasonID]
['season', medias.season]
] as [yargs.AvailableFilenameVars, string|number][]).map((a): Variable => {
return {
name: a[0],

View file

@ -280,7 +280,7 @@ const getArgv = (cfg: { [key:string]: unknown }) => {
describe: `Set the filename template. Use \${variable_name} to insert variables.\nYou may use ${availableFilenameVars
.map(a => `'${a}'`).join(', ')} as variables.`,
type: 'string',
default: parseDefault<string>('fileName', '[${service}] ${showTitle} - ${episode} [${height}p]')
default: parseDefault<string>('fileName', '[${service}] ${showTitle} - S${season}E${episode} [${height}p]')
})
.option('numbers', {
group: groups.fileName,

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "multi-downloader-nx",
"version": "2.0.3",
"version": "2.0.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,7 +1,7 @@
{
"name": "multi-downloader-nx",
"short_name": "aniDL",
"version": "2.0.3",
"version": "2.0.4",
"description": "Download videos from Funimation or Crunchyroll via cli",
"keywords": [
"download",