Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 4 of 4
  1. #1
    jvromans@squirrel.nl
    Guest

    Querying an offline player

    I can query a player for its status with a POST to the server API port and
    data:

    {"id":12,"method":"slim.request","params":["xx:xx:xx:xx:xx:xx",["status","-"]]}

    When the player is not online (switched off, network outage, ...) this
    yields an empty response. Empty, not even response headers -- completely empty.
    This confuses the browser, which considers it a blocked CORS request.

    Shouldn't LMS return a response with 'mode: offline' or something similar?

    -- Johan

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

    Querying an offline player

    > Shouldn't LMS return a response with 'mode: offline' or something similar?

    I think LMS would even throw an error to server.log, considering the
    request invalid. Whether this is correct behaviour or not can be
    discussed. But the current behaviour is a decision taken many years ago...

    Even internally it's pretty difficult to deal with disconnected players.
    Sometimes I saw myself (ab)use the prefs system, where I'd read out the
    overall prefs object to get the IDs of such clients.

    --

    Michael

  3. #3
    jvromans@squirrel.nl
    Guest

    Querying an offline player

    On Fri, 4 Dec 2020 06:02:57 +0100, Michael Herger <slim (AT) herger (DOT) net> wrote:

    > I think LMS would even throw an error to server.log, considering the
    > request invalid. Whether this is correct behaviour or not can be
    > discussed.


    It is not unreasonable to expect LMS to be able to provide a selection of
    details about players that are, or have been, known even if they are not
    connected. If the decision was taken to not do so that's okay.

    But LMS could return a 'not connected' mode message. Or 'unknown'. Or
    'invalid'. Or an empty json. Whatever. But in all cases it should answer the
    request.

    -- Johan

  4. #4
    jvromans@squirrel.nl
    Guest

    Querying an offline player

    For the sake of clarity: It's about querying LMS, not the player itself.

Posting Permissions

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