[gnome-music/wip/jfelder/mpris-limit-get-songs: 6/13] player: Correctly check if player playlist is set
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/mpris-limit-get-songs: 6/13] player: Correctly check if player playlist is set
- Date: Mon, 29 Oct 2018 07:45:59 +0000 (UTC)
commit ebf11f71234067397bd77904a20d3cfd22f10bde
Author: Jean Felder <jfelder src gnome org>
Date: Tue Oct 23 16:46:16 2018 +0200
player: Correctly check if player playlist is set
PlayerPlaylist can never be None as it is instanced at init time. The
correct way to check if the player has a playlist is to test if
current_song is None.
gnomemusic/player.py | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 6e81b8a2..8418f877 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -597,7 +597,7 @@ class Player(GObject.GObject):
@log
def play(self, song_index=None):
"""Play"""
- if not self._playlist:
+ if self.props.current_song is None:
return
if (song_index is not None
@@ -779,8 +779,6 @@ class Player(GObject.GObject):
:returns: the song being played. None if there is no playlist.
:rtype: Grl.Media
"""
- if not self._playlist:
- return None
return self._playlist.props.current_song
@log
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]