JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC

  Thread Rating:
  • 8 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Montellese Offline
Team-XBMC Developer
Posts: 3,753
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #3166
(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.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
soundgals Offline
Junior Member
Posts: 3
Joined: Mar 2014
Reputation: 0
Post: #3167
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
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,753
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #3168
(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.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
Lunatixz Offline
Posting Freak
Posts: 2,929
Joined: May 2011
Reputation: 49
Location: New York
Post: #3169
is "duration" a deprecated parameter?

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

Thanks
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,753
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #3170
(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.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
claymic Offline
Senior Member
Posts: 126
Joined: Apr 2012
Reputation: 2
Post: #3171
(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
(This post was last modified: 2014-05-02 18:33 by claymic.)
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,753
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #3172
(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 with JSON-RPC logging enabled (in Settings -> System -> Debugging -> Verbose logging).

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
Milhouse Online
Team-Kodi Member
Posts: 4,188
Joined: Jan 2011
Reputation: 94
Post: #3173
(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

Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
find quote
Talguy Offline
Senior Member
Posts: 186
Joined: Sep 2010
Reputation: 0
Post: #3174
@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?

[Image: all-thin-banner.jpg]
find quote
thezoggy Offline
Fan
Posts: 440
Joined: Sep 2010
Reputation: 5
Post: #3175
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?)
find quote
Montellese Offline
Team-XBMC Developer
Posts: 3,753
Joined: Jan 2009
Reputation: 36
Location: Switzerland
Post: #3176
(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.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

[Image: badge.gif]
find quote
jez500 Offline
Team-Kodi Member
Posts: 77
Joined: Mar 2010
Reputation: 5
Location: Perth, Australia
Post: #3177
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.
(This post was last modified: 2014-05-18 08:22 by jez500.)
find quote
Tolriq Online
Donor
Posts: 2,355
Joined: Jun 2009
Reputation: 68
Location: France
Post: #3178
Need 'dateadded'. But sometimes the values get messed up specially for TvShows.

Yatse 2 : Media Center Remote Control for Touch Screens
Yatse, the Xbmc Remote and Widgets for Android
find quote
jez500 Offline
Team-Kodi Member
Posts: 77
Joined: Mar 2010
Reputation: 5
Location: Perth, Australia
Post: #3179
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.
find quote
Lunatixz Offline
Posting Freak
Posts: 2,929
Joined: May 2011
Reputation: 49
Location: New York
Post: #3180
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...
(This post was last modified: 2014-05-19 21:36 by Lunatixz.)
find quote
Post Reply