Merge pull request #272 from STDquantum/master

更改部分css;修复语音转文字部分问题
This commit is contained in:
SiYuan
2024-01-06 13:34:08 +08:00
committed by GitHub
2 changed files with 20 additions and 5 deletions

View File

@@ -82,10 +82,12 @@ class HtmlExporter(ExporterBase):
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}'}},'''
)