- target = self.plugin_conf.getint('track_to_add')
- tracks = self.player.find(self.mpd_filter)
- random.shuffle(tracks)
- history = self._get_history()
- while tracks:
- trk = tracks.pop()
- if trk in self.player.queue or \
- trk in candidates:
- self.log.debug('%s already queued', trk)
- continue
- if trk in history:
- self.log.debug('%s in history', trk)
+ queue_mode = self.plugin_conf.get('queue_mode', 'track')
+ target = self.plugin_conf.getint(f'{queue_mode}_to_add')
+ # look for artists acording to filter
+ artists = MetaContainer([Artist(name=a) for a in self.player.list('artist', self.mpd_filter)])
+ if not artists:
+ self.log.info('Tags plugin found nothing to queue')
+ return candidates
+ artists = self.get_reorg_artists_list(artists)
+ self.log.debug('Tags plugin found: %s', ' / '.join(map(str, artists)))
+ for artist in artists:
+ self.log.debug('looking for %s', artist)
+ tracks = self.player.find_tracks(artist)
+ trk = self.filter_track(tracks)
+ if not trk: