Skip to content

Commit

Permalink
fix: #135 修复获取不到播放时长时只播放3秒的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Jul 29, 2024
1 parent 2443444 commit e2261b2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ async def _playmusic(self, name):
self.log.info(f"【{name}】已经开始播放了")

# 设置下一首歌曲的播放定时器
if sec <= 1:
self.log.info(f"【{name}】不会设置下一首歌的定时器")
return
sec = sec + self.config.delay_sec
await self.set_next_music_timeout(sec)

Expand Down Expand Up @@ -1134,9 +1137,6 @@ async def play_one_url(self, device_id, url):

# 设置下一首歌曲的播放定时器
async def set_next_music_timeout(self, sec):
if sec <= 0:
return

if self._next_timer:
self._next_timer.cancel()
self.log.info("旧定时器已取消")
Expand Down

0 comments on commit e2261b2

Please sign in to comment.