Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - 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: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- dann0 - 2011-05-13

I realize you guys are kept very busy by this project but it would be really nice if someone from the team could take a look at this for me

http://forum.xbmc.org/showpost.php?p=792559&postcount=31

I am using XBMC version 10.1 and a PHP wrapper for JSON-RPC.

I have mentioned before that i have this issue with AudioLibrary.GetAlbums() but it hasn't generated any interest...

The results i have posted suggest the problem lies not with my use of the API or the wrapper but with the JSON-RPC API itself.


- _Andy_ - 2011-05-13

Hello

I want to list all available episodes of a tvshow. Do i need many queries to get all episodes or can i use one query?
What parameter do i need for the field season to query all episodes?


Not getting all announcements - ThisIsNotAnon - 2011-05-13

Hello everybody.

I've been testing the announcements and for some reason even though I registered to receive all announcements I only get player announcements.

Here's what I do:
JSON-RPC
Code:
{ "jsonrpc": "2.0", "id" : "1", "method" : "JSONRPC.GetAnnouncementFlags" } }

Result:
Code:
{
   "id" : "1",
   "jsonrpc" : "2.0",
   "result" : {
      "GUI" : true,
      "Other" : true,
      "Playback" : true,
      "System" : true
   }
}

These are the only announcements I receive however:
Code:
{
   "jsonrpc" : "2.0",
   "method" : "Announcement",
   "params" : {
      "message" : "PlaybackStarted",
      "sender" : "xbmc"
   }
}
{
   "jsonrpc" : "2.0",
   "method" : "Announcement",
   "params" : {
      "message" : "PlaybackSpeedChanged",
      "sender" : "xbmc"
   }
}
{
   "jsonrpc" : "2.0",
   "method" : "Announcement",
   "params" : {
      "message" : "PlaybackStopped",
      "sender" : "xbmc"
   }
}

This can't be expected behaviour can it ?


- topfs2 - 2011-05-13

Announcements in Dharma are very few, in master however xbmc is a lot more chatty.


- ThisIsNotAnon - 2011-05-13

topfs2 Wrote:Announcements in Dharma are very few, in master however xbmc is a lot more chatty.
Is master an upcoming version or the master profile ? I tried loading the master profile and checked again for incoming announcements and nothing changed.

Edit:
Using Dharma


- spiff - 2011-05-13

master = what trunk was in svn = the development branch.


- Montellese - 2011-05-13

dann0 Wrote:I have mentioned before that i have this issue with AudioLibrary.GetAlbums() but it hasn't generated any interest...

The results i have posted suggest the problem lies not with my use of the API or the wrapper but with the JSON-RPC API itself.
I remember having read about this quite a while ago. Could you please check if there already is a bug report about this on trac and if not create a new one so it won't be forgotten? Thank.

_Andy_ Wrote:I want to list all available episodes of a tvshow. Do i need many queries to get all episodes or can i use one query?
What parameter do i need for the field season to query all episodes?

You should really take a look at the output of JSONRPC.Introspect (or look into the wiki page here.
It will tell you that the call to VideoLibrary.GetEpisodes requires the id of the tvshow and the season. So you'll have to call VideoLibrary.GetTVShows first to get the needed tvshowid and then you can call VideoLibrary.GetEpisodes for every season of a particular tvshow. If you don't know the seasons you can retrieve them using VideoLibrary.GetSeasons.


- ThisIsNotAnon - 2011-05-14

Thanks for the hint guys. The master is indeed announcing what I need, however it flickers but I'll find a way around that.

Cheers


- _Andy_ - 2011-05-14

Last year i coded a gui with json rpc. With one query i was able to get all epsiodes of a given tvshowid in one result set. Now i need two parameters. The tvshowid and the season.
Charmed e.g. have 8 seasons. No i need 8 queries to get all episodes and have 8 result sets.
Is this correct?


- topfs2 - 2011-05-14

_Andy_ Wrote:Last year i coded a gui with json rpc. With one query i was able to get all epsiodes of a given tvshowid in one result set. Now i need two parameters. The tvshowid and the season.
Charmed e.g. have 8 seasons. No i need 8 queries to get all episodes and have 8 result sets.
Is this correct?

season should still be optional AFAIK


- Montellese - 2011-05-14

topfs2 Wrote:season should still be optional AFAIK

Probably my bad as it isn't. Furthermore there seems to be a typo in the type of the "season" parameter. I'll fix it up ASAP.

EDIT: Fixed


- dann0 - 2011-05-15

Montellese Wrote:I remember having read about this quite a while ago. Could you please check if there already is a bug report about this on trac and if not create a new one so it won't be forgotten? Thank.

Ticket #11543 created


- pieh - 2011-05-15

is it possible to define listitem's properties as fields to retrieve? f.e.
Code:
{ "jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "id": 1, "params": {"fields": ["property:totalseasons", "property:totalepisodes"] } }



- carmenm - 2011-05-15

I am facing a problem with VideoPlaylist.GetItems.

I store the whole XBMC database in a local SQL database. I have entities Movie, TVShow, Epsiode, Season, Actor ....

Now when using VideoPlaylist.GetItems, i would like to find if the item is in my database to access it. Which means also ifinding if it s a movie, tvshow, episode ...

The only unique id i get with GetItems is "file" but still wont tell me if its a movie...
Does anyone see a way to know that ?

And if not maybe that s something that would be useful to get with the GetItems details. But do you even know it on XBMC's side?

Thanks


- Montellese - 2011-05-15

grajen3 Wrote:is it possible to define listitem's properties as fields to retrieve? f.e.
Code:
{ "jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "id": 1, "params": {"fields": ["property:totalseasons", "property:totalepisodes"] } }
No this is not possible but the "episode" field in VideoLibrary.GetTVShows gives you the amount of episodes in a TVShow IIRC.

carmenm Wrote:I am facing a problem with VideoPlaylist.GetItems.

I store the whole XBMC database in a local SQL database. I have entities Movie, TVShow, Epsiode, Season, Actor ....

Now when using VideoPlaylist.GetItems, i would like to find if the item is in my database to access it. Which means also ifinding if it s a movie, tvshow, episode ...

The only unique id i get with GetItems is "file" but still wont tell me if its a movie...
Does anyone see a way to know that ?

Are you using a recent nightly build? Doesn't seem like it because this is what I get from a call to VideoPlaylist.GetItems:
Code:
"items" : [
  {
    "id" : 1188,
    "label" : "On the Hook",
    "type" : "episode"
  },
  {
    "id" : 860,
    "label" : "Tron Legacy",
    "type" : "movie"
  }
]

As you can see you (by default) get a "type" property which tells you whether it's a movie, episode or music video (obviously you can have a tvshow queued in a playlist but only the episodes of a tv show) AND you get the "id" of that item so you can call VideoLibrary.Get*Details using that id.