fix
This commit is contained in:
parent
ff8ee7a1d6
commit
0e7f1f2945
@ -61,10 +61,15 @@ class CBZUtils:
|
|||||||
zf.close()
|
zf.close()
|
||||||
ntfy.sendMsg(f"打包完成:{target_file}")
|
ntfy.sendMsg(f"打包完成:{target_file}")
|
||||||
else:
|
else:
|
||||||
with ZipFile(target_file, "r") as zfile:
|
|
||||||
filenames = zfile.namelist()
|
|
||||||
zfile.close()
|
|
||||||
print("文件已存在:", target_file)
|
print("文件已存在:", target_file)
|
||||||
|
len_chapter_imgs = len(comicInfo.getChapterImgs())
|
||||||
|
if len_chapter_imgs != 0 and len_chapter_imgs != cls.zip_info(target_file):
|
||||||
|
try:
|
||||||
|
os.remove(target_file)
|
||||||
|
comicInfo.setProgress(comicInfo.PROGRESS_NONE)
|
||||||
|
print("文件已删除:", target_file)
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
if remove:
|
if remove:
|
||||||
filenames.remove(comicInfo.COMIC_ICON_NAME+".jpg")
|
filenames.remove(comicInfo.COMIC_ICON_NAME+".jpg")
|
||||||
filenames.remove(comicInfo.COMIC_INFO_XML)
|
filenames.remove(comicInfo.COMIC_INFO_XML)
|
||||||
@ -125,11 +130,11 @@ class CBZUtils:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def zip_info(cls,path,filter=False):
|
def zip_info(cls,path,filter=True):
|
||||||
result = None
|
result = None
|
||||||
try:
|
try:
|
||||||
zip_file = ZipFile(path)
|
with ZipFile(path, "r") as zip_file:
|
||||||
result = zip_file.namelist()
|
result = zip_file.namelist()
|
||||||
if filter:
|
if filter:
|
||||||
result.remove(comicInfo.COMIC_ICON_NAME+".jpg")
|
result.remove(comicInfo.COMIC_ICON_NAME+".jpg")
|
||||||
result.remove(comicInfo.COMIC_INFO_XML)
|
result.remove(comicInfo.COMIC_INFO_XML)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user