fix
This commit is contained in:
parent
122d54c618
commit
abc855d931
4
test.py
4
test.py
@ -211,7 +211,7 @@ class comicInfo:
|
|||||||
with NamedTemporaryFile(delete=False) as tmp:
|
with NamedTemporaryFile(delete=False) as tmp:
|
||||||
tmp.close()
|
tmp.close()
|
||||||
shutil.move(cbz_path, tmp.name)
|
shutil.move(cbz_path, tmp.name)
|
||||||
|
time.sleep(0.2)
|
||||||
# 读取原文件并替换 ComicInfo.xml
|
# 读取原文件并替换 ComicInfo.xml
|
||||||
with ZipFile(tmp.name, 'r') as source_zip:
|
with ZipFile(tmp.name, 'r') as source_zip:
|
||||||
with ZipFile(output_path, 'w') as new_zip:
|
with ZipFile(output_path, 'w') as new_zip:
|
||||||
@ -229,7 +229,7 @@ class comicInfo:
|
|||||||
print(f"更新 CBZ 文件失败: {e}")
|
print(f"更新 CBZ 文件失败: {e}")
|
||||||
if os.path.exists(tmp.name):
|
if os.path.exists(tmp.name):
|
||||||
shutil.move(tmp.name, cbz_path) # 恢复备份
|
shutil.move(tmp.name, cbz_path) # 恢复备份
|
||||||
return False
|
raise exit(f"更新失败")
|
||||||
|
|
||||||
def update_comicinfo_cbz(self, cbz_path):
|
def update_comicinfo_cbz(self, cbz_path):
|
||||||
"""更新CBZ中的ComicInfo.xml
|
"""更新CBZ中的ComicInfo.xml
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user