Skip to content

Commit

Permalink
Merge pull request #272 from STDquantum/master
Browse files Browse the repository at this point in the history
更改部分css;修复语音转文字部分问题
  • Loading branch information
LC044 authored Jan 6, 2024
2 parents f6f2eb6 + 8263018 commit 0a69b7b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
4 changes: 3 additions & 1 deletion app/DataBase/exporter_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}'}},'''
)
Expand Down
21 changes: 17 additions & 4 deletions app/resources/data/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
}

.chat-music-audio .player-original p ,.chat-file .app-info p{
margin-top: 5px;
margin-top: 3px;
color: #888;
}

Expand All @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -754,8 +767,8 @@
<div class="file-img flex2">
<img src="${message.icon_path}"/>
</div>
</div>
<div class="app-info"><p>${message.app_name}</p></div>`
</div>` +
(message.app_name ? `<div class="app-info"><p>${message.app_name}</p></div>` : "");
return messageFileTag;
}

Expand Down

0 comments on commit 0a69b7b

Please sign in to comment.