Can anyone show me an example of API CoreListener?

That code knows that the track is changed because that method is only called by Mopidy when a track starts playback. For that call from Mopidy to your extension to happen, you must:

  1. make a frontend extension,
  2. with an actor class, and
  3. that actor class must subclass mopidy.core.CoreListener.

For step 1, please read https://docs.mopidy.com/en/latest/extensiondev/ in general.

For step 2 and 3, please read https://docs.mopidy.com/en/latest/extensiondev/#example-frontend for a specific example.

The Mopidy-Scrobbler extension also works as an example of all of this.

1 Like