]> kaliko git repositories - mpd-sima.git/commitdiff
Honors "single_album" options on already queued tracks
authorkaliko <kaliko@azylum.org>
Sun, 15 Nov 2015 22:36:36 +0000 (23:36 +0100)
committerkaliko <kaliko@azylum.org>
Sun, 15 Nov 2015 22:36:36 +0000 (23:36 +0100)
sima/lib/webserv.py

index 0845924916f48f1316eea5946974182b033dd67b..c3ecfd62a25abf60fef934f26a8d1c127903a7d9 100644 (file)
@@ -115,14 +115,14 @@ class WebService(Plugin):
         black_list = self.player.queue + self.to_add
         not_in_hist = list(set(tracks) - set(self.get_history(artist=artist)))
         if self.plugin_conf.get('queue_mode') != 'top' and not not_in_hist:
-            self.log.debug('All tracks already played for "{}"'.format(artist))
+            self.log.debug('All tracks already played for "%s"', artist)
         random.shuffle(not_in_hist)
         candidate = []
         for trk in [_ for _ in not_in_hist if _ not in black_list]:
             # Should use albumartist heuristic as well
             if self.plugin_conf.getboolean('single_album'): # pylint: disable=no-member
                 if (trk.album == self.player.current.album or
-                        trk.album in [tr.album for tr in self.to_add]):
+                        trk.album in [tr.album for tr in black_list]):
                     self.log.debug('Found unplayed track ' +
                                    'but from an album already queued: %s', trk)
                     continue