1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2026-05-16 10:56:46 +08:00

Auto-format code 🧹🌟🤖

This commit is contained in:
Formatter [BOT]
2026-05-09 14:30:21 +00:00
parent 6f8f0cb133
commit a8bca8fc59
2 changed files with 11 additions and 3 deletions

View File

@@ -143,7 +143,9 @@ class Config:
os.getenv("XIAOMUSIC_ENABLE_FUZZY_MATCH", "true").lower() == "true"
)
# 模糊搜索返回的最大结果数量(用于多结果选择功能)
fuzzy_match_max_results: int = int(os.getenv("XIAOMUSIC_FUZZY_MATCH_MAX_RESULTS", "100"))
fuzzy_match_max_results: int = int(
os.getenv("XIAOMUSIC_FUZZY_MATCH_MAX_RESULTS", "100")
)
stop_tts_msg: str = os.getenv("XIAOMUSIC_STOP_TTS_MSG", "收到,再见")
enable_config_example: bool = False

View File

@@ -272,7 +272,9 @@ class XiaoMusicDevice:
if len(names) > 1:
self._pending_selection = names
self._pending_selection_count = len(names)
selection_text = f"共找到{len(names)}条匹配记录,请重新呼叫小爱同学并告诉她第几个"
selection_text = (
f"共找到{len(names)}条匹配记录,请重新呼叫小爱同学并告诉她第几个"
)
self.log.info(selection_text)
await self.xiaomusic.do_tts(self.did, selection_text)
return
@@ -1068,7 +1070,11 @@ class XiaoMusicDevice:
Args:
index: 用户选择的序号从1开始
"""
if not self._pending_selection or index < 1 or index > len(self._pending_selection):
if (
not self._pending_selection
or index < 1
or index > len(self._pending_selection)
):
await self.xiaomusic.do_tts(self.did, "选择无效")
return