From 3dd9e4622ffa56934777d5225f8f81d9cf501844 Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Tue, 11 Feb 2014 09:49:15 -0800 Subject: [PATCH] lastgenre: tolerate `el.weight is None` --- beetsplug/lastgenre/__init__.py | 2 +- docs/changelog.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index 34c5153ea..8c38eac31 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -72,7 +72,7 @@ def _tags_for(obj): dbg = [] for el in res: - weight = int(el.weight) + weight = int(el.weight or 0) tag = el.item.get_name().lower() if _is_allowed(tag): if min_weight > -1 and min_weight > weight and len(tags) > 0: diff --git a/docs/changelog.rst b/docs/changelog.rst index c25812530..79d60f968 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -81,6 +81,8 @@ Other little fixes: local image files are no longer completely ignored. * :doc:`/plugins/echonest`: Fix an issue causing the plugin to appear twice in the output of the ``beet version`` command. +* :doc:`/plugins/lastgenre`: Fix an occasional crash when no tag weight was + returned by Last.fm. 1.3.2 (December 22, 2013)