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



commit 11220c5057487b1d10429281a00ba913497f615e
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
    (cherry picked from commit 6dee1373bbf6aaf8300e20ee149a76b909dc3e91)

 gnomemusic/mpris.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index b4d59c80..59f7493b 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]