mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-23 11:42:20 +08:00
Merge pull request #114 from STDquantum/master
html页面输入页码可以回车跳转,跳转后自动滚动到页面顶部。统一了缩进
This commit is contained in:
commit
9d22c17ebd
@ -1,6 +1,42 @@
|
|||||||
import os
|
import os
|
||||||
import sqlite3
|
import sqlite3
|
||||||
|
|
||||||
|
def merge_MediaMSG_databases(source_paths, target_path):
|
||||||
|
# 创建目标数据库连接
|
||||||
|
target_conn = sqlite3.connect(target_path)
|
||||||
|
target_cursor = target_conn.cursor()
|
||||||
|
try:
|
||||||
|
# 开始事务
|
||||||
|
target_conn.execute("BEGIN;")
|
||||||
|
for i, source_path in enumerate(source_paths):
|
||||||
|
if not os.path.exists(source_path):
|
||||||
|
break
|
||||||
|
db = sqlite3.connect(source_path)
|
||||||
|
db.text_factory = str
|
||||||
|
cursor = db.cursor()
|
||||||
|
sql = '''
|
||||||
|
SELECT Key,Reserved0,Buf,Reserved1,Reserved2 FROM Media;
|
||||||
|
'''
|
||||||
|
cursor.execute(sql)
|
||||||
|
result = cursor.fetchall()
|
||||||
|
# 附加源数据库
|
||||||
|
target_cursor.executemany(
|
||||||
|
"INSERT INTO Media (Key,Reserved0,Buf,Reserved1,Reserved2)"
|
||||||
|
"VALUES(?,?,?,?,?)",
|
||||||
|
result)
|
||||||
|
cursor.close()
|
||||||
|
db.close()
|
||||||
|
# 提交事务
|
||||||
|
target_conn.execute("COMMIT;")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
# 发生异常时回滚事务
|
||||||
|
target_conn.execute("ROLLBACK;")
|
||||||
|
raise e
|
||||||
|
|
||||||
|
finally:
|
||||||
|
# 关闭目标数据库连接
|
||||||
|
target_conn.close()
|
||||||
|
|
||||||
def merge_databases(source_paths, target_path):
|
def merge_databases(source_paths, target_path):
|
||||||
# 创建目标数据库连接
|
# 创建目标数据库连接
|
||||||
|
@ -518,20 +518,19 @@ html_head = '''
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>Chat Records</title>
|
<title>Chat Records</title>
|
||||||
<style>
|
<style>
|
||||||
|
*{
|
||||||
*{
|
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
body{
|
body{
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal {
|
.modal {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
z-index: 9999;
|
z-index: 9999;
|
||||||
@ -540,16 +539,16 @@ html_head = '''
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background-color: rgba(0, 0, 0, 0.8);
|
background-color: rgba(0, 0, 0, 0.8);
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-image {
|
.modal-image {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
max-height: 90%;
|
max-height: 90%;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
margin-top: 5%;
|
margin-top: 5%;
|
||||||
}
|
}
|
||||||
.container{
|
.container{
|
||||||
height: 760px;
|
height: 760px;
|
||||||
width: 900px;
|
width: 900px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -558,17 +557,17 @@ html_head = '''
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.content{
|
.content{
|
||||||
width: calc(100% - 40px);
|
width: calc(100% - 40px);
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
.content:hover::-webkit-scrollbar-thumb{
|
.content:hover::-webkit-scrollbar-thumb{
|
||||||
background:rgba(0,0,0,0.1);
|
background:rgba(0,0,0,0.1);
|
||||||
}
|
}
|
||||||
.bubble{
|
.bubble{
|
||||||
max-width: 400px;
|
max-width: 400px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
@ -576,12 +575,12 @@ html_head = '''
|
|||||||
color: #000;
|
color: #000;
|
||||||
word-wrap:break-word;
|
word-wrap:break-word;
|
||||||
word-break:normal;
|
word-break:normal;
|
||||||
}
|
}
|
||||||
.item-left .bubble{
|
.item-left .bubble{
|
||||||
margin-left: 15px;
|
margin-left: 15px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
.item-left .bubble:before{
|
.item-left .bubble:before{
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
@ -591,12 +590,12 @@ html_head = '''
|
|||||||
border-right: 10px solid #fff;
|
border-right: 10px solid #fff;
|
||||||
border-bottom: 10px solid transparent;
|
border-bottom: 10px solid transparent;
|
||||||
left: -20px;
|
left: -20px;
|
||||||
}
|
}
|
||||||
.item-right .bubble{
|
.item-right .bubble{
|
||||||
margin-right: 15px;
|
margin-right: 15px;
|
||||||
background-color: #9eea6a;
|
background-color: #9eea6a;
|
||||||
}
|
}
|
||||||
.item-right .bubble:before{
|
.item-right .bubble:before{
|
||||||
content: "";
|
content: "";
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 0;
|
width: 0;
|
||||||
@ -606,19 +605,19 @@ html_head = '''
|
|||||||
border-right: 10px solid transparent;
|
border-right: 10px solid transparent;
|
||||||
border-bottom: 10px solid transparent;
|
border-bottom: 10px solid transparent;
|
||||||
right: -20px;
|
right: -20px;
|
||||||
}
|
}
|
||||||
.item{
|
.item{
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.item.item-right{
|
.item.item-right{
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.item.item-center{
|
.item.item-center{
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
.item.item-center span{
|
.item.item-center span{
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
padding: 2px 4px;
|
padding: 2px 4px;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
@ -629,32 +628,32 @@ html_head = '''
|
|||||||
-ms-user-select:none; /*IE10*/
|
-ms-user-select:none; /*IE10*/
|
||||||
-khtml-user-select:none; /*早期浏览器*/
|
-khtml-user-select:none; /*早期浏览器*/
|
||||||
user-select:none;
|
user-select:none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-image img{
|
.chat-image img{
|
||||||
margin-right: 18px;
|
margin-right: 18px;
|
||||||
margin-left: 18px;
|
margin-left: 18px;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
max-height: auto;
|
max-height: auto;
|
||||||
}
|
}
|
||||||
.avatar img{
|
.avatar img{
|
||||||
width: 42px;
|
width: 42px;
|
||||||
height: 42px;
|
height: 42px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.chat-video video{
|
.chat-video video{
|
||||||
margin-right: 18px;
|
margin-right: 18px;
|
||||||
margin-left: 18px;
|
margin-left: 18px;
|
||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
}
|
}
|
||||||
.input-area{
|
.input-area{
|
||||||
border-top:0.5px solid #e0e0e0;
|
border-top:0.5px solid #e0e0e0;
|
||||||
height: 150px;
|
height: 150px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-flow: column;
|
flex-flow: column;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
textarea{
|
textarea{
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
@ -664,41 +663,41 @@ html_head = '''
|
|||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
outline:none;
|
outline:none;
|
||||||
resize:none;
|
resize:none;
|
||||||
}
|
}
|
||||||
.button-area{
|
.button-area{
|
||||||
display: flex;
|
display: flex;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
padding: 5px;
|
padding: 5px;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
}
|
}
|
||||||
.button-area button{
|
.button-area button{
|
||||||
width: 80px;
|
width: 80px;
|
||||||
border: none;
|
border: none;
|
||||||
outline: none;
|
outline: none;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
float: right;
|
float: right;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 设置滚动条的样式 */
|
/* 设置滚动条的样式 */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width:10px;
|
width:10px;
|
||||||
}
|
}
|
||||||
/* 滚动槽 */
|
/* 滚动槽 */
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
-webkit-box-shadow:inset006pxrgba(0,0,0,0.3);
|
-webkit-box-shadow:inset006pxrgba(0,0,0,0.3);
|
||||||
border-radius:8px;
|
border-radius:8px;
|
||||||
}
|
}
|
||||||
/* 滚动条滑块 */
|
/* 滚动条滑块 */
|
||||||
::-webkit-scrollbar-thumb {
|
::-webkit-scrollbar-thumb {
|
||||||
border-radius:10px;
|
border-radius:10px;
|
||||||
background:rgba(0,0,0,0);
|
background:rgba(0,0,0,0);
|
||||||
-webkit-box-shadow:inset006pxrgba(0,0,0,0.5);
|
-webkit-box-shadow:inset006pxrgba(0,0,0,0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
.pagination-container {
|
.pagination-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@ -758,7 +757,7 @@ input {
|
|||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="content" id="chat-container">
|
<div class="content" id="chat-container">
|
||||||
<div class="item item-center"><span>昨天 12:35</span></div>
|
<div class="item item-center"><span>昨天 12:35</span></div>
|
||||||
<div class="item item-center"><span>你已添加了凡繁烦,现在可以开始聊天了。</span></div>
|
<div class="item item-center"><span>你已添加了凡繁烦,现在可以开始聊天了。</span></div>
|
||||||
@ -779,9 +778,7 @@ input {
|
|||||||
<div class="item item-center">
|
<div class="item item-center">
|
||||||
<span>昨天 13:15</span>
|
<span>昨天 13:15</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div></div>
|
<div></div>
|
||||||
<div id="modal" class="modal" onclick="hideModal()">
|
<div id="modal" class="modal" onclick="hideModal()">
|
||||||
@ -793,51 +790,51 @@ input {
|
|||||||
<button onclick="nextPage()">下一页</button>
|
<button onclick="nextPage()">下一页</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="jump-row">
|
<div class="jump-row">
|
||||||
<input type="number" id="gotoPageInput" placeholder="跳转到第几页">
|
<input type="number" id="gotoPageInput" onkeydown="checkEnter(event)" placeholder="跳转到第几页">
|
||||||
<button onclick="gotoPage()">跳转</button>
|
<button onclick="gotoPage()">跳转</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="paginationInfo"></div>
|
<div id="paginationInfo"></div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
const chatContainer = document.getElementById('chat-container');
|
const chatContainer = document.getElementById('chat-container');
|
||||||
// Sample chat messages (replace this with your actual data)
|
// Sample chat messages (replace this with your actual data)
|
||||||
const chatMessages = [
|
const chatMessages = [
|
||||||
'''
|
'''
|
||||||
html_end = '''
|
html_end = '''
|
||||||
];
|
];
|
||||||
function renderMessages(messages) {
|
function renderMessages(messages) {
|
||||||
for (const message of messages) {
|
for (const message of messages) {
|
||||||
const messageElement = document.createElement('div');
|
const messageElement = document.createElement('div');
|
||||||
if (message.type == 1){
|
if (message.type == 1) {
|
||||||
if (message.is_send == 1){
|
if (message.is_send == 1) {
|
||||||
messageElement.className = "item item-right";
|
messageElement.className = "item item-right";
|
||||||
messageElement.innerHTML = `<div class='bubble bubble-right'>${message.text}</div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
messageElement.innerHTML = `<div class='bubble bubble-right'>${message.text}</div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
||||||
}
|
}
|
||||||
else if(message.is_send==0){
|
else if (message.is_send == 0) {
|
||||||
messageElement.className = "item item-left";
|
messageElement.className = "item item-left";
|
||||||
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='bubble bubble-right'>${message.text}</div>`
|
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='bubble bubble-right'>${message.text}</div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(message.type == 0){
|
else if (message.type == 0) {
|
||||||
messageElement.className = "item item-center";
|
messageElement.className = "item item-center";
|
||||||
messageElement.innerHTML = `<span>${message.text}</span>`
|
messageElement.innerHTML = `<span>${message.text}</span>`
|
||||||
}
|
}
|
||||||
else if (message.type == 3){
|
else if (message.type == 3) {
|
||||||
if (message.is_send == 1){
|
if (message.is_send == 1) {
|
||||||
messageElement.className = "item item-right";
|
messageElement.className = "item item-right";
|
||||||
messageElement.innerHTML = `<div class='chat-image'><img src="${message.text}" /></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
messageElement.innerHTML = `<div class='chat-image'><img src="${message.text}" /></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
||||||
}
|
}
|
||||||
else if(message.is_send==0){
|
else if (message.is_send == 0) {
|
||||||
messageElement.className = "item item-left";
|
messageElement.className = "item item-left";
|
||||||
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='chat-image'><img src="${message.text}" /></div>`
|
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='chat-image'><img src="${message.text}" /></div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (message.type == 43) {
|
else if (message.type == 43) {
|
||||||
if (message.is_send == 1){
|
if (message.is_send == 1) {
|
||||||
messageElement.className = "item item-right";
|
messageElement.className = "item item-right";
|
||||||
messageElement.innerHTML = `<div class='chat-video'><video src="${message.text}" controls /></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
messageElement.innerHTML = `<div class='chat-video'><video src="${message.text}" controls /></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
||||||
}
|
}
|
||||||
else if(message.is_send==0){
|
else if (message.is_send == 0) {
|
||||||
messageElement.className = "item item-left";
|
messageElement.className = "item item-left";
|
||||||
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='chat-video'><video src="${message.text}" controls /></div>`
|
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='chat-video'><video src="${message.text}" controls /></div>`
|
||||||
}
|
}
|
||||||
@ -846,6 +843,11 @@ html_end = '''
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkEnter(event) {
|
||||||
|
if (event.keyCode === 13) {
|
||||||
|
gotoPage();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const itemsPerPage = 100; // 每页显示的元素个数
|
const itemsPerPage = 100; // 每页显示的元素个数
|
||||||
let currentPage = 1; // 当前页
|
let currentPage = 1; // 当前页
|
||||||
@ -862,42 +864,43 @@ html_end = '''
|
|||||||
for (let i = startIndex; i < endIndex && i < chatMessages.length; i++) {
|
for (let i = startIndex; i < endIndex && i < chatMessages.length; i++) {
|
||||||
const message = chatMessages[i];
|
const message = chatMessages[i];
|
||||||
const messageElement = document.createElement('div');
|
const messageElement = document.createElement('div');
|
||||||
if (message.type == 1){
|
if (message.type == 1) {
|
||||||
if (message.is_send == 1){
|
if (message.is_send == 1) {
|
||||||
messageElement.className = "item item-right";
|
messageElement.className = "item item-right";
|
||||||
messageElement.innerHTML = `<div class='bubble bubble-right'>${message.text}</div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
messageElement.innerHTML = `<div class='bubble bubble-right'>${message.text}</div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
||||||
}
|
}
|
||||||
else if(message.is_send==0){
|
else if (message.is_send == 0) {
|
||||||
messageElement.className = "item item-left";
|
messageElement.className = "item item-left";
|
||||||
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='bubble bubble-right'>${message.text}</div>`
|
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='bubble bubble-right'>${message.text}</div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(message.type == 0){
|
else if (message.type == 0) {
|
||||||
messageElement.className = "item item-center";
|
messageElement.className = "item item-center";
|
||||||
messageElement.innerHTML = `<span>${message.text}</span>`
|
messageElement.innerHTML = `<span>${message.text}</span>`
|
||||||
}
|
}
|
||||||
else if (message.type == 3){
|
else if (message.type == 3) {
|
||||||
if (message.is_send == 1){
|
if (message.is_send == 1) {
|
||||||
messageElement.className = "item item-right";
|
messageElement.className = "item item-right";
|
||||||
messageElement.innerHTML = `<div class='chat-image' ><img src="${message.text}" onclick="showModal(this)"/></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
messageElement.innerHTML = `<div class='chat-image' ><img src="${message.text}" onclick="showModal(this)"/></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
||||||
}
|
}
|
||||||
else if(message.is_send==0){
|
else if (message.is_send == 0) {
|
||||||
messageElement.className = "item item-left";
|
messageElement.className = "item item-left";
|
||||||
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}"/></div><div class='chat-image'><img src="${message.text}" onclick="showModal(this)"/></div>`
|
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}"/></div><div class='chat-image'><img src="${message.text}" onclick="showModal(this)"/></div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (message.type == 43) {
|
else if (message.type == 43) {
|
||||||
if (message.is_send == 1){
|
if (message.is_send == 1) {
|
||||||
messageElement.className = "item item-right";
|
messageElement.className = "item item-right";
|
||||||
messageElement.innerHTML = `<div class='chat-video'><video src="${message.text}" controls /></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
messageElement.innerHTML = `<div class='chat-video'><video src="${message.text}" controls /></div><div class='avatar'><img src="${message.avatar_path}" /></div>`
|
||||||
}
|
}
|
||||||
else if(message.is_send==0){
|
else if (message.is_send == 0) {
|
||||||
messageElement.className = "item item-left";
|
messageElement.className = "item item-left";
|
||||||
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='chat-video'><video src="${message.text}" controls "/></div>`
|
messageElement.innerHTML = `<div class='avatar'><img src="${message.avatar_path}" /></div><div class='chat-video'><video src="${message.text}" controls "/></div>`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
chatContainer.appendChild(messageElement);
|
chatContainer.appendChild(messageElement);
|
||||||
}
|
}
|
||||||
|
document.querySelector("#chat-container").scrollTop = 0;
|
||||||
updatePaginationInfo();
|
updatePaginationInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ from PyQt5.QtGui import QDesktopServices
|
|||||||
from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog
|
from PyQt5.QtWidgets import QWidget, QMessageBox, QFileDialog
|
||||||
|
|
||||||
from app.DataBase import msg_db, misc_db
|
from app.DataBase import msg_db, misc_db
|
||||||
from app.DataBase.merge import merge_databases
|
from app.DataBase.merge import merge_databases, merge_MediaMSG_databases
|
||||||
from app.decrypt import get_wx_info, decrypt
|
from app.decrypt import get_wx_info, decrypt
|
||||||
from app.log import logger
|
from app.log import logger
|
||||||
from app.util import path
|
from app.util import path
|
||||||
@ -184,6 +184,19 @@ class DecryptControl(QWidget, decryptUi.Ui_Dialog):
|
|||||||
merge_databases(source_databases, target_database)
|
merge_databases(source_databases, target_database)
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
QMessageBox.critical(self, "错误", "数据库不存在\n请检查微信版本是否为最新")
|
QMessageBox.critical(self, "错误", "数据库不存在\n请检查微信版本是否为最新")
|
||||||
|
|
||||||
|
# 音频数据库文件
|
||||||
|
target_database = "app/DataBase/Msg/MediaMSG.db"
|
||||||
|
# 源数据库文件列表
|
||||||
|
source_databases = [f"app/DataBase/Msg/MediaMSG{i}.db" for i in range(1, 20)]
|
||||||
|
import shutil
|
||||||
|
shutil.copy("app/DataBase/Msg/MediaMSG0.db", target_database) # 使用一个数据库文件作为模板
|
||||||
|
# 合并数据库
|
||||||
|
try:
|
||||||
|
merge_MediaMSG_databases(source_databases, target_database)
|
||||||
|
except FileNotFoundError:
|
||||||
|
QMessageBox.critical(self, "错误", "数据库不存在\n请检查微信版本是否为最新")
|
||||||
|
|
||||||
self.DecryptSignal.emit(True)
|
self.DecryptSignal.emit(True)
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user