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
Results 1 to 4 of 4
Thread: Querying an offline player
-
2020-12-03, 14:16 #1jvromans@squirrel.nlGuest
Querying an offline player
-
2020-12-03, 22:02 #2
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
-
2020-12-04, 00:36 #3jvromans@squirrel.nlGuest
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
-
2020-12-04, 01:45 #4jvromans@squirrel.nlGuest
Querying an offline player
For the sake of clarity: It's about querying LMS, not the player itself.