mirror of
https://github.com/beetbox/beets.git
synced 2026-01-04 15:03:22 +01:00
parent
59da6c851d
commit
bc35015251
2 changed files with 11 additions and 8 deletions
|
|
@ -41,6 +41,13 @@ PYLAST_EXCEPTIONS = (
|
|||
)
|
||||
|
||||
|
||||
def deduplicate(seq):
|
||||
"""Remove duplicates from sequence wile preserving order.
|
||||
"""
|
||||
seen = set()
|
||||
return [x for x in seq if x not in seen and not seen.add(x)]
|
||||
|
||||
|
||||
# Core genre identification routine.
|
||||
|
||||
def _tags_for(obj, min_weight=None):
|
||||
|
|
@ -198,13 +205,7 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
|||
break
|
||||
tags = tags_all
|
||||
|
||||
def remove_duplicates(seq):
|
||||
"""Remove duplicates from sequence wile preserving order"""
|
||||
seen = set()
|
||||
seen_add = seen.add
|
||||
return [x for x in seq if x not in seen and not seen_add(x)]
|
||||
|
||||
tags = remove_duplicates(tags)
|
||||
tags = deduplicate(tags)
|
||||
|
||||
# c14n only adds allowed genres but we may have had forbidden genres in
|
||||
# the original tags list
|
||||
|
|
|
|||
|
|
@ -50,7 +50,9 @@ Little improvements and fixes:
|
|||
* :doc:`/plugins/fetchart`: When loading art from the filesystem, we now
|
||||
prioritize covers with more keywords in them. This means that
|
||||
``cover-front.jpg`` will now be taken before ``cover-back.jpg`` because it
|
||||
contains two keywords rather than one.
|
||||
contains two keywords rather than one. Thanks to Fabrice Laporte.
|
||||
* :doc:`/plugins/lastgenre`: Remove duplicates from canonicalized genre lists.
|
||||
Thanks again to Fabrice Laporte.
|
||||
|
||||
|
||||
1.3.6 (May 10, 2014)
|
||||
|
|
|
|||
Loading…
Reference in a new issue