]> kaliko git repositories - mpd-sima.git/commitdiff
fix sensible flavour of random plugin
authorFabio <fabio@dynamix-tontechnik.ch>
Tue, 30 May 2017 17:54:26 +0000 (19:54 +0200)
committerFabio <fabio@dynamix-tontechnik.ch>
Tue, 30 May 2017 17:54:26 +0000 (19:54 +0200)
sima/plugins/internal/random.py

index c6789502b28edccb9cca0b23a09739d90a17c0d2..88f959fb6c9ee6da3a37292668c1d790e219bc80 100644 (file)
@@ -55,7 +55,7 @@ class Random(Plugin):
         duration = self.daemon.config.getint('sima', 'history_duration')
         tracks_from_db = self.daemon.sdb.get_history(duration=duration)
         # Construct Track() objects list from database history
-        artists = [tr[-1] for tr in tracks_from_db]
+        artists = [tr[0] for tr in tracks_from_db]
         return set(artists)
 
     def callback_need_track(self):
@@ -87,7 +87,7 @@ class Random(Plugin):
                     continue
                 if art not in played_art:
                     break
-                artists.pop(art)
+                artists.remove(art)
         elif self.mode == 'pure':
             art = random.choice(artists)
         if art is None: