Skip to content

Commit

Permalink
fix: #70 下一首歌曲不存在时从播放列表中删除并继续找下一首
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Jun 12, 2024
1 parent 0e1e412 commit 4a29c7a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4a29c7a

Please sign in to comment.