X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fwebserv.py;h=c05b86d971a2b2a870532b54121f23a2b0ad8c3c;hb=41048503e9b3cf0fdc58e14f35f483889a0b05ae;hp=36b364ff5abd742ea5b619baa7ac6f85752cceca;hpb=4f3916a06726459104bfa97fe85e4bbf5b48b9ed;p=mpd-sima.git diff --git a/sima/lib/webserv.py b/sima/lib/webserv.py index 36b364f..c05b86d 100644 --- a/sima/lib/webserv.py +++ b/sima/lib/webserv.py @@ -226,6 +226,7 @@ class WebService(Plugin): return [] tolookfor = self.player.playlist[-1].Artist self.log.info('Looking for artist similar to "{}"'.format(tolookfor)) + self.log.debug(repr(tolookfor)) similar = self.ws_similar_artists(tolookfor) if not similar: self.log.info('Got nothing from {0}!'.format(self.ws.name)) @@ -244,13 +245,13 @@ class WebService(Plugin): self.log.warning('Got nothing from music library.') self.log.warning('Try running in debug mode to guess why...') return [] - queued_artists = { trk.Artist for trk in self.player.queue } - for art in queued_artists: - if art in ret: - self.log.debug('Removing already queued artist: {0}'.format(art)) - ret = ret - queued_artists + # WARNING: + # * operation on set will not match against aliases + # * composite set w/ mbid set and whitout won't match either + queued_artists = {trk.Artist for trk in self.player.queue} if ret & queued_artists: - self.log.debug('Removing already queued artist: {0}'.format(ret & queued_artists)) + self.log.debug('Removing already queued artists: ' + '{0}'.format(ret & queued_artists)) ret = ret - queued_artists if self.player.current and self.player.current.Artist in ret: self.log.debug('Removing current artist: {0}'.format(self.player.current.Artist))