[gnome-music/wip/jfelder/mpris-handle-tracklist-changes: 2/3] mpris: Emit TrackListReplaced signal when tracklist size changes



commit b7b7bd18b2e033f58763c9b8f515a830ed8157f5
Author: Jean Felder <jfelder src gnome org>
Date:   Sun Nov 3 19:37:02 2019 +0100

    mpris: Emit TrackListReplaced signal when tracklist size changes
    
    Following the previous commit, the MPRIS tracklist is no longer
    static: it is now updated when the player playlist changes.
    This means that its size can also change. In that case, the
    TrackListReplaced signal needs to be emitted to notify that the
    tracklist has been replaced.
    
    closes: #336

 gnomemusic/mpris.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 1d33bd46..7ac4cbfe 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -462,7 +462,8 @@ class MPRIS(DBusInterface):
         # current song has changed
         if (not previous_path_list
                 or previous_path_list[0] != self._path_list[0]
-                or previous_path_list[-1] != self._path_list[-1]):
+                or previous_path_list[-1] != self._path_list[-1]
+                or len(previous_path_list) != len(self._path_list)):
             current_song_path = self._get_song_dbus_path()
             self._track_list_replaced(self._path_list, current_song_path)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]