From be48fe9f54082b7a05e18e26b765173605b059d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Wed, 4 Dec 2024 10:17:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/xiaomusic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index 48f46febb7..892ce1ff6d 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -1720,7 +1720,6 @@ 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 @@ -1728,7 +1727,9 @@ async def play_one_url(self, device_id, url, name): 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 )