mirror of
https://github.com/LC044/WeChatMsg
synced 2025-02-21 01:52:35 +08:00
Merge branch 'LC044:master' into master
This commit is contained in:
commit
981f1e8c28
@ -55,12 +55,7 @@ class HtmlExporter(ExporterBase):
|
||||
avatar = self.get_avatar_path(is_send, message)
|
||||
display_name = self.get_display_name(is_send, message)
|
||||
str_content = escape_js_and_html(str_content)
|
||||
image_path = hard_link_db.get_image(str_content, BytesExtra, thumb=False)
|
||||
if not os.path.exists(os.path.join(Me().wx_dir, image_path)):
|
||||
image_thumb_path = hard_link_db.get_image(str_content, BytesExtra, thumb=True)
|
||||
if not os.path.exists(os.path.join(Me().wx_dir, image_thumb_path)):
|
||||
return
|
||||
image_path = image_thumb_path
|
||||
image_path = hard_link_db.get_image(str_content, BytesExtra, up_dir=Me().wx_dir, thumb=False)
|
||||
image_path = get_image_path(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image')
|
||||
doc.write(
|
||||
f'''{{ type:{type_}, text: '{image_path}',is_send:{is_send},avatar_path:'{avatar}',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}'}},'''
|
||||
|
@ -226,14 +226,14 @@ class HardLink:
|
||||
result = dat_image
|
||||
return result
|
||||
|
||||
def get_image(self, content, bytesExtra, thumb=False) -> str:
|
||||
def get_image(self, content, bytesExtra, up_dir="", thumb=False) -> str:
|
||||
msg_bytes = MessageBytesExtra()
|
||||
msg_bytes.ParseFromString(bytesExtra)
|
||||
if thumb:
|
||||
result = self.get_image_thumb(content, bytesExtra)
|
||||
else:
|
||||
result = self.get_image_original(content, bytesExtra)
|
||||
if not (result and os.path.exists(result)):
|
||||
if not (result and os.path.exists(os.path.join(up_dir, result))):
|
||||
result = self.get_image_thumb(content, bytesExtra)
|
||||
return result
|
||||
|
||||
|
@ -379,12 +379,7 @@ class OutputImage(QThread):
|
||||
BytesExtra = message[10]
|
||||
timestamp = message[5]
|
||||
try:
|
||||
image_path = hard_link_db.get_image(str_content, BytesExtra, thumb=False)
|
||||
if not os.path.exists(os.path.join(Me().wx_dir, image_path)):
|
||||
image_thumb_path = hard_link_db.get_image(str_content, BytesExtra, thumb=True)
|
||||
if not os.path.exists(os.path.join(Me().wx_dir, image_thumb_path)):
|
||||
continue
|
||||
image_path = image_thumb_path
|
||||
image_path = hard_link_db.get_image(str_content, BytesExtra, up_dir=Me().wx_dir,thumb=False)
|
||||
image_path = get_image(image_path, base_path=f'/data/聊天记录/{self.contact.remark}/image')
|
||||
try:
|
||||
os.utime(origin_docx_path + image_path[1:], (timestamp, timestamp))
|
||||
|
@ -1,4 +1,4 @@
|
||||
version = '1.1.0'
|
||||
version = '1.0.8'
|
||||
contact = '701805520'
|
||||
github = 'https://github.com/LC044/WeChatMsg'
|
||||
website = 'https://memotrace.lc044.love/'
|
||||
|
@ -134,7 +134,7 @@ class ChatInfo(QWidget):
|
||||
time_message = Notice(self.last_str_time)
|
||||
self.last_str_time = str_time
|
||||
self.chat_window.add_message_item(time_message, 0)
|
||||
image_path = hard_link_db.get_image(content=str_content, bytesExtra=BytesExtra, thumb=False)
|
||||
image_path = hard_link_db.get_image(content=str_content, bytesExtra=BytesExtra, up_dir=Me().wx_dir,thumb=False)
|
||||
image_path = get_abs_path(image_path)
|
||||
bubble_message = BubbleMessage(
|
||||
image_path,
|
||||
|
@ -346,7 +346,7 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow, QCursorGif):
|
||||
img_bytes = misc_db.get_avatar_buffer(wxid)
|
||||
except:
|
||||
logger.error(f'数据库错误:\n{traceback.format_exc()}')
|
||||
QMessageBox.critical(self, "数据库错误", "请重启微信后重试")
|
||||
QMessageBox.critical(self, "数据库错误", "请重启电脑后重试")
|
||||
close_db()
|
||||
import shutil
|
||||
try:
|
||||
@ -369,6 +369,7 @@ class MainWinController(QMainWindow, mainwindow.Ui_MainWindow, QCursorGif):
|
||||
shutil.rmtree('./app/Database/Msg')
|
||||
except:
|
||||
pass
|
||||
QMessageBox.critical(self, "数据库错误", "请重启电脑后重试")
|
||||
return
|
||||
me = Me()
|
||||
me.set_avatar(img_bytes)
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user