mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-28 10:33:59 +00:00
Ignore 404 errors for release group json
We currently have no easy mean to know if there is cover art for the release group as we do for the release. Not a perfect solution, ideas and patches are welcome. We should not query the json file at all if we know there is no cover art for this release group.
This commit is contained in:
@@ -42,6 +42,9 @@ class CoverArtProviderCaa(CoverArtProvider):
|
||||
|
||||
NAME = "Cover Art Archive"
|
||||
|
||||
ignore_json_not_found_error = False
|
||||
|
||||
|
||||
def __init__(self, coverart):
|
||||
CoverArtProvider.__init__(self, coverart)
|
||||
self.caa_types = map(unicode.lower, config.setting["caa_image_types"])
|
||||
@@ -125,7 +128,8 @@ class CoverArtProviderCaa(CoverArtProvider):
|
||||
"""Parse CAA JSON file and queue CAA cover art images for download"""
|
||||
self.album._requests -= 1
|
||||
if error:
|
||||
self.error(u'CAA JSON error: %s' % (unicode(http.errorString())))
|
||||
if not (error == 203 and self.ignore_json_not_found_error):
|
||||
self.error(u'CAA JSON error: %s' % (unicode(http.errorString())))
|
||||
else:
|
||||
try:
|
||||
caa_data = json.loads(data)
|
||||
|
||||
@@ -31,6 +31,9 @@ class CoverArtProviderCaaReleaseGroup(CoverArtProviderCaa):
|
||||
|
||||
NAME = "CaaReleaseGroup"
|
||||
|
||||
ignore_json_not_found_error = True
|
||||
|
||||
|
||||
def enabled(self):
|
||||
if not config.setting['ca_provider_use_caa']:
|
||||
log.debug("Cover art from Cover Art Archive disabled by user")
|
||||
|
||||
Reference in New Issue
Block a user