Skip to content

Commit ca4962a

Browse files
committed
Last downloaded chapter (--cache)
1 parent a32e78a commit ca4962a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

manga.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -344,17 +344,18 @@ def online_search():
344344

345345
if args.cache:
346346
all_chapters = [int(chapter[0]) for chapter in folders(directory)]
347-
if args.chapters == 'last':
348-
print_colored(f'Last downloaded chapter: {max(all_chapters)}', Fore.YELLOW, Style.BRIGHT);
349347
else:
350348
chapters_json = get(CHAPTERS_WEBSITE + uuid)
351349
exit_if_fails(chapters_json)
352350
chapters_full = load_json(chapters_json.content, 'data', 'result')
353351
all_chapters = [int(chapter['Number']) for chapter in chapters_full]
354352

353+
last = max(all_chapters)
354+
if args.cache:
355+
print_colored(f'Last downloaded chapter: {last}', Fore.YELLOW, Style.BRIGHT);
356+
355357
if args.chapters:
356358
args.chapters = args.chapters.replace(' ', '')
357-
last = max(all_chapters)
358359
parse_chapters_range(args.chapters, last)
359360
else:
360361
CHAPTERS.update(all_chapters)

0 commit comments

Comments
 (0)