Skip to content

Commit

Permalink
Crunchy season fix
Browse files Browse the repository at this point in the history
 - The number of the season will now be correctly inserted
 - The default filename templated has been altered to include the season
  • Loading branch information
izu-co committed Nov 25, 2021
1 parent 3ae1269 commit d1972e3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion @types/crunchyTypes.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export type CrunchyEpMeta = {
seasonTitle: string,
episodeNumber: string,
episodeTitle: string,
seasonID: string
seasonID: string,
season: number
}

export type DownloadedMedia = {
Expand Down
8 changes: 5 additions & 3 deletions crunchy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion modules/module.app-args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit d1972e3

Please sign in to comment.