New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
play:Sub Music Streamer - test connection failure #14
Comments
hi in the logs for the thanks! ( sorry I can't test better without an iPhone) |
Hi The Which is normal according to the API documentation(http://www.subsonic.org/pages/api.jsp#ping) this endpoint does not take parameters. Authentication should not be implemented for this endpoint. What do you think about that? |
hmm that is strange. for both DSub (Android) and jamstash (web), so it makes sense that gonic is giving you a 400 for ping.view since play:Sub isn't giving the parameters. I can add a fix to gonic, something like and that might be okay for all of dsub, jamstash, play:Sub. but I need to find out how airsonic etc does it edit: |
Note that this works with another project in Go https://github.com/hednowley/sound |
interesting, but I think that may be wrong.
so maybe a bug with play:Sub? |
This is intentional use of ping.view from play:Sub... Calling ping.view without the u/p parameters allows play:Sub to learn the server API version and possibly variant without revealing the password. When calling ping.view without u/p parameters, play:Sub expects a HTTP 200 response with a Subsonic-error in the response data. As stated above, this reveals server API version, and several servers send a "type" = "my-server-type" as part of the response. |
Thank you for your answer @MichaelBechHansen. The bug encountered can now be explained. |
Ahh I see @michael thank you. basically I think it means gonic could return a 200 instead of 400 when no arguments are passed to the view and the rest should work |
@sentriz I also expect returning 200 OK would make everything work. |
By testing locally by making the modifications so that the |
I think the next step would be to debug this with the app against a running server... |
hi all. I just pushed to docker hub image EDIT: it's still building |
Got it! So there was more to it than the 400 vs 200 error code...
It seems gonic does not pick up the request parameters from the HTTP-body, and therefore does not pick up the "f=json" in the http body. |
interesting @MichaelBechHansen I always presumed query parameters were they way to do subsonic parameters, not body - but not sure where I got that thought. why does play:Sub choose body instead of query? if Airsonic supports both play:Sub and DSub, where play:Sub does body params, and DSub does query params - does Airsonic support both? should gonic support both? I can't find anything here about body vs query |
The first many versions of play:Sub used URL-parameters and GET, but when running into length limitations on the URL, I switched to POST and parameters in the body. The URL length limitation is only a problem for a few Subsonic APIs, in particular when creating/editing large playlists, the parameters contain a list of track-ids which can be pretty long. All the Subsonic server variants play:Sub has been running against is supporting parameters in both URL and body. https://stackoverflow.com/a/26717908 has some details on the parameters in body for POST. EDIT: Sidenote, all servers also seems to support POST with parameters in the URL... Subsonic supports having parameters in both URL and body, and combines them all. |
ok cool, thank you Michael. currently thinking of a nice abstraction my handlers can have for post/query parameters |
@sentriz did you got time to make this work? |
hi @sbhal I've about two weeks of free time, so working on gonic now |
branch created for this here https://github.com/sentriz/gonic/tree/param_refactor just need to check I haven't broken anything now. and might get one of my friends with an iPhone to test play:Sub with it |
If you have a public docker image, I can test play:Sub against it if you want. |
that's great @MichaelBechHansen thank you. also could you give an example of a cURL with params in the body, the same way play:Sub does it? some options might be
|
This should be a curl command line simulating what play:Sub sends for a ping:
All parameters in the body, in the same format it would have been in the URL query-string. |
ok thank you. could you try |
Success: play:Sub can ping and login against the latest docker image. |
Update: With a correctly configured path to the music folder, things look pretty good:
👍 Well done. I'll poke a bit around to see what works and what doesn't. |
great to hear :) thanks for bearing with me. please let me know what you find |
So I got around to testing a bit more...
Partial implementation:
The above probably just represents what you already know, and where you are in the project. I have tried to list the unimplemented views in the order of importance from my subjective point of view. A number of these rely on last.fm data (similar/top songs), and some rely on metadata tags (genre), but some are more "low hanging fruit" (getrandomsongs) One thing in play:Sub that does not work with gonic 0.5.1 is folder browsing: the actual folders are browsable but no songs appear. I will see if I can figure out why over the weekend... most likely it's related to what I have lumped under "partial implementation" above. |
cool thanks for this. some good info here. // begin common
rout.Handle("/getLicense{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetLicence))
rout.Handle("/getMusicFolders{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetMusicFolders))
rout.Handle("/getScanStatus{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetScanStatus))
rout.Handle("/ping{_:(?:\\.view)?}", ctrl.H(ctrl.ServePing))
rout.Handle("/scrobble{_:(?:\\.view)?}", ctrl.H(ctrl.ServeScrobble))
rout.Handle("/startScan{_:(?:\\.view)?}", ctrl.H(ctrl.ServeStartScan))
rout.Handle("/getUser{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetUser))
rout.Handle("/getPlaylists{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetPlaylists))
rout.Handle("/getPlaylist{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetPlaylist))
rout.Handle("/createPlaylist{_:(?:\\.view)?}", ctrl.H(ctrl.ServeUpdatePlaylist))
rout.Handle("/updatePlaylist{_:(?:\\.view)?}", ctrl.H(ctrl.ServeUpdatePlaylist))
rout.Handle("/deletePlaylist{_:(?:\\.view)?}", ctrl.H(ctrl.ServeDeletePlaylist))
// begin raw
rout.Handle("/download{_:(?:\\.view)?}", ctrl.HR(ctrl.ServeStream))
rout.Handle("/getCoverArt{_:(?:\\.view)?}", ctrl.HR(ctrl.ServeGetCoverArt))
rout.Handle("/stream{_:(?:\\.view)?}", ctrl.HR(ctrl.ServeStream))
// begin browse by tag
rout.Handle("/getAlbum{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetAlbum))
rout.Handle("/getAlbumList2{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetAlbumListTwo))
rout.Handle("/getArtist{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetArtist))
rout.Handle("/getArtists{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetArtists))
rout.Handle("/search3{_:(?:\\.view)?}", ctrl.H(ctrl.ServeSearchThree))
// begin browse by folder
rout.Handle("/getIndexes{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetIndexes))
rout.Handle("/getMusicDirectory{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetMusicDirectory))
rout.Handle("/getAlbumList{_:(?:\\.view)?}", ctrl.H(ctrl.ServeGetAlbumList))
rout.Handle("/search2{_:(?:\\.view)?}", ctrl.H(ctrl.ServeSearchTwo)) here are the views that are currently implemented. so i was suprised to see and one more thing. which metadata is missing for example thanks! and probably a well done for |
getAlbum.view for a random album with gonic:
getAlbum.view for a random album with Subsonic 6.1.4:
|
Also: I think the examples are often partial on the Subsonic API site. |
I don't know if it has anything to do with the partial data reported on getAlbum.view, but it seem my gonic 0.5.1 docker only has around 60% of the tracks it should have. It does not seem to run out of resources: |
possibly related is #26 i will discuss it there |
closing now as the original problem is fixed. again thank you for the help and info folks. |
The play:Sub Music Streamer (https://apps.apple.com/fr/app/play-sub-music-streamer/id955329386) failed to connect to Gonic server (eg. https://gonic.example.com) with correct login credentials.
The docker logs command shows:
Thank you for your work!
The text was updated successfully, but these errors were encountered: