[gnome-music/wip/jfelder/restore-mpris-3.34: 6/9] mpris: Restore update_song_lists support



commit 46129c26fb5fbb845eaf9196482144aa9e322e9e
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Sep 21 20:59:53 2019 +0200

    mpris: Restore update_song_lists support
    
    This functionality was disabled during the core rewrite.
    
    (cherry picked from commit 69799985b42dee4cedb05359b22cbdb5815809dd)

 gnomemusic/mpris.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 69f47ec4..ae4d35aa 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -300,7 +300,7 @@ class MPRIS(DBusInterface):
         self._playlists_loaded_id = self._coremodel.connect(
             "playlists-loaded", self._on_playlists_loaded)
 
-        self._player_previous_type = None
+        self._player_playlist_type = None
         self._path_list = []
         self._metadata_list = []
         self._previous_can_go_next = False
@@ -427,7 +427,7 @@ class MPRIS(DBusInterface):
 
         index_min = current_position - self._playlist_nb_songs
         index_max = current_position + self._playlist_nb_songs + 1
-        if self._player.get_playlist_type() == PlayerPlaylist.Type.ALBUM:
+        if self._player_playlist_type == PlayerPlaylist.Type.ALBUM:
             index_min = 0
             index_max = self._player_model.get_n_items()
 
@@ -576,6 +576,7 @@ class MPRIS(DBusInterface):
 
     @log
     def _on_player_playlist_changed(self, coremodel, playlist_type):
+        self._player_playlist_type = playlist_type
         self._update_songs_list()
 
         mpris_playlist = self._get_active_playlist()


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