diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index be21dff50..8fd3a7463 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -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 [] diff --git a/docs/changelog.rst b/docs/changelog.rst index f6e6917d5..5263c0d85 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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.,