X-Git-Url: https://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fplugins%2Finternal%2Fechonest.py;h=4cd2f1d69b41171feaa728dfc7d469431133d6a3;hb=cdb998d12265ec4e1f64c87cff22a8657e2a93ea;hp=d5a5122d8c2c7a12d709fc8e5ac68a3b1a856a2c;hpb=4240fefd9d393365932ff04c063cb31fc5dce85c;p=mpd-sima.git diff --git a/sima/plugins/internal/echonest.py b/sima/plugins/internal/echonest.py index d5a5122..4cd2f1d 100644 --- a/sima/plugins/internal/echonest.py +++ b/sima/plugins/internal/echonest.py @@ -180,6 +180,7 @@ class EchoNest(Plugin): as_artists = simaech.get_similar(artist=current) self.log.debug('Requesting EchoNest for "{0}"'.format(current)) 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) @@ -293,7 +294,7 @@ class EchoNest(Plugin): if not album_to_queue: self.log.info('No album found for "%s"' % artist) continue - self.log.info('last.fm album candidate: {0} - {1}'.format( + self.log.info('echonest album candidates: {0} - {1}'.format( artist, album_to_queue)) nb_album_add += 1 self.to_add.extend(self.player.find_album(artist, album_to_queue)) @@ -335,7 +336,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