Home of the Squeezebox™ & Transporter® network music players.
Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 25
  1. #11
    I welcome this effort! Been using the (now archived) LMSTools python module, which sometimes simply stops working. Very frustrating, so have been trying to use jsonrpc.js directly, which, for a retired guy with MANY years of RESTful coding in my working years, is just... odd. Standards are a good thing.

    Now if someone would just port LMS from the dying Perl to Python, lol.
    piTouchô w/JustBoom DigiHat -> RME ADI-2 DAC FS -> JBL 305P MkII monitors; LMS 8.2 on piCorePlayer/Pi 4; Material Skin.

  2. #12
    Senior Member
    Join Date
    Aug 2014
    Location
    UK
    Posts
    532
    I've now updated the specification so that all those operations that haven't been implemented yet (which is almost all of them, apart from the four mentioned above!) now are specified as returning the HTTP response 405 "Not Implemented" . I'll update them as the implementations are merged.

    The latest spec for browsing is available here : https://expectingtofly.github.io/LMS_REST_API_Plugin/
    For info, the actual openAPI yaml that contains the specification is in the github project here : https://github.com/expectingtofly/LM...S_REST_API.yml

    Next on this, I'm going to work on completing the "/api/players" route implementation.

    I'm not expecting anyone else as daft as me to want to get involved in this development, but if you do, pull requests are more than welcome, both in the form of specification change proposals to the openAPI yaml or picking a route to develop, or indeed improving the pattern/framework I've put in place.

  3. #13
    jvromans@squirrel.nl
    Guest

    [In Development] RESTful API for LMS

    On Wed, 15 Sep 2021 14:11:55 +0000, chicks
    <chicks.a80ttz (AT) no-mx (DOT) forums.slimdevices.com> wrote:

    > Now if someone would just port LMS from the dying Perl to Python, lol.


    With a steady pace of two major releases per year, the latest barely 3
    months old, I'd not really call this 'dying'.

    -- Johan

  4. #14
    Quote Originally Posted by jvromans@squirrel.nl View Post
    On Wed, 15 Sep 2021 14:11:55 +0000, chicks
    <chicks.a80ttz (AT) no-mx (DOT) forums.slimdevices.com> wrote:

    > Now if someone would just port LMS from the dying Perl to Python, lol.


    With a steady pace of two major releases per year, the latest barely 3
    months old, I'd not really call this 'dying'.

    -- Johan
    At MegaCorp, we used Perl extensively back in the '90s, but so much of the code the Perl developers produced was so obfuscated as to be un-maintainable when they moved on. So, it was pretty much banned in favor of Python well before I retired a couple years back. Python is on the verge of becoming the #1 language, supplanting C, Java or JavaScript, depending on which index you look at. Perl, not so much.
    piTouchô w/JustBoom DigiHat -> RME ADI-2 DAC FS -> JBL 305P MkII monitors; LMS 8.2 on piCorePlayer/Pi 4; Material Skin.

  5. #15
    jvromans@squirrel.nl
    Guest

    [In Development] RESTful API for LMS

    On Thu, 16 Sep 2021 14:42:50 +0000, chicks
    <chicks.a82pzb (AT) no-mx (DOT) forums.slimdevices.com> wrote:

    > ... depending on which index you look at.


    Exactly.

  6. #16
    Senior Member erland's Avatar
    Join Date
    Dec 2005
    Location
    Sweden
    Posts
    11,302
    Quote Originally Posted by expectingtofly View Post
    Sure, I'll try and keep it simple. I did briefly look at the statusquery, but I was concerned that it looked specifically engineered to support tightly coupled user interfaces, and I didn't want to fall into a trap of exposing the same out of a REST API. I'll look again.
    Great effort, Iím looking forward to see this evolve. :-)

    It would be great to have a documented API thatís less coupled with the user interface, but this will be a big work when you get to the browsing API parts unless you are going to re-implement all browsing code in LMS. Iíve done that partly in Custom Browse plugin and we did that partly in ickStream plugin for local library but supporting it for music services (My Apps content) would be really hard. However, if you skip browsing part itís more realistic.

    If you want this to be included in the core LMS distribution I suspect there are going to be community developers that are a bit concerned regarding supporting another API implementation. We already have CLI and JSONRPC (which mostly relies on underlying CLI commands) but expecting community developers to support a REST API in core LMS distribution that re-implement logic rather than rely on underlying CLI/JSONRPC APIs is probably unlikely.

    If you support it by yourself as a third party plugin installed separately it will of course work. The only issue with that is that full functionality clients/apps might not want to use an API that requires the user to install an extra plugin. You should probably target API support for more simple apps, like a player control app or a now playing display app.

    I plan to make an RFID based remote control for my child in near future, if you have support for volume control and sending a playlist to a player by then I might try to use it.
    Erland Isaksson (My homepage)
    Developer of many plugins/applets
    Starting with LMS 8.0 I no longer support my plugins/applets (see here for more information )

  7. #17
    Senior Member
    Join Date
    Aug 2014
    Location
    UK
    Posts
    532
    Quote Originally Posted by erland View Post
    Great effort, Iím looking forward to see this evolve. :-)

    It would be great to have a documented API thatís less coupled with the user interface, but this will be a big work when you get to the browsing API parts unless you are going to re-implement all browsing code in LMS. Iíve done that partly in Custom Browse plugin and we did that partly in ickStream plugin for local library but supporting it for music services (My Apps content) would be really hard. However, if you skip browsing part itís more realistic.
    That's interesting to hear your experience, I've put that to the back of my list for the moment and see what it looks like when I get there!

    Quote Originally Posted by erland View Post
    If you want this to be included in the core LMS distribution I suspect there are going to be community developers that are a bit concerned regarding supporting another API implementation. We already have CLI and JSONRPC (which mostly relies on underlying CLI commands) but expecting community developers to support a REST API in core LMS distribution that re-implement logic rather than rely on underlying CLI/JSONRPC APIs is probably unlikely.
    Yes, I suspect that to the be the case, as intimated in my original post. And I have no expectations of anybody, my goal, as stated, is just to get it to a level of maturity that it becomes useful/mature enough to be considered for included in the LMS distribution. But who knows, it may never get there. it's just a fun thing to do at thing to do at the moment, I suspect I'll pick it up and put it down again over time, and use it to get to know the inner workings of LMS.

    Quote Originally Posted by erland View Post
    The only issue with that is that full functionality clients/apps might not want to use an API that requires the user to install an extra plugin. You should probably target API support for more simple apps, like a player control app or a now playing display app.
    Indeed. I can't argue with that. I'll plod my way through it and it will get a larger scope through time.

    Quote Originally Posted by erland View Post
    I plan to make an RFID based remote control for my child in near future, if you have support for volume control and sending a playlist to a player by then I might try to use it.
    Cool, it will certainly have those features early on. :-)

  8. #18
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,598

    [In Development] RESTful API for LMS

    > I plan to make an RFID based remote control for my child in near future,

    Hurry up! Soon he/she will be able to use touch screens and knobs! :-)

  9. #19
    Senior Member
    Join Date
    Aug 2014
    Location
    UK
    Posts
    532
    I'm making reasonable progress with this.

    One issue I've come across is that I'm using Slim::Web::Pages->addRawFunction to hook into the LMS web framework and capture the api calls.

    I've coded up the api calls to manipulate the Player playlist queue, which, as they are changing existing state (adding or inserting or deleting the player queue) then they should be the 'PUT' HTTP method. (e.g. https://expectingtofly.github.io/LMS...layerid__queue )

    However, Slim::Web::HTTP specifically does not allow the 'PUT' http method, so the 'RawFunction' never gets called. https://github.com/Logitech/slimserv...b/HTTP.pm#L386 . It looks like it doesn't support the 'DELETE' method either, which is probably more of a problem :-(

    I presume there is no way around this and I can do nothing about it?

  10. #20
    Babelfish's Best Boy mherger's Avatar
    Join Date
    Apr 2005
    Location
    Switzerland
    Posts
    20,598

    [In Development] RESTful API for LMS

    > I presume there is no way around this and I can do nothing about it?

    Ouch... that's a big issue indeed. You could of course work on a PR to
    add PUT/DELETE... but that would require any user of your plugin to run
    the latest LMS.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •