X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Flib%2Fwebserv.py;h=cff9d6708ca46836383021b38f9a361617d8d288;hb=c2c435f2d5a6e13d610f91d16764a62ae6cb315a;hp=7609da765b5f7f820007590ef2b249ecb1df1662;hpb=70bf86ca3f65a550436cdc70326cb8601f24e5a6;p=mpd-sima.git diff --git a/sima/lib/webserv.py b/sima/lib/webserv.py index 7609da7..cff9d67 100644 --- a/sima/lib/webserv.py +++ b/sima/lib/webserv.py @@ -245,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)) @@ -333,7 +333,7 @@ class WebService(Plugin): if self.ws.ratelimit: self.log.info('{0.name} ratelimit: {0.ratelimit}'.format(self.ws)) for trk in titles: - found = self.player.fuzzy_find_track(artist.name, trk.title) + found = self.player.fuzzy_find_track(artist, trk.title) random.shuffle(found) if found: self.log.debug('{0}'.format(found[0]))