Kodi Community Forum

Full Version: JSON-RPC ov TCP and boolean parameter
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm using the JSON-RPC interface over port 9090, and it's working great.
However, I'm having trouble trying to send it a boolean parameter.

Here is the full call:
Code:
{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "smb://share/folder", "media": "video", "recursive": true}, "id": "1"}
The problem is that the true parameter for "recursive" is not in quotes, and this throws a parse error.
So I put in in quotes, which gets rid of the parse error, but the directory is NOT recursively scanned. This makes me believe that XBMC does not think of a "true" in quotes as a boolean true.

I've also tried it as "true" and as "TRUE".

Any ideas on what I'm doing wrong?
I just ran your request (replaced your path with a real path on my machine) both over TCP and HTTP and I did not get a parse error and everything worked fine (got a list of all video files in the provided directory). There is no need to put quotes around the boolean value "true" as quotes indicate a string. Can you enable debug logging in XBMC and then pastebin your log file as it should contain the received request if there is a parse error.
I just ran the request again. It worked this time - no parse error.
I must have fat-fingered it previously. My fault.
You are correct, no quotes needed for boolean value.

Thanks!
Montellese Wrote:I just ran your request (replaced your path with a real path on my machine) both over TCP and HTTP and I did not get a parse error and everything worked fine (got a list of all video files in the provided directory).

Did you get a recursive listing? I am still not getting a recursive listing. I only get the directories directly beneath the location i provide. It does not go any deeper, even though there are more folders/files below them.

The command does not show up in the debug log, so I can't get anywhere from that route.
Any ideas?
bradvido88 Wrote:Did you get a recursive listing? I am still not getting a recursive listing. I only get the directories directly beneath the location i provide. It does not go any deeper, even though there are more folders/files below them.
No I don't get a recursive listing. Please create a bug ticket for this so it won't be forgotten.

bradvido88 Wrote:The command does not show up in the debug log, so I can't get anywhere from that route.
It only shows up in the log if there is an error.
Montellese Wrote:No I don't get a recursive listing. Please create a bug ticket for this so it won't be forgotten.
Here it is: http://trac.xbmc.org/ticket/11209