From 013d7e61797c1c95a567fe4df6f4879d7c95c189 Mon Sep 17 00:00:00 2001 From: STDquantum <405720329@qq.com> Date: Fri, 5 Jan 2024 22:14:32 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E9=83=A8=E5=88=86css?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E5=A4=8D=E8=AF=AD=E9=9F=B3=E8=BD=AC=E6=96=87?= =?UTF-8?q?=E5=AD=97=E9=83=A8=E5=88=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/DataBase/exporter_html.py | 4 +++- app/DataBase/msg.py | 2 +- app/resources/data/template.html | 21 +++++++++++++++++---- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/app/DataBase/exporter_html.py b/app/DataBase/exporter_html.py index f69414c3..4b10e8cc 100644 --- a/app/DataBase/exporter_html.py +++ b/app/DataBase/exporter_html.py @@ -82,10 +82,12 @@ def audio(self, doc, message): try: audio_path = media_msg_db.get_audio_path(msgSvrId, output_path=origin_docx_path + "/voice") audio_path = "./voice/" + os.path.basename(audio_path) - voice_to_text = escape_js_and_html(media_msg_db.get_audio_text(str_content)) except: logger.error(traceback.format_exc()) return + voice_to_text = media_msg_db.get_audio_text(str_content) + if voice_to_text and voice_to_text != "": + voice_to_text = escape_js_and_html(voice_to_text) doc.write( f'''{{ type:34, text:'{audio_path}',is_send:{is_send},avatar_path:'{avatar}',voice_to_text:'{voice_to_text}',timestamp:{timestamp},is_chatroom:{is_chatroom},displayname:'{display_name}'}},''' ) diff --git a/app/DataBase/msg.py b/app/DataBase/msg.py index 4c67639d..1ae798d8 100644 --- a/app/DataBase/msg.py +++ b/app/DataBase/msg.py @@ -272,7 +272,7 @@ def get_contact(self, contacts): else: contacts[i].append(0) contacts.sort(key=lambda cur_contact: cur_contact[-1], reverse=True) - return contacts + return contacts[:40] def get_messages_by_days(self, username_, is_Annual_report_=False, year_='2023'): if is_Annual_report_: diff --git a/app/resources/data/template.html b/app/resources/data/template.html index 83c48197..37bab59c 100644 --- a/app/resources/data/template.html +++ b/app/resources/data/template.html @@ -217,7 +217,7 @@ } .chat-music-audio .player-original p ,.chat-file .app-info p{ - margin-top: 5px; + margin-top: 3px; color: #888; } @@ -239,8 +239,11 @@ .chat-music-audio .player-info ,.chat-file .file-info{ width: 200px; height: 80px; + margin-left: 4px; + margin-top: 15px; white-space: normal; flex-basis: 200px; + word-break: break-word; } .chat-music-audio .song-title,.chat-file .file-name { @@ -249,10 +252,20 @@ } .chat-music-audio .artist ,.chat-file .file-size{ - margin-top: 10px; + margin-top: 5px; color: #888; } +.app-info { + font-size: 13px; + margin-left: 3px; + margin-right: 3px; +} + +.file-size { + font-size: 14px; +} + .chat-music-audio .play-button { width: 50px; height: 50px; @@ -754,8 +767,8 @@
${message.app_name}
${message.app_name}