Skip to content

Commit

Permalink
fix: 修复播放接口报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Dec 4, 2024
1 parent 042a913 commit be48fe9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,15 +1720,16 @@ async def play_one_url(self, device_id, url, name):
ret = None
try:
audio_id = await self._get_audio_id(name)
hardware = self.get_hardward(device_id)
if self.config.continue_play:
ret = await self.xiaomusic.mina_service.play_by_music_url(
device_id, url, _type=1, audio_id=audio_id
)
self.log.info(
f"play_one_url continue_play device_id:{device_id} ret:{ret} url:{url} audio_id:{audio_id}"
)
elif self.config.use_music_api or (hardware in NEED_USE_PLAY_MUSIC_API):
elif self.config.use_music_api or (
self.hardware in NEED_USE_PLAY_MUSIC_API
):
ret = await self.xiaomusic.mina_service.play_by_music_url(
device_id, url, audio_id=audio_id
)
Expand Down

0 comments on commit be48fe9

Please sign in to comment.