[gnome-music/wip/jfelder/mpris-fix-playlisttype] mpris: Prevent a cash from play call with no playlist



commit 8b1e32822502bcfdab71e6f6ea3eedca93b7d6a2
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Sep 5 19:14:48 2018 +0200

    mpris: Prevent a cash from play call with no playlist
    
    When trying to play a song launch from a MPRIS client when no playlist
    is set, the first song from the SongsView is loaded. This results in a
    crash as the PlayerPlaylist.Type is wrong.
    Fix it by using the correct name.

 gnomemusic/mpris.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 252ca90a..2a0d6515 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -467,7 +467,7 @@ class MediaPlayer2Service(Server):
         if self.first_song_handler:
             model.disconnect(self.first_song_handler)
             self.first_song_handler = 0
-        self.player.set_playlist(PlayerPlaylist.Type.SONG, None, model, iter_)
+        self.player.set_playlist(PlayerPlaylist.Type.SONGS, None, model, iter_)
         self.player.play()
 
     @log


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