This commit is contained in:
caiwx86 2025-02-10 20:03:37 +08:00
parent 30d39584f0
commit 850e0283d6

View File

@ -210,7 +210,7 @@ class comicInfo:
# 创建临时文件处理覆盖操作
with NamedTemporaryFile(delete=False) as tmp:
tmp.close()
shutil.copy(cbz_path, tmp.name)
shutil.move(cbz_path, tmp.name)
# 读取原文件并替换 ComicInfo.xml
with ZipFile(tmp.name, 'r') as source_zip:
@ -228,7 +228,7 @@ class comicInfo:
except Exception as e:
print(f"更新 CBZ 文件失败: {e}")
if os.path.exists(tmp.name):
os.replace(tmp.name, cbz_path) # 恢复备份
shutil.move(tmp.name, cbz_path) # 恢复备份
return False
def update_comicinfo_cbz(self, cbz_path):