]> kaliko git repositories - mpd-sima.git/blobdiff - sima/lib/plugin.py
Implement "single_album" filter
[mpd-sima.git] / sima / lib / plugin.py
index 999255f956ce0ff6e0c23ab8230a38129aaf7cc6..0e80ae582f865751c8f9b43a39bd5b63d53e311e 100644 (file)
@@ -15,13 +15,17 @@ class Plugin():
     def info(cls):
         """self documenting class method
         """
+        doc = 'Undocumented plugin! Fill "{}" docstring'.format(cls.__name__)
+        if cls.__doc__:
+            doc = cls.__doc__.strip(' \n').splitlines()[0]
         return {'name': cls.__name__,
-                'doc': cls.__doc__.strip(' \n').splitlines()[0]
+                'doc': doc,
                 }
 
     def __init__(self, daemon):
         self.log = daemon.log
         self.__daemon = daemon
+        self.player = daemon.player
         self.plugin_conf = None
         self.__get_config()
 
@@ -34,7 +38,7 @@ class Plugin():
         conf = self.__daemon.config
         for sec in conf.sections():
             if sec.lower() == self.__class__.__name__.lower():
-                self.plugin_conf = dict(conf.items(sec))
+                self.plugin_conf = conf[sec]
         #if self.plugin_conf:
         #    self.log.debug('Got config for {0}: {1}'.format(self,
         #                                                    self.plugin_conf))
@@ -70,6 +74,12 @@ class Plugin():
         """
         pass
 
+    def callback_need_track_fb(self):
+        """Called when callback_next_song failled to find tracks to queue
+        Returns a list of Track objects to add
+        """
+        pass
+
     def shutdown(self):
         pass