Skip to content

Commit

Permalink
Merge pull request #715 from Ikaros-521/owner
Browse files Browse the repository at this point in the history
字幕写入文件的日志不显示;音频处理函数会对文本内容的\n进行去除
  • Loading branch information
Ikaros-521 committed Mar 21, 2024
2 parents 3e78c96 + 3aa79da commit 7157fd0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,9 @@ def write_content_to_file(self, file_path, content, write_log=True):
try:
with open(file_path, 'w', encoding='utf-8') as file:
file.write(content)
logging.info(f"写入文件:{file_path},内容:【{content}】")

if write_log == True:
logging.info(f"写入文件:{file_path},内容:【{content}】")

return True
except IOError as e:
Expand Down
4 changes: 4 additions & 0 deletions utils/my_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,10 @@ def audio_synthesis_handle(self, data_json):
image_recognition_schedule 图像识别定时任务
"""
if "content" in data_json:
# 替换文本内容中\n为空
data_json['content'] = data_json['content'].replace('\n', '')

# 如果虚拟身体-Unity,则发送数据到中转站
if My_handle.config.get("visual_body") == "unity":
# 判断 'config' 是否存在于字典中
Expand Down

0 comments on commit 7157fd0

Please sign in to comment.