diff --git a/src/light9/ascoltami/player.py b/src/light9/ascoltami/player.py --- a/src/light9/ascoltami/player.py +++ b/src/light9/ascoltami/player.py @@ -65,13 +65,15 @@ class Player: log.info("autostop") self.pause() + eos = t >= self.duration() - .1 #todo + playing = self.isPlaying() and not eos ps = PlayerState( song=self._getSongFileUri(), duration=round(self.duration(), 2), - wallStartTime=round(now - t, 2) if self.isPlaying() else None, - playing=self.isPlaying(), - pausedSongTime=None if self.isPlaying() else t, - endOfSong=t >= self.duration() - .1, #todo + wallStartTime=round(now - t, 2) if playing else None, + playing=playing, + pausedSongTime=None if playing else t, + endOfSong=eos, ) if self.playerState != ps: