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文件