In a running mopidy service, I would like to keep a history list (in memory or perhaps file) of received streamTitles.
My idea is to create a minimal backend extension that listens for streamTitleChanged events.
The backend could then perhaps send a custom event/message to my frontEnd with the latest n titles, after each new received title.
Is what I’m trying to do possible?
Can I register both a backEnd and a frontEnd in one package or is that a bad idea?
After reviewing code here and there, I’m a bit lost. Can I get some pointers?
For context - I’m new to extension development. Altering a cloned MusicBox is my only experience. I’m currently having the frontend website (browser) HTTP POST back received titles to the frontEnd extension, but that’s of course a bit of a hack.
A bit of guidence in the right direction would be much appreciated. Thanks.
You can listen for streamTitleChanged events directly in your frontend. Simply implement a stream_title_changed function in your frontend, similar to what Mopidy-Scrobbler does for the two track playback events it’s listening to.