Reading values from mopidy.conf via mopidy-http

Hi all

I have mopidy up and running and can connect using different http-clients (iris among them) and mpd clients as well. All well and good.

I’m into creating or forking a simple web-frontend utlizing mopidy.js and want to make it configurable. I have some experience with python and older web-stuff like html, css and javascript, but not much with tornado and modern web frameworks like react and angular - just to let you know approximately where I stand.

I want to make the web-frontend configurable (from the server side). You should be able to set pause_enabled=true (or false), skip_enabled=true (or false). False will hide the corresponding buttons in the web-frontend and perhaps configure the stylesheet / theme via the config.

  • What is considered good practice in mopidy-circles for such configuration?
    • Add these to your extension’s part of mopidy.conf?
      • If so, what is the practice of reading these values in your front-end? mopidy.js and the JSON api doesn’t seem to support it, so maybe make a tornado-request handler for it?
    • Add this configuration to some other file-storage?
      • If so, any good examples or best practices on that?

Thank you for the help. Apologies in advance if I missed the answers to these questions somewhere else. Pointers to such answers will be appreciated.

We don’t have any recommendations on this and both approaches exist in the ecosystem. I think Iris mostly uses in-browser key-value storage and then distributes that to all other Iris clients via a customer handler on the server. Musicbox webclient goes the other way and works as per your first method: the interesting settings are inserted using a custom handler and then defined in the HTML for use by the Javascript. We don’t have a Core mechanism to expose Mopidy config but it’s been talked about many times before, often in the context of access via our HTTP/JSON interface. I don’t think I’d bother creating another config system for my frontend.

1 Like

Thank you. Appreciated :+1:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.