From ce55381d1443d05cf9a9952640d507496de255ba Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 30 May 2017 19:54:26 +0200 Subject: [PATCH] fix sensible flavour of random plugin --- sima/plugins/internal/random.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sima/plugins/internal/random.py b/sima/plugins/internal/random.py index c678950..88f959f 100644 --- a/sima/plugins/internal/random.py +++ b/sima/plugins/internal/random.py @@ -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: -- 2.39.5