From 34e2dffe993dbf5ffa967a24c0fde9489fecb057 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Wed, 13 Feb 2019 00:58:40 +0100 Subject: [PATCH] Catching music stop events both on track_playback_ended and playback_state_changed --- platypush/backend/music/mopidy.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/platypush/backend/music/mopidy.py b/platypush/backend/music/mopidy.py index 252e8933..cb4de90e 100644 --- a/platypush/backend/music/mopidy.py +++ b/platypush/backend/music/mopidy.py @@ -133,7 +133,9 @@ class MusicMopidyBackend(Backend): if not track: return 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' track = self._parse_track(track) if not track: