OH2 Kodi binding - GetRecentlyAddedEpisodes?

Fairly new to OH2.

Just installed the Kodi binding and enabled uPnP on Kodi. I can see Kodi online and various things available, vol, mute, stop etc.

I would like to show the recently added episodes. This is available via the Kodi api but have no idea how/where to use this. Any ideas?

Has anyone used this before?

http://kodi.wiki/view/JSON-RPC_API/v6#Video.Fields.Episode

5.12.12 VideoLibrary.GetRecentlyAddedEpisodes
Retrieve all recently added tv episodes
Permissions:
ReadData
Parameters:
[ Video.Fields.Episode properties ]
[ List.Limits limits ]
[ List.Sort sort ]

Hey Greg,

I am afraid this feature is not available in the current version of the OH2 binding for Kodi.

I agree. The Yatse app is one of the most useful tools for me combined with my Kodi instances.

For integrating this enhancement to the OH2 binding you have to think about how the results can be mapped to the channel concept of the OH2 framework. I suppose returning a list of data using a channel is a not supported feature. Maybe there is a way to retrieve the data with the HTTP binding and use a transformation like JSONPATH to extract the info you need.

Thanks. I’ll look into submitting an enhancement. I’ve done some digging around and managed to get a api that returns the info I’m looking for:

/jsonrpc?request={ “jsonrpc”: “2.0”, “method”: “VideoLibrary.GetRecentlyAddedEpisodes”, “params”: { “properties”: [ “showtitle” ]}, “id”: 1}}

Which returns json data:

{
"id":1,
"jsonrpc":"2.0",
"result":{
"episodes":[
{
"episodeid":13405,
"label":"1x01 tv episode name",
"showtitle":"series name"
},
...

I should now be able to hopefully use a json binding to parse this data.

Spent ages trying to get this workng but was having huge issue with http bind/json due to encoding. For some reason api needs to have quotes in the string but even with it encoded it didn’t work.

I ended up creating a python script to do the job. Working perfectly in OH2 :slight_smile:

Feel free to use the code. I"m not a developer so its not the prettiest code and might have some horribly bugs, but it gets the job done.

Sounds good. How do you assign the results to the corresponding OH2 items. Is your example complete or do I miss anything? Do you use the REST API?

I’m using the rest api. Works great.