Volumio2 icon indicating copy to clipboard operation
Volumio2 copied to clipboard

Websocket api pushPlayerState returns "stream" as boolean or string

Open Joni-Salminen opened this issue 3 years ago • 1 comments

Hi!

pushPlayerState seems to return "stream" parameter as boolean in tidal service and string in spotify service, this will cause unnessary work to get the responses parsed to typesafe objects.

what should be the real use case for this parameter?

Joni-Salminen avatar Mar 19 '21 16:03 Joni-Salminen

Here are the relevant JSON responses, which i forgot to add before.

When playing from tidal { "status": "play", ....... "stream": false, <-- Boolean as in True or false ...... "volatile": false } Now when we play from spotify the response is "status": "play", ....... "stream": "spotify", <-- Not so much Boolean here anymore ...... "service": "spop" In my opinion this should be corrected one way or other, since response's like these causes issues for type safe languages, yes you can work around this, but it could be fixed in the backend instead of fixing it in every client application/front end.

Joni-Salminen avatar Jul 31 '21 17:07 Joni-Salminen