forked from platypush/platypush
Catching music stop events both on track_playback_ended and playback_state_changed
This commit is contained in:
parent
8a9c868f77
commit
34e2dffe99
1 changed files with 3 additions and 1 deletions
|
@ -133,7 +133,9 @@ class MusicMopidyBackend(Backend):
|
||||||
if not track:
|
if not track:
|
||||||
return
|
return
|
||||||
self.bus.post(MusicPlayEvent(status=status, track=track))
|
self.bus.post(MusicPlayEvent(status=status, track=track))
|
||||||
elif event == 'track_playback_ended':
|
elif event == 'track_playback_ended' or (
|
||||||
|
event == 'playback_state_changed'
|
||||||
|
and msg.get('new_state') == 'stopped'):
|
||||||
status['state'] = 'stop'
|
status['state'] = 'stop'
|
||||||
track = self._parse_track(track)
|
track = self._parse_track(track)
|
||||||
if not track:
|
if not track:
|
||||||
|
|
Loading…
Reference in a new issue