fetchart: fix itunes debug info

Some typos + make it more useful overall
This commit is contained in:
nath@dp7510 2018-08-15 13:56:39 +02:00
parent 0107262ed3
commit 399bfb985e

View file

@ -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):