处理音频合并相同两行的情况

This commit is contained in:
STDquantum 2023-12-13 16:10:17 +08:00
parent 3d68f99780
commit 62febf63c7

View File

@ -20,10 +20,13 @@ def merge_MediaMSG_databases(source_paths, target_path):
cursor.execute(sql) cursor.execute(sql)
result = cursor.fetchall() result = cursor.fetchall()
# 附加源数据库 # 附加源数据库
target_cursor.executemany( try:
"INSERT INTO Media (Key,Reserved0,Buf,Reserved1,Reserved2)" target_cursor.executemany(
"VALUES(?,?,?,?,?)", "INSERT INTO Media (Key,Reserved0,Buf,Reserved1,Reserved2)"
result) "VALUES(?,?,?,?,?)",
result)
except sqlite3.IntegrityError:
print("有重复key", "跳过")
cursor.close() cursor.close()
db.close() db.close()
# 提交事务 # 提交事务