新增刷新列表指令

This commit is contained in:
涵曦 2024-06-12 17:21:09 +00:00
parent a704f8003c
commit e5dea8e693
3 changed files with 7 additions and 2 deletions

View File

@ -44,6 +44,7 @@ KEY_WORD_DICT = {
"停止播放": "stop",
"分钟后关机": "stop_after_minute",
"播放列表": "play_music_list",
"刷新列表": "gen_music_list",
"set_volume#": "set_volume",
"get_volume#": "get_volume",
}
@ -66,6 +67,7 @@ KEY_MATCH_ORDER = [
"随机播放",
"关机",
"停止播放",
"刷新列表",
"播放列表",
]

View File

@ -3,6 +3,7 @@ $(function(){
append_op_button_name("全部循环");
append_op_button_name("单曲循环");
append_op_button_name("随机播放");
append_op_button_name("刷新列表");
append_op_button_name("下一首");
append_op_button_name("关机");
@ -94,7 +95,9 @@ $(function(){
contentType: "application/json",
data: JSON.stringify({cmd: cmd}),
success: () => {
// 请求成功时执行的操作
if (cmd == "刷新列表") {
location.reload();
}
},
error: () => {
// 请求失败时执行的操作

View File

@ -580,7 +580,7 @@ class XiaoMusic:
random.shuffle(self._play_list)
await self.do_tts(f"已经设置为随机播放")
# 生成播放列表
# 刷新列表
async def gen_music_list(self, **kwargs):
self._gen_all_music_list()
await self.do_tts(f"生成播放列表完毕")