[gnome-music/wip/merge: 169/343] player: correct params for randint



commit 66f0aa7bd357fb01575cfb75a9da3e54908cb795
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Jul 16 17:25:54 2013 +0200

    player: correct params for randint

 gnomemusic/player.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 48501f7..0f2837b 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -155,7 +155,7 @@ class Player(GObject.GObject):
         elif self.repeat == RepeatType.SHUFFLE:
             nextTrack = self.playlist.get_iter_first()
             rows = self.playlist.iter_n_children(None)
-            random = randint(rows)
+            random = randint(1, rows)
             for i in random:
                 self.playlist.iter_next(nextTrack)
 
@@ -186,7 +186,7 @@ class Player(GObject.GObject):
         elif self.repeat == RepeatType.SHUFFLE:
             previousTrack = self.playlist.get_iter_first()[1]
             rows = self.playlist.iter_n_children(None)
-            random = randint(0, rows)
+            random = randint(1, rows)
             for i in random:
                 self.playlist.iter_next(previousTrack)
 


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