# get them reorg to pick up best element
ret_extra = self.get_reorg_artists_list(ret_extra)
# tries to pickup less artist from extra art
- if len(ret) < 4:
- ret_extra = MetaContainer(ret_extra)
- else:
+ if len(ret) > 4:
ret_extra = MetaContainer(ret_extra[:max(4, len(ret))//2])
if ret_extra:
self.log.debug('extra found in library: %s',
# Move around similars items to get in unplayed|not recently played
# artist first.
self.log.info('Got %d artists in library', len(ret))
- candidates = self.get_reorg_artists_list(list(ret))
+ candidates = self.get_reorg_artists_list(ret)
if candidates:
self.log.info(' / '.join(map(str, candidates)))
return candidates
nb_album_add = 0
target_album_to_add = self.plugin_conf.getint('album_to_add')
for artist in artists:
- album = self.album_candidate(artist)
+ album = self.album_candidate(artist, unplayed=True)
+ if not album:
+ continue
nb_album_add += 1
candidates = self.player.find_tracks(album)
if self.plugin_conf.getboolean('shuffle_album'):
for artist in artists:
self.log.debug('Trying to find titles to add for "%r"', artist)
found = self.player.find_tracks(artist)
- random.shuffle(found)
if not found:
self.log.debug('Found nothing to queue for %s', artist)
continue
+ random.shuffle(found)
# find tracks not in history for artist
track_candidate = self.filter_track(found)
if track_candidate:
self.log.debug('Found no tracks to queue!')
return
for track in self.to_add:
- self.log.info('%s candidates: %s', track, self.ws.name)
+ self.log.info('%s plugin chose: %s', self.ws.name, track)
def _album(self):
"""Get albums for album queue mode
msg = ' '.join(['{0}: {1:>3d}'.format(k, v) for
k, v in sorted(self.ws.stats.items())])
self.log.debug('http stats: ' + msg)
+ if not self.to_add:
+ self.log.info('%s plugin found nothing to queue', self.ws.name)
candidates = self.to_add
self.to_add = list()
if self.plugin_conf.get('queue_mode') != 'album':