Skip to content

Commit

Permalink
Merge pull request #1034 from Ikaros-521/owner
Browse files Browse the repository at this point in the history
优化:消息&音频队列优先级新增 助播文本、音频的设置
  • Loading branch information
Ikaros-521 authored Oct 24, 2024
2 parents ca1ccd8 + 47631cf commit 231b8fa
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
"follow": 20,
"key_mapping": 20,
"integral": 20,
"assistant_anchor_text": 25,
"assistant_anchor_audio": 25,
"talk": 30,
"reread": 30,
"reread_top_priority": 999
Expand Down
2 changes: 2 additions & 0 deletions config.json.bak
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@
"follow": 20,
"key_mapping": 20,
"integral": 20,
"assistant_anchor_text": 25,
"assistant_anchor_audio": 25,
"talk": 30,
"reread": 30,
"reread_top_priority": 999
Expand Down
2 changes: 2 additions & 0 deletions utils/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ def data_priority_insert(self, type:str="等待合成消息", data_json:dict=Non
abnormal_alarm 异常报警
image_recognition_schedule 图像识别定时任务
trends_copywriting 动态文案
assistant_anchor_text 助播-文本
assistant_anchor_audio 助播-音频
"""
logger.debug(f"message_queue: {Audio.message_queue}")
logger.debug(f"data_json: {data_json}")
Expand Down
13 changes: 10 additions & 3 deletions webui.py
Original file line number Diff line number Diff line change
Expand Up @@ -1820,6 +1820,8 @@ def update_config(config_mapping, config, config_data, type="common_config"):
"abnormal_alarm": (input_filter_priority_mapping_abnormal_alarm, 'int'),
"trends_copywriting": (input_filter_priority_mapping_trends_copywriting, 'int'),
"schedule": (input_filter_priority_mapping_schedule, 'int'),
"assistant_anchor_text": (input_filter_priority_mapping_assistant_anchor_text, 'int'),
"assistant_anchor_audio": (input_filter_priority_mapping_assistant_anchor_audio, 'int'),
},
"blacklist": {
"enable": (switch_filter_blacklist_enable, 'bool'),
Expand Down Expand Up @@ -3632,11 +3634,13 @@ def save_config():
with ui.element('div').classes('p-2 bg-blue-100'):
ui.label("下方优先级配置,请使用正整数。数字越大,优先级越高,就会优先合成音频播放")
ui.label("另外需要注意,由于shi山原因,目前这个队列内容是文本切分后计算的长度,所以如果回复内容过长,可能会有丢数据的情况")
with ui.grid(columns=4):
with ui.grid(columns=5):
input_filter_priority_mapping_idle_time_task = ui.input(label='闲时任务 优先级', value=config.get("filter", "priority_mapping", "idle_time_task"), placeholder='数字越大,优先级越高,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_image_recognition_schedule = ui.input(label='图像识别 优先级', value=config.get("filter", "priority_mapping", "image_recognition_schedule"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_local_qa_audio = ui.input(label='本地问答-音频 优先级', value=config.get("filter", "priority_mapping", "local_qa_audio"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_comment = ui.input(label='弹幕回复 优先级', value=config.get("filter", "priority_mapping", "comment"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_copywriting = ui.input(label='文案 优先级', value=config.get("filter", "priority_mapping", "copywriting"), placeholder='数字越大,优先级越高,文案页的文案,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')

with ui.grid(columns=5):
input_filter_priority_mapping_song = ui.input(label='点歌 优先级', value=config.get("filter", "priority_mapping", "song"), placeholder='数字越大,优先级越高,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_read_comment = ui.input(label='念弹幕 优先级', value=config.get("filter", "priority_mapping", "read_comment"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
Expand All @@ -3650,11 +3654,14 @@ def save_config():
input_filter_priority_mapping_integral = ui.input(label='积分 优先级', value=config.get("filter", "priority_mapping", "integral"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_reread_top_priority = ui.input(label='最高优先级复读 优先级', value=config.get("filter", "priority_mapping", "reread_top_priority"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')

with ui.grid(columns=4):
input_filter_priority_mapping_copywriting = ui.input(label='文案 优先级', value=config.get("filter", "priority_mapping", "copywriting"), placeholder='数字越大,优先级越高,文案页的文案,但这个并非文本,所以暂时没啥用,预留').style("width:200px;").tooltip('数字越大,优先级越高')
with ui.grid(columns=5):
input_filter_priority_mapping_abnormal_alarm = ui.input(label='异常报警 优先级', value=config.get("filter", "priority_mapping", "abnormal_alarm"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_trends_copywriting = ui.input(label='动态文案 优先级', value=config.get("filter", "priority_mapping", "trends_copywriting"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_schedule = ui.input(label='定时任务 优先级', value=config.get("filter", "priority_mapping", "schedule"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_assistant_anchor_text = ui.input(label='助播-文本 优先级', value=config.get("filter", "priority_mapping", "assistant_anchor_text"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')
input_filter_priority_mapping_assistant_anchor_audio = ui.input(label='助播-音频 优先级', value=config.get("filter", "priority_mapping", "assistant_anchor_audio"), placeholder='数字越大,优先级越高').style("width:200px;").tooltip('数字越大,优先级越高')


with ui.expansion('弹幕黑名单', icon="settings", value=True).classes('w-full'):
with ui.row():
switch_filter_blacklist_enable = ui.switch('启用', value=config.get("filter", "blacklist", "enable")).style(switch_internal_css)
Expand Down

0 comments on commit 231b8fa

Please sign in to comment.