[gnome-music] player: No next/previous track if there is no playlist
- From: Arnel A. Borja <arnelborja src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music] player: No next/previous track if there is no playlist
- Date: Mon, 16 Sep 2013 14:09:55 +0000 (UTC)
commit 37e7e12f7cdb8b3d34ef24e5d131404ed823ff77
Author: Arnel A. Borja <arnelborja src gnome org>
Date: Sat Sep 14 21:42:14 2013 +0800
player: No next/previous track if there is no playlist
Fixes Play on MPRIS when there is no playlist.
https://bugzilla.gnome.org/show_bug.cgi?id=708103
gnomemusic/player.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index ffa8917..2d9ea24 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -265,7 +265,7 @@ class Player(GObject.GObject):
return None
def has_next(self):
- if self.playlist.iter_n_children(None) < 1:
+ if not self.playlist or self.playlist.iter_n_children(None) < 1:
return False
elif not self.currentTrack:
return False
@@ -278,7 +278,7 @@ class Player(GObject.GObject):
return True
def has_previous(self):
- if self.playlist.iter_n_children(None) < 1:
+ if not self.playlist or self.playlist.iter_n_children(None) < 1:
return False
elif not self.currentTrack:
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]