Mopidy plugin, change configuration at runtime

Hello everyone,

I need to update mopidy’s configuration at runtime (mopidy spotify client_id and token_id).
Is it possible to change a parameter before adding a new music ?

Thank’s in advanced :slightly_smiling_face:

Best regards

No that is not possible.

Ok thank’s.
Can you say me if an object instance was created for any music added?
Or call the same any time?

Sorry, I don’t understand your question.

Are you asking if there is an event triggered when you add a song to the tracklist? If so, then yes: https://docs.mopidy.com/en/latest/api/core/#mopidy.core.CoreListener.tracklist_changed

Sorry, i explain me with this pseudo code :

A spotify object created when music added :

Def add_music (music)
If music = spotify:
MySpotifyObject = Spotify ()
MySpotifyObject.add (music)

Or like this :

Class mopidy ():
init(self):
MySpotifyObject = Spotify ()

Def add_music (self, music):
    If spotify:
        MySpotifyObject.add (music)

Do you understand my question now?

If you are trying to write client code in python to control mopidy then perhaps this project and the example will help: https://github.com/ismailof/mopidy-json-client/blob/master/examples/now_playing.py

Thx, but it’s not what i was trying.
With spotify plugin, for example, when a spotify music is added, what is the called function on the backend side?

  • The frontend tells mopidy core to add a specific URI to the tracklist
  • The core asks the associated backend (in this case Mopidy-Spotify) to do a lookup to get the full track info
  • The full track is added as a tracklist track (tl_track)

But note that lookup may be called at other times too.

I suggest you read the code and the API documentation yourself if you want further information.

Thank you for your response :slight_smile: