fix
This commit is contained in:
parent
30d39584f0
commit
850e0283d6
4
test.py
4
test.py
@ -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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user