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)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-04-14

(2014-04-14, 13:42)claymic Wrote: Thanks Montellese, sorry, i was so tired when i wrote this question that i don´t read everything on the commit, now i know how it works, very cool.
Can you tell me if is already possible to request a image with a specific size ? I tried to found any information about this but i don´t found.
Thanks again
Best regards
Clayton

Nope that's not possible yet.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - soundgals - 2014-04-25

I am completely new to JSON-RPC. What I want to achieve is to issue the following command form outside XBMC:

Dialog.Close(dialog[,force]) -- Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.--

I want to close all open dialogs (actually there will only be one open; but I don't know how to get its name/reference)

Is this possible with JSON-RPC? If not, is there another or better way to do it?

Thanks,

geoff


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-04-25

(2014-04-25, 11:03)soundgals Wrote: I am completely new to JSON-RPC. What I want to achieve is to issue the following command form outside XBMC:

Dialog.Close(dialog[,force]) -- Close a dialog. Set force to true to bypass animations. Use (all,true) to close all opened dialogs at once.--

I want to close all open dialogs (actually there will only be one open; but I don't know how to get its name/reference)

Is this possible with JSON-RPC? If not, is there another or better way to do it?

Thanks,

geoff

Don't post the same question in different threads.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-05-01

is "duration" a deprecated parameter?

If not what is the difference between "duration" and "runtime"

Thanks


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-05-01

(2014-05-01, 22:48)Lunatixz Wrote: is "duration" a deprecated parameter?

If not what is the difference between "duration" and "runtime"

Thanks

"duration" is for songs and "runtime" is for videos.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - claymic - 2014-05-02

(2014-04-14, 14:13)Montellese Wrote: Nope that's not possible yet.

Thanks Montellese
I am doing a new add-on and i get a problem with the request bellow :

Code:
def getAddonsPath(path,id):
   print "get addons video",path,id
   directory = "plugin://%s"%id
   json_params  =  '"params": {"properties": ["thumbnail","genre","plot"],"directory" : "%s","media" : "files"}'%directory
   print json_params
   json_request = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory",%s , "id": 1}'% json_params)  
   json_request = unicode(json_request, 'utf-8', errors='ignore')
   json_response = simplejson.loads(json_request)
   if json_response.has_key('result') and json_response['result'] != None and json_response['result'].has_key('files'):
      print "json called directory"
      for myfiles in json_response['result']['files']:
         print "its ok"
This is just a test to see if i can get a data from another add-on. I use the same method on my interface for ipad, but on the add-on after do this request seems that the Xbmc enter in a infinite loop, or something like that.
The add -on that i want to get the data is a video add-on.
Am i doing something wrong ? or what i want is just not possible ?
Thanks in advance


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-05-03

(2014-05-02, 18:28)claymic Wrote:
(2014-04-14, 14:13)Montellese Wrote: Nope that's not possible yet.

Thanks Montellese
I am doing a new add-on and i get a problem with the request bellow :

Code:
def getAddonsPath(path,id):
   print "get addons video",path,id
   directory = "plugin://%s"%id
   json_params  =  '"params": {"properties": ["thumbnail","genre","plot"],"directory" : "%s","media" : "files"}'%directory
   print json_params
   json_request = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory",%s , "id": 1}'% json_params)  
   json_request = unicode(json_request, 'utf-8', errors='ignore')
   json_response = simplejson.loads(json_request)
   if json_response.has_key('result') and json_response['result'] != None and json_response['result'].has_key('files'):
      print "json called directory"
      for myfiles in json_response['result']['files']:
         print "its ok"
This is just a test to see if i can get a data from another add-on. I use the same method on my interface for ipad, but on the add-on after do this request seems that the Xbmc enter in a infinite loop, or something like that.
The add -on that i want to get the data is a video add-on.
Am i doing something wrong ? or what i want is just not possible ?
Thanks in advance

Please provide a Debug log (wiki) with JSON-RPC logging enabled (in Settings -> System -> Debugging -> Verbose logging).


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2014-05-03

(2014-02-24, 08:57)Montellese Wrote:
(2014-02-24, 07:40)MilhouseVH Wrote: If a VideoLibrary.Clean is initiated using JSON, the GUI in recent Gotham nightlies now prompts to keep or remove missing items. Obviously this is undesirable when the clean has been initiated remotely via JSON and there is no user present to click the GUI button... is there any way to suppress the GUI prompts and always assume "remove" or "keep"? Maybe pass remove/keep/ask as a parameter on the JSON *.Clean request, with the default value being "remove" so as to remain consistent with the old pre-Gotham behaviour?

Otherwise VideoLibrary.Clean (and presumably AudioLibrary.Clean) are now a whole lot less useful (ie. almost unusable) from a JSON perspective if they require user intervention.

Thanks for the report. I'll see what I can get into Gotham. Most likely we will have to hard-code it to do a "keep" action as that's what makes most sense. Yes it differs from the previous behaviour but the previous behaviour was crazy. It's not acceptable to remove all items from a source just because the NAS is offline.

AudioLibrary.Clean is not affected as I've only adjusted the videolibrary cleaning to handle whole sources being offline.

Just a gentle reminder as it looks like this functionality didn't make it into Gotham. Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Talguy - 2014-05-06

@Montellese, I have a feature request. If this pull request to be able to quickly navigate the Channels list and the EPG timeline view by typing in a specific channel number gets accepted into the main development tree can we add functions into the JSON API to take advantage of navigating these windows by passing the desired Channel number to XBMC?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - thezoggy - 2014-05-06

is it possible to get/set watch status of an tv episode? for example if the user is replacing a existing file with something better.. i'd like to fetch the current watched status... hold onto it while we replace the previous file..then set the watch status accordingly (and remove the previous file reference... clean library? or just update old file to new one and keep associated data?)


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2014-05-07

(2014-05-03, 23:58)MilhouseVH Wrote:
(2014-02-24, 08:57)Montellese Wrote: Thanks for the report. I'll see what I can get into Gotham. Most likely we will have to hard-code it to do a "keep" action as that's what makes most sense. Yes it differs from the previous behaviour but the previous behaviour was crazy. It's not acceptable to remove all items from a source just because the NAS is offline.

AudioLibrary.Clean is not affected as I've only adjusted the videolibrary cleaning to handle whole sources being offline.

Just a gentle reminder as it looks like this functionality didn't make it into Gotham. Smile
Yeah I've looked into it before Gotham but it was not that easy to fix due to the nature of the video library cleaning implementation so I had to postpone it to after Gotham.

(2014-05-06, 21:37)Talguy Wrote: @Montellese, I have a feature request. If this pull request to be able to quickly navigate the Channels list and the EPG timeline view by typing in a specific channel number gets accepted into the main development tree can we add functions into the JSON API to take advantage of navigating these windows by passing the desired Channel number to XBMC?
I don't have a (working) PVR setup so I'm not really the man for PVR-specific features, sorry.

(2014-05-06, 22:43)thezoggy Wrote: is it possible to get/set watch status of an tv episode? for example if the user is replacing a existing file with something better.. i'd like to fetch the current watched status... hold onto it while we replace the previous file..then set the watch status accordingly (and remove the previous file reference... clean library? or just update old file to new one and keep associated data?)
You can use VideoLibrary.RemoveEpisode and VideoLibrary.SetEpisodeDetails but what you currently can't do is add a new episode. You also can't change the file reference of an episode.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jez500 - 2014-05-18

Just wondering if anyone has had problems with sorting by date with VideoLibrary.GetMovies? I would have thought that date would reflect when the media was added to the library so if I did something like this:

Code:
{"jsonrpc":"2.0","method":"VideoLibrary.GetMovies","params":{"properties":["title","art"],"sort":{"order":"descending","method":"date"}},"id":"1"}}

I would be getting a similar result to VideoLibrary.GetRecentlyAddedMovies. Instead it seems to give me back reverse alphabetical order.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2014-05-18

Need 'dateadded'. But sometimes the values get messed up specially for TvShows.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - jez500 - 2014-05-18

Perfect, Thanks Tolriq!
Works a treat.

Yeah I guess with TV it is listing when the show was added rather than the most recent episodes although even that looks a bit out of whack.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Lunatixz - 2014-05-19

did GetDirectory change recently?

I'm unable to return xbmc library info from json...

Code:
{"jsonrpc":"2.0","method":"Files.GetDirectory","params":{"directory":"smb://0.0.0.0/TV Shows/White Collar/Season 3/","properties":["duration","runtime"]},"id":19}

Should return duration, but doesn't... Worked in frodo and alpha builds of Gotham.

Tested with regular media (non strm) and strms, same result.

Database is mysql, btw... Thanks ahead of time...