X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fplugins%2Finternal%2Fechonest.py;h=a5c1ede7bad1bc5ff60b7cde988b0b92c8786878;hb=279a3160534cad04c64c0d0b17f437c08ebb2703;hp=b2971db4cbe1eb578ef95d31416cbcc7b338f3e9;hpb=774f4b39de0b2ad7aa0e6ed3d7cc739a5456e8c5;p=mpd-sima.git diff --git a/sima/plugins/internal/echonest.py b/sima/plugins/internal/echonest.py index b2971db..a5c1ede 100644 --- a/sima/plugins/internal/echonest.py +++ b/sima/plugins/internal/echonest.py @@ -13,7 +13,7 @@ from hashlib import md5 # local import from ...lib.plugin import Plugin -from ...lib.simaecho import SimaEch, EchoError, EchoNotFound +from ...lib.simaecho import SimaEch, EchoError from ...lib.track import Track from ...lib.meta import Artist @@ -182,13 +182,10 @@ class EchoNest(Plugin): try: # TODO: let's propagate Artist type [as_art.append(str(art)) for art in as_artists] - except EchoNotFound as err: - self.log.warning(err) except EchoError as err: self.log.warning('EchoNest: {0}'.format(err)) if as_art: - self.log.debug('Fetched {0} artist(s) from echonest'.format( - len(as_art))) + self.log.debug('Fetched {0} artist(s)'.format(len(as_art))) self.log.debug('x-ratelimit-remaining: {}'.format(SimaEch.ratelimit)) return as_art @@ -336,7 +333,11 @@ class EchoNest(Plugin): def callback_need_track(self): self._cleanup_cache() if not self.player.current: - self.log.info('Not currently playing track, cannot queue') + self.log.info('No current track, cannot queue') + return None + if not self.player.current.artist: + self.log.warning('No artist set for the current track') + self.log.debug(repr(self.player.current)) return None self.queue_mode() candidates = self.to_add