修复部分聊天记录重复的问题#48 #36

This commit is contained in:
shuaikangzhou 2023-12-04 18:56:26 +08:00
parent 7b3774cea9
commit db417dc48f
2 changed files with 10 additions and 8 deletions

View File

@ -14,13 +14,15 @@ root_path = 'FileStorage/MsgAttach/'
@log
def get_md5_from_xml(content):
# 解析XML
root = ET.fromstring(content)
# 提取md5的值
md5_value = root.find(".//img").get("md5")
# print(md5_value)
return md5_value
try:
# 解析XML
root = ET.fromstring(content)
# 提取md5的值
md5_value = root.find(".//img").get("md5")
# print(md5_value)
return md5_value
except ET.ParseError:
return None
def singleton(cls):
_instance = {}

View File

@ -171,7 +171,7 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
# 目标数据库文件
target_database = "app/DataBase/Msg/MSG.db"
# 源数据库文件列表
source_databases = [f"app/DataBase/Msg/MSG{i}.db" for i in range(20)]
source_databases = [f"app/DataBase/Msg/MSG{i}.db" for i in range(1,20)]
import shutil
shutil.copy("app/DataBase/Msg/MSG0.db", target_database) # 使用一个数据库文件作为模板
# 合并数据库