From 67cae2ed4d1b7e068a3e0ba78fb67c50afd0a1c3 Mon Sep 17 00:00:00 2001 From: Stein Magnus Jodal Date: Tue, 24 Aug 2010 03:03:30 +0200 Subject: [PATCH] Issue end_of_track event before we start playing the next track. Fixes 'now playing' on Last.fm for the second track in the playlist. --- mopidy/backends/base/playback.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/mopidy/backends/base/playback.py b/mopidy/backends/base/playback.py index 67a86a28..72b02a25 100644 --- a/mopidy/backends/base/playback.py +++ b/mopidy/backends/base/playback.py @@ -311,6 +311,14 @@ class BasePlaybackController(object): return original_cp_track = self.current_cp_track + + # Notify frontends of the end_of_track event + self.backend.core_queue.put({ + 'to': 'frontend', + 'command': 'end_of_track', + 'track': original_cp_track[1], + }) + if self.cp_track_at_eot: self.play(self.cp_track_at_eot) @@ -323,13 +331,6 @@ class BasePlaybackController(object): if self.consume: self.backend.current_playlist.remove(cpid=original_cp_track[0]) - # Notify frontends of the end_of_track event - self.backend.core_queue.put({ - 'to': 'frontend', - 'command': 'end_of_track', - 'track': original_cp_track[1], - }) - def on_current_playlist_change(self): """ Tell the playback controller that the current playlist has changed.