diff --git a/beetsplug/lastgenre/__init__.py b/beetsplug/lastgenre/__init__.py index ea0537988..2d502e076 100644 --- a/beetsplug/lastgenre/__init__.py +++ b/beetsplug/lastgenre/__init__.py @@ -25,6 +25,8 @@ import pylast import os import yaml +from unidecode import unidecode + from beets import plugins from beets import ui from beets.util import normpath, plurality @@ -133,6 +135,7 @@ class LastGenrePlugin(plugins.BeetsPlugin): 'force': True, 'auto': True, 'separator': u', ', + 'asciify': False, }) self.setup() @@ -244,6 +247,9 @@ class LastGenrePlugin(plugins.BeetsPlugin): if any(not s for s in args): return None + if self.config['asciify']: + args = [unidecode(arg) for arg in args] + key = u'{0}.{1}'.format(entity, u'-'.join(unicode(a) for a in args)) if key in self._genre_cache: return self._genre_cache[key] diff --git a/docs/plugins/lastgenre.rst b/docs/plugins/lastgenre.rst index 9d3242467..d874a4a72 100644 --- a/docs/plugins/lastgenre.rst +++ b/docs/plugins/lastgenre.rst @@ -108,6 +108,9 @@ configuration file. The available options are: - **whitelist**: The filename of a custom genre list, ``yes`` to use the internal whitelist, or ``no`` to consider all genres valid. Default: ``yes``. +- **asciify**: Convert all non-ASCII characters to ASCII equivalents + when performing lookups. + Default: ``no``. Running Manually ----------------