- candidates = [_ for _ in not_in_hist if _ not in deny_list]
- # 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'): # pylint: disable=no-member
- # if (trk.album == self.player.current.album or
- # 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
- # candidates.append(trk)
+ candidates = []
+ 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 chosen]
+ if (trk.Album == self.player.current.Album or
+ trk.Album in albums):
+ self.log.debug('Found unplayed track ' +
+ 'but from an album already queued: %s', trk)
+ continue
+ candidates.append(trk)