lastgenre: fix crash with canonicalization

This commit is contained in:
Adrian Sampson 2013-04-10 10:34:06 -07:00
parent 8ae202cf24
commit 16e0648c81
2 changed files with 5 additions and 3 deletions

View file

@ -299,9 +299,10 @@ class LastGenrePlugin(plugins.BeetsPlugin):
return result, 'artist'
# Filter the existing genre.
result = _strings_to_genre([obj.genre])
if result:
return result, 'original'
if obj.genre:
result = _strings_to_genre([obj.genre])
if result:
return result, 'original'
# Fallback string.
fallback = self.config['fallback'].get()

View file

@ -19,6 +19,7 @@ Changelog
* :doc:`/plugins/web`: The underlying API was expanded slightly to support
`Tomahawk`_ collections. And file transfers now have a "Content-Length"
header. Thanks to Uwe L. Korn.
* :doc:`/plugins/lastgenre`: Fix an error when using genre canonicalization.
.. _Tomahawk: http://www.tomahawk-player.org/