]> kaliko git repositories - mpd-sima.git/commitdiff
Honors artist blacklisting in Random plugin (Closes #14)
authorkaliko <kaliko@azylum.org>
Fri, 5 May 2017 13:43:49 +0000 (15:43 +0200)
committerkaliko <kaliko@azylum.org>
Fri, 5 May 2017 13:43:49 +0000 (15:43 +0200)
doc/Changelog
sima/client.py
sima/plugins/internal/random.py

index 974bdb46ca367af2f0d72cb5176f5ae385d49263..9febe7c4462f8386e56ab8cc0566b425e3e0acac 100644 (file)
@@ -1,6 +1,6 @@
 MPD_sima v0.14.4
 
- * 
+ * Fixed blacklisting for Random plugin (Closes #14)
 
 -- kaliko jack <kaliko@azylum.org> UNRELEASED
 
index 236ab10cbec3f1138448cf7c7e813659a735b4e9..525f268d0c5b5c02ee067388145d1fe357a496d8 100644 (file)
@@ -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:
index ec17e9a679a0d8a0c3a60a0f092c89029cde0b21..c6789502b28edccb9cca0b23a09739d90a17c0d2 100644 (file)
@@ -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)