Skip to content

Commit

Permalink
fix: 修复首次配置时,默认主题只有一个设备的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Dec 21, 2024
1 parent 5c788cc commit e50db9e
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion xiaomusic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""

Expand Down
4 changes: 2 additions & 2 deletions xiaomusic/static/default/debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<meta name="viewport" content="width=device-width">
<title>Debug For XiaoMusic</title>

<link rel="stylesheet" type="text/css" href="./main.css?version=1734613728">
<link rel="stylesheet" type="text/css" href="./main.css?version=1734794202">
<script src="https://unpkg.com/vconsole@latest/dist/vconsole.min.js"></script>
<script src="./jquery-3.7.1.min.js?version=1734613728"></script>
<script src="./jquery-3.7.1.min.js?version=1734794202"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
Expand Down
4 changes: 2 additions & 2 deletions xiaomusic/static/default/downloadtool.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>歌曲下载工具</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1734613728">
<script src="./jquery-3.7.1.min.js?version=1734613728"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1734794202">
<script src="./jquery-3.7.1.min.js?version=1734794202"></script>

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
Expand Down
6 changes: 3 additions & 3 deletions xiaomusic/static/default/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>小爱音箱操控面板</title>
<link href="https://fonts.googleapis.com/css?family=Material+Icons|Material+Icons+Outlined" rel="stylesheet">
<script src="./jquery-3.7.1.min.js?version=1734613728"></script>
<link rel="stylesheet" href="./main.css?version=1734613728">
<script src="./jquery-3.7.1.min.js?version=1734794202"></script>
<link rel="stylesheet" href="./main.css?version=1734794202">
<link rel="icon" href="./favicon.ico">

<!-- Google tag (gtag.js) -->
Expand Down Expand Up @@ -220,7 +220,7 @@ <h2>更新</h2>
Powered by XiaoMusic
</div>

<script src="./md.js?version=1734613728">
<script src="./md.js?version=1734794202">
</script>
</body>

Expand Down
2 changes: 1 addition & 1 deletion xiaomusic/static/default/m3u.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<link rel="icon" href="/favicon.ico">
<meta name="viewport" content="width=device-width">
<title>M3U to JSON Converter</title>
<link rel="stylesheet" type="text/css" href="./main.css?version=1734613728">
<link rel="stylesheet" type="text/css" href="./main.css?version=1734794202">

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
Expand Down
3 changes: 3 additions & 0 deletions xiaomusic/static/default/md.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions xiaomusic/static/default/setting.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<meta name="viewport" content="width=device-width">
<title>小爱音箱操控面板</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="./jquery-3.7.1.min.js?version=1734613728"></script>
<script src="./setting.js?version=1734613728"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1734613728">
<script src="./jquery-3.7.1.min.js?version=1734794202"></script>
<script src="./setting.js?version=1734794202"></script>
<link rel="stylesheet" type="text/css" href="./main.css?version=1734794202">

<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-Z09NC1K7ZW"></script>
Expand Down
1 change: 1 addition & 0 deletions xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit e50db9e

Please sign in to comment.