diff --git a/utils/CBZUtils.py b/utils/CBZUtils.py index a0098a4..61231c7 100644 --- a/utils/CBZUtils.py +++ b/utils/CBZUtils.py @@ -93,11 +93,14 @@ class CBZUtils: @classmethod def replaceZip(cls,filepath,unpack_dir=None): - ctime = os.path.getctime(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 - if int(file_ctime) < c_ctime: + if os.path.exists(filepath): + ctime = os.path.getctime(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 + if int(file_ctime) < c_ctime: + return None + else: return None if unpack_dir == None: unpack_dir = str(filepath).split(".")[0]