Commit 7f67eeed authored by Jean Felder's avatar Jean Felder Committed by Jean Felder

mpris: Do not send the Stopped signal when a song ends

MPRIS specifications are not explicit whether the "Stopped" signal
should be sent at the end of a song. It seems logical not to emit this
signal if the playlist is not finished because a new song is gonna
start. Besides, this is the behavior of all the usual audio players.

This is fixed by returning the "Playing" PlaybackStatus if the player
is in the LOADING (which happens at the end of all songs) or PLAYING

Related: #282
parent 5c8b1649
Pipeline #84859 passed with stages
in 14 minutes and 23 seconds
......@@ -242,12 +242,12 @@ class MediaPlayer2Service(Server):
def _get_playback_status(self):
state = self.player.props.state
if state == Playback.PLAYING:
return 'Playing'
if state == Playback.STOPPED:
return 'Stopped'
elif state == Playback.PAUSED:
return 'Paused'
return 'Stopped'
return 'Playing'
def _get_loop_status(self):
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment