From 53aa04af1e57b38a75e6e635286b7b48d279d119 Mon Sep 17 00:00:00 2001 From: myc1ou1d <92770704+myc1ou1d@users.noreply.github.com> Date: Sat, 24 Feb 2024 23:27:52 +0800 Subject: [PATCH] fix file not found error when cbz file exists. --- nhentai/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nhentai/utils.py b/nhentai/utils.py index 0151b40..af22c81 100644 --- a/nhentai/utils.py +++ b/nhentai/utils.py @@ -166,6 +166,9 @@ def generate_main_html(output_dir='./'): def generate_cbz(output_dir='.', doujinshi_obj=None, rm_origin_dir=False, write_comic_info=True): if doujinshi_obj is not None: doujinshi_dir = os.path.join(output_dir, doujinshi_obj.filename) + if os.path.exists(doujinshi_dir+".cbz"): + logger.warning(f'Comic Book CBZ file exists, skip "{doujinshi_dir}"') + return if write_comic_info: serialize_comic_xml(doujinshi_obj, doujinshi_dir) cbz_filename = os.path.join(os.path.join(doujinshi_dir, '..'), f'{doujinshi_obj.filename}.cbz')