diff --git a/download.ts b/download.ts index 8b1d7f4..59c63c3 100644 --- a/download.ts +++ b/download.ts @@ -93,7 +93,8 @@ export async function download( chapters: Chapter[], start: Chapter, end: Chapter, - current: Chapter | null = null + current: Chapter | null = null, + archive = true ) { const BASE_FOLDER_PATH = join(folder_path, mangaIndexName); Deno.mkdirSync(BASE_FOLDER_PATH, { recursive: true }); @@ -128,7 +129,7 @@ export async function download( Deno.stdout.write(new TextEncoder().encode(`${Color.white(" Done |")} ${Color.yellow("Writing Metadata")}`)); if (!writeComicInfo(CHAPTER_PATH, metadata, current, pages)) return false; Deno.stdout.write(new TextEncoder().encode(`${Color.white(" Done |")} ${Color.magenta("Archiving")}`)); - if (!(await archive(CHAPTER_PATH, `${CHAPTER_PATH}.cb7`))) return false; + if (archive && !(await archive(CHAPTER_PATH, `${CHAPTER_PATH}.cb7`))) return false; Deno.stdout.write(new TextEncoder().encode(`${Color.white(" Done |\n")}`)); if (chapter.raw == end.raw) break; diff --git a/main.ts b/main.ts index d0ef5f9..5c0b8e3 100644 --- a/main.ts +++ b/main.ts @@ -116,7 +116,8 @@ switch (ARGS._[0] || undefined) { console.log(Color.gray("\n----------------------------------------")); - await download(ARGS._[1] as string, metadata.basic, Deno.cwd(), metadata.chapters, start, end, current); + const archive = ARGS.c || ARGS['compress'] || false; + await download(ARGS._[1] as string, metadata.basic, Deno.cwd(), metadata.chapters, start, end, current, archive); console.log(Color.green("# Finished Download #"));