feat:触屏版显示界面的歌曲id支持配置

This commit is contained in:
涵曦 2024-07-03 13:48:23 +00:00
parent 0414830539
commit e84ee5de1e
2 changed files with 4 additions and 2 deletions

View File

@ -81,6 +81,8 @@ class Config:
use_music_api: bool = (
os.getenv("XIAOMUSIC_USE_MUSIC_API", "false").lower() == "true"
)
use_music_audio_id: str = os.getenv("XIAOMUSIC_USE_MUSIC_AUDIO_ID", "1582971365183456177")
use_music_id: str = os.getenv("XIAOMUSIC_USE_MUSIC_ID", "355454500")
log_file: str = os.getenv("XIAOMUSIC_MUSIC_LOG_FILE", "/tmp/xiaomusic.txt")
# 模糊搜索匹配的最低相似度阈值
fuzzy_match_cutoff: float = float(os.getenv("XIAOMUSIC_FUZZY_MATCH_CUTOFF", "0.6"))

View File

@ -1039,8 +1039,8 @@ class XiaoMusic:
if _type == 1:
# If set to MUSIC, the light will be on
audio_type = "MUSIC"
audio_id = "1582971365183456177"
id = "355454500"
audio_id = self.config.use_music_audio_id
id = self.config.use_music_id
music = {
"payload": {
"audio_type": audio_type,