From 9165f897ed25452ce98a4f9d1b514c879c7879f3 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Mon, 16 Jan 2023 04:43:07 +0800 Subject: [PATCH] fix --- utils/CBZUtils.py | 6 ++---- utils/entity/BaseComicEntity.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/utils/CBZUtils.py b/utils/CBZUtils.py index 0ce4ee3..548d11e 100644 --- a/utils/CBZUtils.py +++ b/utils/CBZUtils.py @@ -100,12 +100,10 @@ class CBZUtils: for file in fz.namelist(): if file.endswith(".jpg"): data = fz.read(file) - time.sleep(0.1) - is_file = fileUtils.ver_file(data,"image") - if not is_file and os.path.exists(filepath): + if len(data) < 500 and os.path.exists(filepath): os.remove(filepath) print(f"数据不完整,已删除:{filepath}") - if is_file and cls.compareFileDate(filepath): + if cls.compareFileDate(filepath): os.utime(filepath) print(f"已更新文件时间 {filepath}") if os.path.exists(unpack_dir): diff --git a/utils/entity/BaseComicEntity.py b/utils/entity/BaseComicEntity.py index c630099..4401d60 100644 --- a/utils/entity/BaseComicEntity.py +++ b/utils/entity/BaseComicEntity.py @@ -39,7 +39,7 @@ class baseComic: comicInfo.setChapterName(chapter) cbz_path = comicInfo.getNewCBZComicChapter("file") comicInfo.getNewIconComicChapter() - #CBZUtils.replaceZip(cbz_path) + CBZUtils.replaceZip(cbz_path) if comicInfo.nextExistsGetPath("done_") and not os.path.exists(cbz_path): comicInfo.nextExistsGetPath("done_",remove=True) if not os.path.exists(cbz_path):