Json syntax to open a favourite?
#1
Anybody here with a working syntax to launch a favourite via json in Kodi?
I have managed to work out a few ways to open certain windows and players, but the favourites seem like an obvious omission in the v6 documentation. I am pretty sure many would need this one?
Anything that works in a webbrowser would be a good start, like this example to open an addon:
something like: http://192.168.x.x:80/jsonrpc?request={"jsonrpc":"2.0","method":"Player.Open","params":{"directory":"plugin://plugin.program.super.favourites/? [name of favorite here?]"}, "id":1}

Ideally it would be addon independent and just launch whatever the favourite is in, simply do what happens when you select a favourite in the Kodi GUI, be it a stream, a movie or whatever.
Anybody with any hints or working examples would be fab.
Reply
#2
(2015-04-14, 12:56)houser Wrote: Anybody here with a working syntax to launch a favourite via json in Kodi?
I have managed to work out a few ways to open certain windows and players, but the favourites seem like an obvious omission in the v6 documentation. I am pretty sure many would need this one?
Anything that works in a webbrowser would be a good start, like this example to open an addon:
something like: http://192.168.x.x:80/jsonrpc?request={"jsonrpc":"2.0","method":"Player.Open","params":{"directory":"plugin://plugin.program.super.favourites/? [name of favorite here?]"}, "id":1}

Ideally it would be addon independent and just launch whatever the favourite is in, simply do what happens when you select a favourite in the Kodi GUI, be it a stream, a movie or whatever.
Anybody with any hints or working examples would be fab.

When you get the favourites using the method Favourites.GetFavourites you must check the objects window result. When it's empty just play it (method Player.Open). Kodi will do the rest. When the window is not empty, it's for example the Movies window, use the method GUI.ActivateWindow.

BTW. I think it's the wrong thread to ask this question. Use http://forum.kodi.tv/forumdisplay.php?fid=174.
Proud owner of comics42.shop 
Reply
#3
(2015-04-14, 17:56)rschiks Wrote: When you get the favourites using the method Favourites.GetFavourites you must check the objects window result. When it's empty just play it (method Player.Open). Kodi will do the rest. When the window is not empty, it's for example the Movies window, use the method GUI.ActivateWindow.

BTW. I think it's the wrong thread to ask this question. Use http://forum.kodi.tv/forumdisplay.php?fid=174.

Thanx for your reply rschiks.
And thanx to mod for moving post to the correct place. Sorry about that.
So there is no standard example that can be shared to get going?. I am stuck as json is a little hard to figure out for a rusty amateur Wink
Are you saying the syntax will have to be different for different types of favorites? Thanx again regardless.
Reply
#4
(2015-04-14, 23:24)houser Wrote:
(2015-04-14, 17:56)rschiks Wrote: When you get the favourites using the method Favourites.GetFavourites you must check the objects window result. When it's empty just play it (method Player.Open). Kodi will do the rest. When the window is not empty, it's for example the Movies window, use the method GUI.ActivateWindow.

BTW. I think it's the wrong thread to ask this question. Use http://forum.kodi.tv/forumdisplay.php?fid=174.

Thanx for your reply rschiks.
And thanx to mod for moving post to the correct place. Sorry about that.
So there is no standard example that can be shared to get going?. I am stuck as json is a little hard to figure out for a rusty amateur Wink
Are you saying the syntax will have to be different for different types of favorites? Thanx again regardless.

Hi, I started with this:

Code:
{ "jsonrpc": "2.0", "method": "Favourites.GetFavourites", "params": { "properties": ["window","path","thumbnail","windowparameter"] }, "id": 1 }

Got it from: http://forum.kodi.tv/showthread.php?tid=210549

As far as I have seen, you can also have Movies as a favourite, so you jump to the Movies screen. You can't play that. That's why I check on that. Because to open the Movies screen you need another method (GUI.ActivateWindow).

If you want, I can provide you the objective-c code.
Proud owner of comics42.shop 
Reply
#5
Sorry for late reply. Just saw this.
You are very kind to offer the code, but I am afraid that is a bit beyond my skillset.
I am just looking for a way to be able to build JSON commands reasonably easy for favourites.
Your example was helpful and I'll experiment further. thanx again!
Reply

Logout Mark Read Team Forum Stats Members Help
Json syntax to open a favourite?0