mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 01:53:31 +01:00
Merge pull request #618 from brilnius/fix615
lastgenre plugin: separator in genre lists can now be configured
This commit is contained in:
commit
e1878b34e7
3 changed files with 12 additions and 3 deletions
|
|
@ -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']:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue