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/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 ? `

${message.app_name}

` : ""); return messageFileTag; }