Skip to content

Commit

Permalink
fix: #81 修复播放列表时,当前歌曲不在列表没有更换歌曲的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Jul 7, 2024
1 parent 5b8054a commit 350d821
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion xiaomusic/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ def convert_value(cls, k, v, type_hints):
converted_value = True
else:
converted_value = expected_type(v)
print(converted_value)
return converted_value
except (ValueError, TypeError) as e:
print(f"Error converting {k}:{v} to {expected_type}: {e}")
Expand Down
6 changes: 5 additions & 1 deletion xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ def match_cmd(self, query, ctrl_panel):

# 判断是否播放下一首歌曲
def check_play_next(self):
# 当前歌曲不在当前播放列表
if self.cur_music not in self._play_list:
return True

# 当前没我在播放的歌曲
if self.cur_music == "":
return True
Expand Down Expand Up @@ -838,7 +842,7 @@ async def play(self, **kwargs):

# 下一首
async def play_next(self, **kwargs):
self.log.info("下一首")
self.log.info("开始播放下一首")
name = self.cur_music
self.log.debug("play_next. name:%s, cur_music:%s", name, self.cur_music)
if (
Expand Down

0 comments on commit 350d821

Please sign in to comment.