__init__.py 675 B

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