From 47631cfda81dd870c3519523891a004ee4c5eab6 Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Thu, 24 Oct 2024 22:54:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E6=B6=88=E6=81=AF&?= =?UTF-8?q?=E9=9F=B3=E9=A2=91=E9=98=9F=E5=88=97=E4=BC=98=E5=85=88=E7=BA=A7?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=8A=A9=E6=92=AD=E6=96=87=E6=9C=AC?= =?UTF-8?q?=E3=80=81=E9=9F=B3=E9=A2=91=E7=9A=84=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.json | 2 ++ config.json.bak | 2 ++ utils/audio.py | 2 ++ webui.py | 13 ++++++++++--- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/config.json b/config.json index 1da94d3b..2bf61f92 100644 --- a/config.json +++ b/config.json @@ -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 diff --git a/config.json.bak b/config.json.bak index 1da94d3b..2bf61f92 100644 --- a/config.json.bak +++ b/config.json.bak @@ -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 diff --git a/utils/audio.py b/utils/audio.py index 35b20edc..4accf9b1 100644 --- a/utils/audio.py +++ b/utils/audio.py @@ -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}") diff --git a/webui.py b/webui.py index a6932811..7ec9d006 100644 --- a/webui.py +++ b/webui.py @@ -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'), @@ -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('数字越大,优先级越高') @@ -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)