gonic icon indicating copy to clipboard operation
gonic copied to clipboard

Api call 'jukeboxControl(get)' fails if an internet radio is played.

Open DatGizmo opened this issue 9 months ago • 3 comments

gonic version: v0.16.4

if from docker, docker tag: sentriz/gonic:latest (Container ID: 9bf9c92bf470)

Steps to reproduce. Add a internet radio to the jukebox playlist jukeboxContorl action='set' id='ir-1' Call get to get the current status + playlist jukeboxControl action='get'

The request fails with (http log from docker):

gonic  | 2025/03/24 21:04:26 response  200  POST /jukeboxControl
gonic  | 2025/03/24 21:04:26 subsonic error code 10: error getting spec playlist: "https://lyd.nrk.no/icecast/mp3/high/s0w7hwn47m/p1": not a track
gonic  | 2025/03/24 21:04:26 response  200  POST /jukeboxControl

DatGizmo avatar Mar 24 '25 21:03 DatGizmo

Just FYI, the Subsonic and OpenSubsonic API spec doesn't support playing internet radio stations via jukeboxControl. It's a non-standard feature that Gonic and some clients support. There isn't a way to fit a non-song into the schema for the get response, so it would probably make most sense for Gonic to filter out internet radio stations from the jukebox queue when returning the response to the client. Or proposing an OpenSubsonic API extension to formalize support for enqueuing internet radio stations with jukeboxControl.

dweymouth avatar Mar 30 '25 15:03 dweymouth

Wasn't aware that this is not officially supported.

I'm currently in the process of creating a home assistant integration for subsonic. I'm working on replacing mpd with gonic. And I'm using mpd to play internet radio. Here mpd reports a radio station more or less like a normal song. Showing 'Title - Artist' if a song is playing. But this is probably depended on the station if they adjust the data.

Ignoring the fact of official supported. Would it be possible to create a queue entry? I know that mpv is used to play the actual stream so getting the 'Title - Artist' info would mean reading it from there, but I would be happy I it would be possible to create an entry which has the stream-url + IR-id.

Id be happy to try doing it myself, but I'm bit lost in which area to look :(

DatGizmo avatar Mar 31 '25 07:03 DatGizmo

The problem with returning internet radios in the jukeboxControl get response is that IDs are completely opaque, and there is no way for a client to know whether an ID is a radio ID or a song ID. As such, clients would assume that every entry in the jukebox queue is a song, and would try to treat the queue entry as a song.

dweymouth avatar Apr 05 '25 16:04 dweymouth

@dweymouth the subsonic trackchild has a "type" field that has values like "music" / "podcastepisode"

sentriz avatar Sep 18 '25 14:09 sentriz