fix
This commit is contained in:
1 parent
30d39584f0
commit
850e0283d6
1 file changed
+2
-2
@@ -210,7 +210,7 @@ class comicInfo:
|
|||||||
# 创建临时文件处理覆盖操作
|
# 创建临时文件处理覆盖操作
|
||||||
with NamedTemporaryFile(delete=False) as tmp:
|
with NamedTemporaryFile(delete=False) as tmp:
|
||||||
tmp.close()
|
tmp.close()
|
||||||
shutil.copy(cbz_path, tmp.name)
|
shutil.move(cbz_path, tmp.name)
|
||||||
|
|
||||||
# 读取原文件并替换 ComicInfo.xml
|
# 读取原文件并替换 ComicInfo.xml
|
||||||
with ZipFile(tmp.name, 'r') as source_zip:
|
with ZipFile(tmp.name, 'r') as source_zip:
|
||||||
@@ -228,7 +228,7 @@ class comicInfo:
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"更新 CBZ 文件失败: {e}")
|
print(f"更新 CBZ 文件失败: {e}")
|
||||||
if os.path.exists(tmp.name):
|
if os.path.exists(tmp.name):
|
||||||
os.replace(tmp.name, cbz_path) # 恢复备份
|
shutil.move(tmp.name, cbz_path) # 恢复备份
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def update_comicinfo_cbz(self, cbz_path):
|
def update_comicinfo_cbz(self, cbz_path):
|
||||||
|
|||||||
Reference in new issue
Block a user