From 399bfb985eec01891ee7397c3307dd6f248b90fb Mon Sep 17 00:00:00 2001 From: "nath@dp7510" Date: Wed, 15 Aug 2018 13:56:39 +0200 Subject: [PATCH] fetchart: fix itunes debug info Some typos + make it more useful overall --- beetsplug/fetchart.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index f4d7ff3f8..cb62059cd 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -479,11 +479,13 @@ class ITunesStore(RemoteArtSource): self._log.debug(u'Could not decode json response: {0}', e) return except KeyError as e: - self._log.debug(u'No results lists in response: {0}', e) + self._log.debug(u'{} not found in json. Fields are {} ', + e, + list(r.json().keys())) return if not candidates: - self._log.debug(u'iTunes search for {:r} got no results', + self._log.debug(u'iTunes search for {!r} got no results', payload['term']) return @@ -496,7 +498,9 @@ class ITunesStore(RemoteArtSource): yield self._candidate(url=art_url, match=Candidate.MATCH_EXACT) except KeyError as e: - self._log.debug(u'Malformed itunes candidate {0}', e) + self._log.debug(u'Malformed itunes candidate: {} not found in {}', # NOQA E501 + e, + list(c.keys())) try: fallback_art_url = candidates[0]['artworkUrl100'] @@ -504,7 +508,9 @@ class ITunesStore(RemoteArtSource): yield self._candidate(url=fallback_art_url, match=Candidate.MATCH_FALLBACK) except KeyError as e: - self._log.debug(u'Malformed itunes candidate {0}', e) + self._log.debug(u'Malformed itunes candidate: {} not found in {}', + e, + list(c.keys())) class Wikipedia(RemoteArtSource):