Skip to content

Commit

Permalink
Merge pull request #2 from MrMysterius/13-no-archive-flag
Browse files Browse the repository at this point in the history
13 no archive flag
  • Loading branch information
MrMysterius authored Aug 28, 2024
2 parents 214595a + 4c34884 commit f400f97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export async function download(
chapters: Chapter[],
start: Chapter,
end: Chapter,
current: Chapter | null = null
current: Chapter | null = null,
doArchive = true
) {
const BASE_FOLDER_PATH = join(folder_path, mangaIndexName);
Deno.mkdirSync(BASE_FOLDER_PATH, { recursive: true });
Expand Down Expand Up @@ -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 (doArchive && !(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;
Expand Down
3 changes: 2 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 #"));

Expand Down

0 comments on commit f400f97

Please sign in to comment.