mirror of
https://github.com/anidl/multi-downloader-nx.git
synced 2026-04-21 16:31:55 +00:00
parent
b64a568352
commit
ac77e4b3e0
1 changed files with 13 additions and 6 deletions
19
crunchy.ts
19
crunchy.ts
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue