mirror of
https://github.com/beetbox/beets.git
synced 2026-02-27 01:32:30 +01:00
Improve readability of plugins.sanitize_choices
This commit is contained in:
parent
2c1e4d878b
commit
971584b4b2
1 changed files with 6 additions and 3 deletions
|
|
@ -502,9 +502,12 @@ def sanitize_choices(choices, choices_all):
|
|||
others = [x for x in choices_all if x not in choices]
|
||||
res = []
|
||||
for s in choices:
|
||||
if s in list(choices_all) + ['*']:
|
||||
if not (s in seen or seen.add(s)):
|
||||
res.extend(list(others) if s == '*' else [s])
|
||||
if s not in seen:
|
||||
if s in list(choices_all):
|
||||
res.append(s)
|
||||
elif s == '*':
|
||||
res.extend(others)
|
||||
seen.add(s)
|
||||
return res
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue