From 4a29c7a124cef86d9163a5e1c5de3c47107535e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Wed, 12 Jun 2024 01:18:08 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20#70=20=E4=B8=8B=E4=B8=80=E9=A6=96?= =?UTF-8?q?=E6=AD=8C=E6=9B=B2=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6=E4=BB=8E?= =?UTF-8?q?=E6=92=AD=E6=94=BE=E5=88=97=E8=A1=A8=E4=B8=AD=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=B9=B6=E7=BB=A7=E7=BB=AD=E6=89=BE=E4=B8=8B=E4=B8=80=E9=A6=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/xiaomusic.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index af0c537f2..d0b04792a 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -388,8 +388,12 @@ def get_next_music(self): next_index = index + 1 if next_index >= play_list_len: next_index = 0 - filename = self._play_list[next_index] - return filename + name = self._play_list[next_index] + filename = self.get_filename(name) + if len(filename) <= 0: + self._play_list.pop(next_index) + return self.get_next_music() + return name # 获取文件播放时长 def get_file_duration(self, filename):