IrosTheBeggar / mStream

The easiest music streaming server available
http://mstream.io
GNU General Public License v3.0
2.21k stars 186 forks source link

API Endpoint to get active Jukebox connections #433

Open 5HT2 opened 2 months ago

5HT2 commented 2 months ago

I'd like to be able to have a couple Caddy / nginx webserver rules to redirect a subdomain on my local network to the most recent Jukebox session that was started.

I understand that not everyone would want a feature like this, I would just like to have a Jukebox always running on my network without having to turn on the "server" (client connected to the server which is being used as a play server for the household) monitor to see the QR code.

An endpoint to get the active Jukebox sessions would solve this for me, as I could implement the rest of what I want on my own webserver without too much trouble.

Unrelated but to add some context, currently I'm saving any /remote/[code] paths as requests and using the most recent one as a redirect location, to achieve this.


A sane default would be to require an admin token to access this API path. In the JSON response it would be nice to be able to see the connection token as well as the start time of the session (maybe as a unix epoch, that would be the easiest way to parse it myself).