"""
name = self.__class__.__name__
if isinstance(self._cache, dict):
"""
name = self.__class__.__name__
if isinstance(self._cache, dict):
candidate = []
for trk in [_ for _ in not_in_hist if _ not in black_list]:
# Should use albumartist heuristic as well
candidate = []
for trk in [_ for _ in not_in_hist if _ not in black_list]:
# Should use albumartist heuristic as well
if (trk.album == self.player.current.album or
trk.album in [tr.album for tr in black_list]):
self.log.debug('Found unplayed track ' +
if (trk.album == self.player.current.album or
trk.album in [tr.album for tr in black_list]):
self.log.debug('Found unplayed track ' +
if artist.mbid:
self.log.debug('Trying without MusicBrainzID')
try:
return self.ws_similar_artists(Artist(name=artist.name))
except WSNotFound as err:
if artist.mbid:
self.log.debug('Trying without MusicBrainzID')
try:
return self.ws_similar_artists(Artist(name=artist.name))
except WSNotFound as err:
self.log.debug('EXTRA ARTS: %s', '/'.join(map(str, extra_arts)))
for artist in extra_arts:
self.log.debug('Looking for artist similar '
self.log.debug('EXTRA ARTS: %s', '/'.join(map(str, extra_arts)))
for artist in extra_arts:
self.log.debug('Looking for artist similar '
ret = ret - MetaContainer([current.Artist])
# Move around similars items to get in unplayed|not recently played
# artist first.
ret = ret - MetaContainer([current.Artist])
# Move around similars items to get in unplayed|not recently played
# artist first.
candidates = self._get_artists_list_reorg(list(ret))
if candidates:
self.log.info(' / '.join(map(str, candidates)))
candidates = self._get_artists_list_reorg(list(ret))
if candidates:
self.log.info(' / '.join(map(str, candidates)))
def _get_album_history(self, artist):
"""Retrieve album history"""
def _get_album_history(self, artist):
"""Retrieve album history"""
- for trk in self.sdb.get_history(artist=artist.name, duration=duration):
- albums_list.add(trk[1])
+ for trk in self.get_history(artist=artist.name):
+ if not trk.album:
+ continue
+ albums_list.add(trk.album)
nbtracks_target = self.plugin_conf.getint('track_to_add') # pylint: disable=no-member
for artist in artists:
if len(self.to_add) == nbtracks_target:
nbtracks_target = self.plugin_conf.getint('track_to_add') # pylint: disable=no-member
for artist in artists:
if len(self.to_add) == nbtracks_target:
titles = deque()
try:
titles = [t for t in self.ws.get_toptrack(artist)]
except WSError as err:
self.log.warning('%s: %s', self.ws.name, err)
titles = deque()
try:
titles = [t for t in self.ws.get_toptrack(artist)]
except WSError as err:
self.log.warning('%s: %s', self.ws.name, err)