From: Fabio Date: Tue, 30 May 2017 17:54:26 +0000 (+0200) Subject: fix sensible flavour of random plugin X-Git-Tag: 0.14.4~3 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=ce55381d1443d05cf9a9952640d507496de255ba;p=mpd-sima.git fix sensible flavour of random plugin --- 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: