From 74abe11880c8e8d0ee9f431a64b5f3f07873d6f5 Mon Sep 17 00:00:00 2001 From: caiwx86 Date: Mon, 16 Jan 2023 03:09:19 +0800 Subject: [PATCH] fix --- utils/CBZUtils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/CBZUtils.py b/utils/CBZUtils.py index 61231c7..87fd81d 100644 --- a/utils/CBZUtils.py +++ b/utils/CBZUtils.py @@ -94,7 +94,7 @@ class CBZUtils: @classmethod def replaceZip(cls,filepath,unpack_dir=None): if os.path.exists(filepath): - ctime = os.path.getctime(filepath) + ctime = os.path.getmtime(filepath) str_ctime = datetime.fromtimestamp(int(ctime)) file_ctime = str(str_ctime.year)+"{:0>2d}".format(str_ctime.month)+"{:0>2d}".format(str_ctime.day) c_ctime = 20230117 @@ -115,6 +115,9 @@ class CBZUtils: if not is_file and os.path.exists(filepath): os.remove(filepath) print(f"数据不完整,已删除:{filepath}") + if is_file and os.path.exists(filepath): + os.utime(filepath) + print(f"已更新文件时间 {filepath}") if os.path.exists(unpack_dir): shutil.rmtree(unpack_dir) # 删除删除main.ftl文件