From 32035af5a7a64af1476965b21a25c0276fee8899 Mon Sep 17 00:00:00 2001 From: Kim Wittenburg <5wittenb@informatik.uni-hamburg.de> Date: Mon, 3 Sep 2018 22:25:54 +0200 Subject: [PATCH] Move configuration check to plugin initalization --- beetsplug/cleantags.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/beetsplug/cleantags.py b/beetsplug/cleantags.py index d027978..0a42b05 100644 --- a/beetsplug/cleantags.py +++ b/beetsplug/cleantags.py @@ -11,6 +11,8 @@ class CleanTagsPlugin(BeetsPlugin): 'keep': [], # Tags to write to files. 'discard': [] # Tags to discard }) + if self.keep_tags and self.discard_tags: + raise ConfigValueError('Cannot specify both "keep" and "discard" for cleantags plugin.') self.register_listener('write', self.clear_metadata) @property @@ -26,8 +28,6 @@ class CleanTagsPlugin(BeetsPlugin): return self.config['discard'].as_str_seq() def clear_metadata(self, item, path, tags): - if self.keep_tags and self.discard_tags: - raise ConfigValueError('Cannot specify both "keep" and "discard" for cleantags plugin.') if self.clean: file = File(path) file.delete()