From: kaliko Date: Fri, 5 May 2017 13:43:49 +0000 (+0200) Subject: Honors artist blacklisting in Random plugin (Closes #14) X-Git-Tag: 0.14.4~4 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=fb25d53c7216d90d2ccc55d443017715d73246fc;p=mpd-sima.git Honors artist blacklisting in Random plugin (Closes #14) --- diff --git a/doc/Changelog b/doc/Changelog index 974bdb4..9febe7c 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,6 @@ MPD_sima v0.14.4 - * … + * Fixed blacklisting for Random plugin (Closes #14) -- kaliko jack UNRELEASED diff --git a/sima/client.py b/sima/client.py index 236ab10..525f268 100644 --- a/sima/client.py +++ b/sima/client.py @@ -62,7 +62,7 @@ def bl_artist(func): names = list() for art in result.names: if cls.database.get_bl_artist(art, add_not=True): - cls.log.debug('Blacklisted "{0}"'.format(art)) + cls.log.debug('Blacklisted "%s"', art) continue names.append(art) if not names: diff --git a/sima/plugins/internal/random.py b/sima/plugins/internal/random.py index ec17e9a..c678950 100644 --- a/sima/plugins/internal/random.py +++ b/sima/plugins/internal/random.py @@ -82,6 +82,9 @@ class Random(Plugin): played_art = self.get_played_artist() while artists: art = random.choice(artists) + if self.daemon.sdb.get_bl_artist(art, add_not=True): + self.log.debug('Random: Blacklisted "%s"', art) + continue if art not in played_art: break artists.pop(art)