init.py 628 B

123456789101112131415161718192021222324
  1. import mopidy
  2. class Extension(mopidy.ext.Extension):
  3. dist_name = "Mopidy-SmartPlaylists"
  4. ext_name = "smartplaylists"
  5. version = "0.1.0"
  6. def get_default_config(self):
  7. return """
  8. [smartplaylists]
  9. genres = rock,jazz,blues
  10. max_tracks = 50
  11. playlist_prefix = [Smart]
  12. """
  13. def get_config_schema(self):
  14. schema = super().get_config_schema()
  15. # You can add: schema["genres"] = config.String()
  16. return schema
  17. def setup(self, registry):
  18. from .backend import SmartPlaylistsBackend
  19. registry.add("backend", SmartPlaylistsBackend)