1
0
mirror of https://github.com/hanxi/xiaomusic.git synced 2026-03-27 10:09:45 +08:00

修复问题

This commit is contained in:
涵曦
2026-01-13 11:53:09 +08:00
parent e563ba6111
commit ce1521ba59
2 changed files with 8 additions and 1 deletions

View File

@@ -96,7 +96,7 @@ async def playtts(did: str, text: str, Verifcation=Depends(verification)):
@router.post("/device/stop")
async def do_cmd(data: Did, Verifcation=Depends(verification)):
async def stop(data: Did, Verifcation=Depends(verification)):
"""关机"""
did = data.did
log.info(f"stop did:{did}")

View File

@@ -684,6 +684,13 @@ class MusicLibrary:
f"{self.hostname}:{self.public_port}/picture/{encoded_name}",
)
if self.is_web_music(name):
try:
duration = await self.get_music_duration(name)
if duration > 0:
tags["duration"] = duration
except Exception as e:
self.log.exception(f"获取网络音乐 {name} 时长失败: {e}")
return tags
def set_music_tag(self, name, info):