__init__.py 680 B

123456789101112131415161718192021222324
  1. from mopidy import config, ext
  2. __version__ = pkg_resources.get_distribution("Mopidy-SmartPlaylists").version
  3. class Extension(ext.Extension):
  4. dist_name = "Mopidy-SmartPlaylists"
  5. ext_name = "smartplaylists"
  6. version = __version__
  7. def get_default_config(self):
  8. return config.read(pathlib.Path(__file__).parent / "ext.conf")
  9. def get_config_schema(self):
  10. schema = super().get_config_schema()
  11. schema["genres"] = config.String()
  12. schema["max_tracks"] = config.Integer()
  13. return schema
  14. def setup(self, registry):
  15. from .backend import SmartPlaylistsBackend
  16. registry.add("backend", SmartPlaylistsBackend)