Changeset - 1082f0725c32
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 8 months ago 2024-05-28 22:34:03
drewp@bigasterisk.com
fix PlayerState semantics
1 file changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/light9/ascoltami/player.py
Show inline comments
 
@@ -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:
0 comments (0 inline, 0 general)