Fix crunchy archive

Should actually fix #501 this time
This commit is contained in:
AnimeDL 2023-07-15 17:56:31 -07:00
parent b64a568352
commit ac77e4b3e0

View file

@ -105,7 +105,7 @@ export default class Crunchy implements ServiceClass {
const selected = await this.downloadFromSeriesID(argv.series, { ...argv }); const selected = await this.downloadFromSeriesID(argv.series, { ...argv });
if (selected.isOk) { if (selected.isOk) {
for (const select of selected.value) { for (const select of selected.value) {
if (!(await this.downloadEpisode(select, {...argv, skipsubs: false }))) { if (!(await this.downloadEpisode(select, {...argv, skipsubs: false }, true))) {
console.error(`Unable to download selected episode ${select.episodeNumber}`); console.error(`Unable to download selected episode ${select.episodeNumber}`);
return false; return false;
} }
@ -858,7 +858,7 @@ export default class Crunchy implements ServiceClass {
return { isOk: true, value: selectedMedia }; return { isOk: true, value: selectedMedia };
} }
public async downloadEpisode(data: CrunchyEpMeta, options: CrunchyDownloadOptions): Promise<boolean> { public async downloadEpisode(data: CrunchyEpMeta, options: CrunchyDownloadOptions, isSeries?: boolean): Promise<boolean> {
const res = await this.downloadMediaList(data, options); const res = await this.downloadMediaList(data, options);
if (res === undefined || res.error) { if (res === undefined || res.error) {
return false; return false;
@ -868,10 +868,17 @@ export default class Crunchy implements ServiceClass {
} else { } else {
console.info('Skipping mux'); console.info('Skipping mux');
} }
downloaded({ if (!isSeries) {
service: 'crunchy', downloaded({
type: 's' service: 'crunchy',
}, data.showID, [data.episodeNumber || data.e]); type: 's'
}, data.seasonID, [data.e]);
} else {
downloaded({
service: 'crunchy',
type: 'srz'
}, data.showID, [data.e]);
}
} }
return true; return true;
} }