From e50db9ea59b7fde896823f66ca717351bbe6be42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Sat, 21 Dec 2024 23:17:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=97=B6=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=8F=AA=E6=9C=89=E4=B8=80=E4=B8=AA=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/config.py | 2 +- xiaomusic/static/default/debug.html | 4 ++-- xiaomusic/static/default/downloadtool.html | 4 ++-- xiaomusic/static/default/index.html | 6 +++--- xiaomusic/static/default/m3u.html | 2 +- xiaomusic/static/default/md.js | 3 +++ xiaomusic/static/default/setting.html | 6 +++--- xiaomusic/xiaomusic.py | 1 + 8 files changed, 16 insertions(+), 12 deletions(-) diff --git a/xiaomusic/config.py b/xiaomusic/config.py index 07167647d..16ae1ee7b 100644 --- a/xiaomusic/config.py +++ b/xiaomusic/config.py @@ -75,7 +75,7 @@ class Device: device_id: str = "" hardware: str = "" name: str = "" - play_type: int = "" + play_type: int = PLAY_TYPE_RND cur_music: str = "" cur_playlist: str = "" diff --git a/xiaomusic/static/default/debug.html b/xiaomusic/static/default/debug.html index dc6bc5a9f..692d24e13 100644 --- a/xiaomusic/static/default/debug.html +++ b/xiaomusic/static/default/debug.html @@ -6,9 +6,9 @@ Debug For XiaoMusic - + - + diff --git a/xiaomusic/static/default/downloadtool.html b/xiaomusic/static/default/downloadtool.html index f10027129..8ff70b166 100644 --- a/xiaomusic/static/default/downloadtool.html +++ b/xiaomusic/static/default/downloadtool.html @@ -4,8 +4,8 @@ 歌曲下载工具 - - + + diff --git a/xiaomusic/static/default/index.html b/xiaomusic/static/default/index.html index a48b638ed..09fa731e2 100644 --- a/xiaomusic/static/default/index.html +++ b/xiaomusic/static/default/index.html @@ -6,8 +6,8 @@ 小爱音箱操控面板 - - + + @@ -220,7 +220,7 @@

更新

Powered by XiaoMusic - diff --git a/xiaomusic/static/default/m3u.html b/xiaomusic/static/default/m3u.html index 3a7d41e47..7bfdaf1c4 100644 --- a/xiaomusic/static/default/m3u.html +++ b/xiaomusic/static/default/m3u.html @@ -5,7 +5,7 @@ M3U to JSON Converter - + diff --git a/xiaomusic/static/default/md.js b/xiaomusic/static/default/md.js index 18ee8cc46..987b4eab2 100644 --- a/xiaomusic/static/default/md.js +++ b/xiaomusic/static/default/md.js @@ -83,6 +83,9 @@ function nextTrack() { function togglePlayMode(isSend = true) { const modeBtnIcon = $("#modeBtn .material-icons"); + if (playModeIndex == '') { + playModeIndex = 2; + } modeBtnIcon.text(playModes[playModeIndex].icon); $("#modeBtn .tooltip").text(playModes[playModeIndex].cmd); // return; diff --git a/xiaomusic/static/default/setting.html b/xiaomusic/static/default/setting.html index 3cb8ff318..f09458cc1 100644 --- a/xiaomusic/static/default/setting.html +++ b/xiaomusic/static/default/setting.html @@ -5,9 +5,9 @@ 小爱音箱操控面板 - - - + + + diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index a03e85cb8..3bc7042e4 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -253,6 +253,7 @@ async def try_update_device_id(self): device.device_id = device_id device.hardware = hardware device.name = name + device.play_type = PLAY_TYPE_RND devices[did] = device self.config.devices = devices self.log.info(f"选中的设备: {devices}")