From 155d2ff37be9cc519ac62c020932bc639385bca2 Mon Sep 17 00:00:00 2001 From: kaliko Date: Thu, 3 Jun 2021 11:01:06 +0200 Subject: [PATCH] Improved filter_track plugin method --- sima/lib/plugin.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sima/lib/plugin.py b/sima/lib/plugin.py index 1afafe5..db44013 100644 --- a/sima/lib/plugin.py +++ b/sima/lib/plugin.py @@ -23,8 +23,7 @@ Plugin object to derive from import random -from .track import Track -from .meta import Album, Artist, MetaContainer +from .meta import Artist, MetaContainer class Plugin: @@ -226,8 +225,10 @@ class AdvancedPlugin(Plugin): for trk in [_ for _ in not_in_hist if _ not in deny_list]: # Should use albumartist heuristic as well if self.plugin_conf.getboolean('single_album', False): # pylint: disable=no-member + albums = [tr.album for tr in deny_list] + albums += [tr.album for tr in self.to_add] if (trk.album == self.player.current.album or - trk.album in [tr.album for tr in deny_list]): + trk.album in albums): self.log.debug('Found unplayed track ' + 'but from an album already queued: %s', trk) continue -- 2.39.5