From 211a593796f4befe9cfa33c2ffa21054c9070536 Mon Sep 17 00:00:00 2001 From: AnimeDL Date: Sat, 16 Mar 2024 17:58:48 -0700 Subject: [PATCH] [HD] Move -s to --srz, and add warnings Add warnings for commands that haven't yet been added to hidive, and move -s to --srz since it selects a series, and not a season. --- hidive.ts | 34 +++++++++++++++++++++------------- modules/module.app-args.ts | 3 ++- modules/module.args.ts | 3 +-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/hidive.ts b/hidive.ts index 933f30c..f994193 100644 --- a/hidive.ts +++ b/hidive.ts @@ -134,24 +134,32 @@ export default class Hidive implements ServiceClass { } } } else { - const selected = await this.selectSeries(parseInt(argv.s), argv.e, argv.but, argv.all); - if (selected.isOk && selected.showData) { - for (const select of selected.value) { - //download episode - if (!(await this.downloadEpisode(select, {...argv}))) { - console.error(`Unable to download selected episode ${select.episodeInformation.episodeNumber}`); - return false; - } + console.error('-s is not yet implemented in the new API, use --srz instead'); + } + return true; + } else if (argv.srz && !isNaN(parseInt(argv.srz,10)) && parseInt(argv.srz,10) > 0) { + const selected = await this.selectSeries(parseInt(argv.srz), argv.e, argv.but, argv.all); + if (selected.isOk && selected.showData) { + for (const select of selected.value) { + //download episode + if (!(await this.downloadEpisode(select, {...argv}))) { + console.error(`Unable to download selected episode ${select.episodeInformation.episodeNumber}`); + return false; } } } - return true; } else if (argv.new) { + if (this.api == 'old') { //Initilize session - await this.doInit(); - //Get Newly Added - await this.getNewlyAdded(argv.page); - } else { + await this.doInit(); + //Get Newly Added + await this.getNewlyAdded(argv.page); + } else { + console.error('--new is not yet implemented in the new API'); + } + } else if(argv.e) { + console.error('-e is not yet supported'); + }else { console.info('No option selected or invalid value entered. Try --help.'); } } diff --git a/modules/module.app-args.ts b/modules/module.app-args.ts index 7ff8c6d..7e7629e 100644 --- a/modules/module.app-args.ts +++ b/modules/module.app-args.ts @@ -31,7 +31,8 @@ let argvC: { new: boolean | undefined; 'movie-listing': string | undefined; series: string | undefined; - s: string | undefined; + s: string | undefined; + srz: string | undefined; e: string | undefined; extid: string | undefined; q: number; diff --git a/modules/module.args.ts b/modules/module.args.ts index b287fa7..3540483 100644 --- a/modules/module.args.ts +++ b/modules/module.args.ts @@ -138,8 +138,7 @@ const args: TAppArg[] = [ group: 'dl', alias: 'srz', describe: 'Get season list by series ID', - docDescribe: 'This command is used only for crunchyroll.' - + '\n Requested is the ID of a show not a season.', + docDescribe: 'Requested is the ID of a show not a season.', service: ['crunchy'], type: 'string', usage: '${ID}'