suppress more pylast errors (#349)

This commit is contained in:
Adrian Sampson 2012-02-26 17:57:40 -08:00
parent 8fca659392
commit 2d3c9d9f9a
2 changed files with 9 additions and 1 deletions

View file

@ -40,6 +40,12 @@ LASTFM = pylast.LastFMNetwork(api_key=plugins.LASTFM_KEY)
DEFAULT_WHITELIST = os.path.join(os.path.dirname(__file__), 'genres.txt')
C14N_TREE = os.path.join(os.path.dirname(__file__), 'genres-tree.yaml')
PYLAST_EXCEPTIONS = (
pylast.WSError,
pylast.MalformedResponseError,
pylast.NetworkError,
)
def _tags_for(obj):
"""Given a pylast entity (album or track), returns a list of
tag names for that entity. Returns an empty list if the entity is
@ -47,7 +53,7 @@ def _tags_for(obj):
"""
try:
res = obj.get_top_tags()
except pylast.WSError, exc:
except PYLAST_EXCEPTIONS, exc:
log.debug(u'last.fm error: %s' % unicode(exc))
return []

View file

@ -46,6 +46,8 @@ lays the foundation for more features to come in the next couple of releases.
to monitor import progress, even when the import crashes.
* Duplicate track matches are no longer shown when autotagging singletons.
* The ``chroma`` plugin now logs errors when fingerprinting fails.
* The ``lastgenre`` plugin suppresses more errors when dealing with the Last.fm
API.
* Fix a bug in the ``rewrite`` plugin that broke the use of multiple rules for
a single field.
* Fix a crash with non-ASCII characters in bytestring metadata fields (e.g.,