[gnome-music/wip/jfelder/mpris-limit-get-songs: 14/14] player: Rename get_songs_method to get_mpris_playlist



commit 72d3c52be32a62706087bd6cb69da5e20a0d1c2a
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Dec 12 10:25:37 2018 +0100

    player: Rename get_songs_method to get_mpris_playlist
    
    The only consumer of this method is mpris. So it allows to avoid any confusion.

 gnomemusic/mpris.py  | 2 +-
 gnomemusic/player.py | 8 +++++---
 2 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 06c8ce77..f94f5558 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -361,7 +361,7 @@ class MediaPlayer2Service(Server):
         previous_path_list = self._path_list
         self._path_list = []
         self._metadata_list = []
-        for song in self.player.get_songs():
+        for song in self.player.get_mpris_playlist():
             path = self._get_song_dbus_path(song)
             metadata = self._get_metadata(song)
             self._path_list.append(path)
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 10bdaabe..7e72bcc9 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -490,11 +490,12 @@ class PlayerPlaylist(GObject.GObject):
         return self._type
 
     @log
-    def get_songs(self):
+    def get_mpris_playlist(self):
         """Get recent and next songs from the current playlist.
 
         If the playlist is an album, return all songs.
         Returned songs are sorted according to the repeat mode.
+        This method is used by mpris to expose a TrackList.
 
         :returns: current playlist
         :rtype: list of Grl.Media
@@ -892,13 +893,14 @@ class Player(GObject.GObject):
         self.emit('volume-changed')
 
     @log
-    def get_songs(self):
+    def get_mpris_playlist(self):
         """Get recent and next songs from the current playlist.
 
         If the playlist is an album, return all songs.
         Returned songs are sorted according to the repeat mode.
+        This method is used by mpris to expose a TrackList.
 
         :returns: current playlist
         :rtype: list of Grl.Media
         """
-        return self._playlist.get_songs()
+        return self._playlist.get_mpris_playlist()


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