From 3c8d44f90917a6c7e4ffa40abbc21543d16890c3 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Tue, 14 Feb 2023 04:31:40 +0800 Subject: [PATCH] fix --- utils/CBZUtils.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/utils/CBZUtils.py b/utils/CBZUtils.py index 7d4c333..fc2f95b 100644 --- a/utils/CBZUtils.py +++ b/utils/CBZUtils.py @@ -16,21 +16,6 @@ class CBZUtils: @classmethod def getCBZ_Path(cls): return cls.getCBZ_Dir()+".CBZ" - @classmethod - def PackCBZAndequZipLength(cls): - try: - size_zip = len(cls.zip_compression(comicInfo.getDirComicChapter(), cls.getCBZ_Path())) - size_imgs = len(comicInfo.getChapterImgs()) - if size_zip == size_imgs: - ntfy.sendMsg(f"打包校验成功: {cls.getCBZ_Path()}") - comicInfo.nextCBZToDoneChapter() - return True - else: - ntfy.sendMsg(f"打包检验不完整:{cls.getCBZ_Path()}") - return False - except: - print("CBZ打包ERROR") - @classmethod def readDirsOrFiles(cls,dir,type): data = [] @@ -88,7 +73,8 @@ class CBZUtils: cls.zip_compression(comicInfo.getDirComicChapter(), cls.getCBZ_Path()) time.sleep(0.1) fileUtils.remove(comicInfo.getDirComicChapter()) - return cls.PackCBZAndequZipLength() + cls.zip_compression(comicInfo.getDirComicChapter(), cls.getCBZ_Path()) + verUtils.verNextCBZ() @classmethod def replaceZip(cls,filepath,unpack_dir=None): @@ -143,8 +129,10 @@ class CBZUtils: class verUtils: @classmethod - def verNextCBZ(cls,list_img): + def verNextCBZ(cls,list_img=None): #验证数据是已存在且是否完整 + if list_img == None: + comicInfo.getChapterImgs() cbz_path = CBZUtils.getCBZ_Path() is_next = False if os.path.exists(cbz_path): @@ -153,7 +141,7 @@ class verUtils: except: cbz_size = 0 if len(list_img) == cbz_size: - ntfy.sendMsg(f"{comicInfo.getComicName()} {comicInfo.getChapter()} 数据完整,已跳过") + ntfy.sendMsg(f"{comicInfo.getComicName()} {comicInfo.getChapter()} 数据完整") is_next = True else: ntfy.sendMsg(f"{comicInfo.getComicName()} {comicInfo.getChapter()} 数据不完整,尝试删除配置CBZ文件后重试")