]> kaliko git repositories - mpd-sima.git/blobdiff - sima/plugins/internal/tags.py
Fixed wrong use of musicpd for tagtypes command (Closes #60)
[mpd-sima.git] / sima / plugins / internal / tags.py
index 5e5d08ce08108f07f524cf9310dfe626420b7742..82abf7fa47aada7f7addc449739a8e388618c93d 100644 (file)
@@ -1,5 +1,5 @@
 # -*- coding: utf-8 -*-
-# Copyright (c) 2020 kaliko <kaliko@azylum.org>
+# Copyright (c) 2020, 2021 kaliko <kaliko@azylum.org>
 #
 #  This file is part of sima
 #
@@ -44,12 +44,10 @@ def control_config(tags_config):
         log.warning('Found no config for Tags plugin! '
                     'Need at least "filter" or a supported tag')
         log.info('Supported Tags are : %s', ', '.join(sup_tags))
-        # raise PluginException('plugin misconfiguration')
         return False
     if config_tags.difference(sup_tags):
         log.error('Found unsupported tag in config: %s',
                   config_tags.difference(sup_tags))
-        # raise PluginException('plugin misconfiguration')
         return False
     return True
 
@@ -117,9 +115,9 @@ class Tags(AdvancedPlugin):
             if self.plugin_conf['filter']:
                 # Use window to limit response size
                 self.player.find(self.plugin_conf['filter'], "window", (0, 1))
-        except CommandError:
+        except CommandError as err:
             raise PluginException('Badly formated filter in tags plugin configuration: "%s"'
-                                  % self.plugin_conf['filter'])
+                                  % self.plugin_conf['filter']) from err
 
     def callback_need_track(self):
         candidates = []
@@ -143,7 +141,7 @@ class Tags(AdvancedPlugin):
             if not trk:
                 continue
             if queue_mode == 'track':
-                self.log.info('Tags plugin chose: {}'.format(trk))
+                self.log.info('Tags plugin chose: %s', trk)
                 candidates.append(trk)
                 if len(candidates) == target:
                     break