Kodi Community Forum
Solved ActivateWindow to "subdirectories?" - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (https://forum.kodi.tv/forumdisplay.php?fid=174)
+---- Thread: Solved ActivateWindow to "subdirectories?" (/showthread.php?tid=186535)



ActivateWindow to "subdirectories?" - dingerjunkie - 2014-02-16

Hello All,

Okay, I've been experimenting with window access/navigation via JSON RPC calls and am having a bit of difficulty with an item mentioned in the wiki.

For the record, v6 (Frodo).

Access to the "parent directory" for videos is working when I use...

jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videos"},"id":"1"}}

...however, I can't seem to directly navigate to my Movies or TV Shows pages.

At http://wiki.xbmc.org/index.php?title=Opening_Windows_and_Dialogs , The wiki states I should use something like...

ActivateWindow(Videos,MovieTitles)

...but attempting this in my call has failed. I've tried the following variants:

jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videos,movietitles"},"id":"1"}}

jsonrpc?request={"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videos","movietitles"},"id":"1"}}

Both fail, stating that "movietitles" is not a recognized enumerator.

So, how to I get this to work? How do I directly navigate to either the Movies or the TV Shows via a JSON RPC call?


RE: ActivateWindow to "subdirectories?" - Montellese - 2014-02-16

The "window" is still "videos" but you can provide additional parameters using the "parameters" parameter so something like this should work:
Code:
{"jsonrpc":"2.0","method":"GUI.ActivateWindow","params":{"window":"videos", "parameters": "movietitles"},"id":"1"}}



RE: ActivateWindow to "subdirectories?" - dingerjunkie - 2014-02-17

Thanks, Montellese.

...getting closer, hopefully.

current response to your suggestion:

{"error":{"code":-32602,"data":{"method":"GUI.ActivateWindow","stack":{"message":"Invalid type string received","name":"parameters","type":"array"}},"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}

I just need to figure out the proper way to pass in the string as an element in an array of values and I'll be good.


RE: ActivateWindow to "subdirectories?" - Montellese - 2014-02-17

(2014-02-17, 00:13)dingerjunkie Wrote: Thanks, Montellese.

...getting closer, hopefully.

current response to your suggestion:

{"error":{"code":-32602,"data":{"method":"GUI.ActivateWindow","stack":{"message":"Invalid type string received","name":"parameters","type":"array"}},"message":"Invalid params."},"id":"1","jsonrpc":"2.0"}

I just need to figure out the proper way to pass in the string as an element in an array of values and I'll be good.

Ah sorry I didn't see that you are using Frodo. In the nightly builds and the next stable release the request I posted will work. In Frodo you need to use
Code:
{ "jsonrpc": "2.0", "method": "GUI.ActivateWindow", "params": { "window":"videos", "parameters": [ "movietitles" ] }, "id": "1"} }

PS: It won't hurt if you read a bit about JSON, JSON schema and JSON-RPC. Then you'd know how to put together an array of values.


RE: ActivateWindow to "subdirectories?" - dingerjunkie - 2014-02-17

Greatly appreciated, Montellese. I am in the beginning stages of my self-teaching, so this early guidance is a huge help.