Skip to content

Commit

Permalink
Use provided deduplicate function for keep_allowed
Browse files Browse the repository at this point in the history
generation, instead of a simple set(). This way we keep the original
order of genres.
  • Loading branch information
JOJ0 committed Nov 16, 2023
1 parent bbb8be2 commit 31ce30d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion beetsplug/lastgenre/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ def _get_genre(self, obj):
genres = obj.get("genre", with_album=False).split(separator)
else:
genres = obj.get("genre").split(separator)
keep_allowed = set([g for g in genres if self._is_allowed(g)])
keep_allowed = deduplicate(
[g for g in genres if self._is_allowed(g)]
)
if keep_allowed:
return separator.join(keep_allowed), "keep"

Expand Down

0 comments on commit 31ce30d

Please sign in to comment.