JSON to find current profile
#1
Hi All. Having a bit of a problem here -- can I ask for some help please?

I'm currently trying to use JSON to ascertain what the currently active profile is - but I am not making much progress...
Currently trying the following:
curl -s --data-binary '{"jsonrpc": "2.0", "method": "Profiles.GetCurrentProfile", "params": { ["Profiles.Fields.Profile","properties"] }, "id":
1}' -H 'content-type: application/json;' http://127.0.0.1/jsonrpc
which is giving me an error:
{"error":{"code":-32700,"message":"Parse error."},"id":null,"jsonrpc":"2.0"}
What should I be using here?

Background info:
LibreElec with Kodi v17.6 on a Raspberry.
I have (currently) two profiles set up: "Master user" and "Children", with Children set up as the default profile on bootup, with no password.
Have the same sort of situation as described here:
https://forum.kodi.tv/showthread.php?tid=292932
however, I'm not finding the crontab solution 'intuitive' for the end users here, and I haven't been able to get callbacks to work at all (couldn't work out how to configure). I also have a bias against installing extra add-ons as a Pi has very little free resources available, and is slow enough as it is! Trying to avoid 'bloat'.

Therefore, the plan at the moment is to modify the cron script to run as follows:
  1. get current profile
  2. have we been idle for > 30 minutes
  3. if (profile != Children") and (idle) then reboot
Happy to consider any alternative method of achieving this, but this seems to me to be the simplest

Thanks
Reply
#2
the "params" part in your request is invalid.
you likely don't need it anyway so it can be omitted i think.

give it a shot without it, or use something along the lines of (untested):
"params": { "properties": ["thumbnail", "lockmode"] }
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Wink 
Fabulous!
I'd tried every other combination but that!
Thanks very much.
Reply

Logout Mark Read Team Forum Stats Members Help
JSON to find current profile0