Permalink
Browse files

covers: allow to pass a reason to the error callback

  • Loading branch information...
1 parent 2b1a7b2 commit e2eda2ef900e67dddfaa9e11b93baff7a23633c0 @multani committed Jan 4, 2013
Showing with 2 additions and 2 deletions.
  1. +1 −1 sonata/artwork.py
  2. +1 −1 sonata/plugins/covers_lastfm.py
View
2 sonata/artwork.py
@@ -708,6 +708,6 @@ def on_save_callback(self, content_fp):
# dialog...
return self.progress_cb(path, self.current-1)
- def on_err_cb(self):
+ def on_err_cb(self, reason=None):
"""Return True to stop finding, False to continue finding covers."""
return False
View
2 sonata/plugins/covers_lastfm.py
@@ -62,7 +62,7 @@ def on_cover_fetch(artist, album, on_save_cb, on_err_cb):
response = opener.open(url)
except urllib.error.URLError as e:
logger.warning("Can't download %r: %s", url, e)
- if on_err_cb():
+ if on_err_cb("Can't download %r: %s" % (url, e)):
break
else:
continue

0 comments on commit e2eda2e

Please sign in to comment.