Re: [In Development] RESTful API for LMS
Michael Herger <slim-b/[email protected]>
| Newsgroups | gmane.music.equipment.slimdevices.devel |
|---|---|
| Message-ID | <[email protected]> |
> A couple of weeks ago I wanted to do a small integration project with > LMS and had a look at the CLI. Although it is obviously excellent with > deep integration into LMS and a big part of its success, it is not > really designed for a casual integration. What feature set would you have required? I would agree that it can clearly be overwhelming. > I think there is room for LMS to have a RESTful API in addition to the > CLI/JSONRPC, REST API's have a lot going for them : Trust me: I thought of doing this myself before! :-) I mostly never tried it because it was more of a nerd's urge rather than an actual need to do it. > I've started implementing the REST API as a plugin to get the routing in > place and the basic pattern. You can see my progress on github here : > -https://github.com/expectingtofly/LMS_REST_API_Plugin What I'd recommend is that you translate as much as possible into CLI commands. Eg. there's no need to re-implement the player status response, which certainly then would be different from what users might have expected or see in different applications. Better use the built-in "status" query to make sure you get the same raw data, then transform this into whatever you think should be the response. And instead of restapi I'd probably just use the api path. It's not taken yet, is it?... > I plan to plod my way through all this and see how far it can go. > Obviously, there is absolutely no point in doing this if nobody is ever > going to use the API. You picked a great starting point IMHO. I could imagine quite a few use cases to have easy access the player status. Maybe have some playback control. Would I would put rather far down the list is full data browsing. This is so complicated with the various browse modes, all vs. primary artists only, compilations etc. it might be hard to make this return the expected results without adding support for the same set of query parameters. > All feedback welcome, even if it is to tell me "you are wasting your > time, we already have the CLI/JSON, nobody will ever use it!" It'll certainly take more time than you'd think - in particular once people start using it :-). I'm probably not a prime candidate, but I certainly hope to find some time to play with this. I love well structured REST APIs!