From 971584b4b23978502d7b174a799fb8177e68e020 Mon Sep 17 00:00:00 2001 From: wordofglass Date: Mon, 13 Nov 2017 01:54:39 +0100 Subject: [PATCH] Improve readability of plugins.sanitize_choices --- beets/plugins.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/beets/plugins.py b/beets/plugins.py index 4a2475f50..1dc1f6496 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -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