Merge pull request #618 from brilnius/fix615

lastgenre plugin: separator in genre lists can now be configured
This commit is contained in:
brilnius 2014-03-19 22:22:41 +01:00
commit e1878b34e7
3 changed files with 12 additions and 3 deletions

View file

@ -114,7 +114,9 @@ def _strings_to_genre(tags):
tags = out
tags = [t.title() for t in tags]
return u', '.join(tags[:config['lastgenre']['count'].get(int)])
return config['lastgenre']['separator'].get(unicode).join(
tags[:config['lastgenre']['count'].get(int)]
)
def fetch_genre(lastfm_obj):
"""Return the genre for a pylast entity or None if no suitable genre
@ -217,6 +219,7 @@ class LastGenrePlugin(plugins.BeetsPlugin):
'source': 'album',
'force': True,
'auto': True,
'separator': u', ',
})
if self.config['auto']:

View file

@ -27,6 +27,8 @@ New stuff:
better proportion to other metrics. Also, options were added to specify
custom thresholds and output formats. Thanks to Adam M.
* Added the :ref:`after_write <plugin_events>` plugin event.
* :doc:`/plugins/lastgenre`: Separator in genre lists can now be
configured. Thanks to brilnius.
Fixes:

View file

@ -92,8 +92,12 @@ of the ``count`` config option::
lastgenre:
count: 3
Comma-separated lists of up to *count* genres will then be used instead of
single genres.
Lists of up to *count* genres will then be used instead of single genres. The
genres are separated by commas by default, but you can change this with the
``separator`` config option::
lastgenre:
separator: ' / '
`Last.fm`_ provides a popularity factor, a.k.a. *weight*, for each tag ranging
from 100 for the most popular tag down to 0 for the least popular.