Kodi Community Forum

Full Version: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
(2012-11-28, 00:19)Martijn Wrote: [ -> ]
(2012-11-27, 22:55)yallah Wrote: [ -> ]Hi,

Don't why bluray iso can't open via json-rpc (working if I execute ISO from GUI)...

{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"file":"Z:\\Star Wars Episode III - Revenge of the Sith (2005)\\Star Wars Episode III - Revenge of the Sith (2005).iso"}}, "id": 1}

http://pastebin.com/GBAtARU8

thx for your help

If this is a movie scraped to your library and you know the dbid you could also use Player.Open through JSONRPC

Thx good idea, now need find command to know dbid (is it inside VideoLibrary.GetMovieDetails methods or VideoLibrary.GetMovies ?)

can you give me command ?


Both. iirc its called 'movieid'
It's the unique I'd number in xbmc for that movie
ok thx Wink
Trying to play a file wit a resume time am I forgetting something in the call or are these messages normal as the enum is evaluated:

Code:
19:47:43 T:8780   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "params": {"item": {"movieid": 1}, "options": {"resume": {"hours": 0, "seconds": 47, "minutes": 1, "milliseconds": 0}}}, "method": "Player.Open", "id": 1}
19:47:43 T:8780   DEBUG: JSONRPC: Calling player.open
19:47:43 T:8780   DEBUG: JSONRPC: Type mismatch in type
19:47:43 T:8780   DEBUG: JSONRPC: Type mismatch in type Player.Position.Percentage

Martin
(2012-11-28, 00:09)Montellese Wrote: [ -> ]
(2012-11-27, 23:04)claymic Wrote: [ -> ]Thanks Montellese, i tried to find the VideoLibrary.SetFooDetails in Wiki, but don found. Maybe i am missing something.
Can you tell me where i can read about VideoLibrary.SetFooDetails ?
Thanks again
Clayton

You'll have to replace "Foo" with "Movie" or "Episode" or "MusicVideo" i.e. VideoLibrary.SetMovieDetails etc Wink I was just too lazy to type it all out.
Thanks Montellese, you dont make any wrong, i understand at the first time, i just looked in the wrong place, i was searching for "videolibrary.set" in the JSON-RPC API V4, since i am not using the new frodo yet. I will test to see if works at least with Frodo alpha 3.
Do you saw the videos i sent to you ? Let me know your impression, tomorrow i will update the video with all changes.
Thanks for all help.

When I delete a file from a library using JSON on the movieid or tvshowid, the recently added icons don't get removed until I exit and restart xbmc. Is there something I need to do to refresh the main screen? They aren't in the recently added text list boxes just as icons.

Martin
How do I markup a directory that contains a comma for a scan ie.

Code:
00:56:54 T:2436   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "params": {"directory": "K:\\Emily Owens, M.D\\"}, "method": "VideoLibrary.Scan", "id": 1}
00:56:54 T:2436   DEBUG: JSONRPC: Calling videolibrary.scan
00:56:54 T:2436  NOTICE: {u'jsonrpc': u'2.0', u'id': 1, u'result': u'OK'}
...
00:56:54 T:5368   DEBUG: CAnnouncementManager - Announcement: OnScanStarted from xbmc
00:56:54 T:5368   ERROR: XFILE::CDirectory::GetDirectory - Error getting K:\Emily Owens
00:56:54 T:5368   DEBUG: VideoInfoScanner: No (new) information was found in dir K:\Emily Owens

Sorry for all the questions but I am new to JSON & python

Martin
(2012-11-28, 03:20)emveepee Wrote: [ -> ]Trying to play a file wit a resume time am I forgetting something in the call or are these messages normal as the enum is evaluated:

Code:
19:47:43 T:8780   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "params": {"item": {"movieid": 1}, "options": {"resume": {"hours": 0, "seconds": 47, "minutes": 1, "milliseconds": 0}}}, "method": "Player.Open", "id": 1}
19:47:43 T:8780   DEBUG: JSONRPC: Calling player.open
19:47:43 T:8780   DEBUG: JSONRPC: Type mismatch in type
19:47:43 T:8780   DEBUG: JSONRPC: Type mismatch in type Player.Position.Percentage

Martin
Does it work or not? Those debug messages are a bit of a pain. They are very useful when the user actually sends an invalid request but they are confusing if the user sends a valid request. Unfortunately I don't know at the beginning if the request is valid or not so I log them all the time (but only when debug logging is enabled).

(2012-11-28, 06:57)emveepee Wrote: [ -> ]When I delete a file from a library using JSON on the movieid or tvshowid, the recently added icons don't get removed until I exit and restart xbmc. Is there something I need to do to refresh the main screen? They aren't in the recently added text list boxes just as icons.

Martin
I'll take a look into it. Probably something missing in the recently added code of the home page.

(2012-11-28, 08:03)emveepee Wrote: [ -> ]How do I markup a directory that contains a comma for a scan ie.

Code:
00:56:54 T:2436   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "params": {"directory": "K:\\Emily Owens, M.D\\"}, "method": "VideoLibrary.Scan", "id": 1}
00:56:54 T:2436   DEBUG: JSONRPC: Calling videolibrary.scan
00:56:54 T:2436  NOTICE: {u'jsonrpc': u'2.0', u'id': 1, u'result': u'OK'}
...
00:56:54 T:5368   DEBUG: CAnnouncementManager - Announcement: OnScanStarted from xbmc
00:56:54 T:5368   ERROR: XFILE::CDirectory::GetDirectory - Error getting K:\Emily Owens
00:56:54 T:5368   DEBUG: VideoInfoScanner: No (new) information was found in dir K:\Emily Owens

Sorry for all the questions but I am new to JSON & python

Martin
Does the same path work within XBMC? AFAIK a comma is a valid character in a path so XBMC shouldn't choke on it.
(2012-11-28, 06:57)emveepee Wrote: [ -> ]When I delete a file from a library using JSON on the movieid or tvshowid, the recently added icons don't get removed until I exit and restart xbmc. Is there something I need to do to refresh the main screen? They aren't in the recently added text list boxes just as icons.

Martin

Should be fixed once PR1852 has been merged.
(2012-11-28, 00:19)Martijn Wrote: [ -> ]
(2012-11-27, 22:55)yallah Wrote: [ -> ]Hi,

Don't why bluray iso can't open via json-rpc (working if I execute ISO from GUI)...

{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"file":"Z:\\Star Wars Episode III - Revenge of the Sith (2005)\\Star Wars Episode III - Revenge of the Sith (2005).iso"}}, "id": 1}

http://pastebin.com/GBAtARU8

thx for your help

If this is a movie scraped to your library and you know the dbid you could also use Player.Open through JSONRPC

Same prob;/

Use {"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"movieid": 237 }}, "id": 1} (ISO STARWARS) no working
{"jsonrpc": "2.0", "method": "Player.Open", "params": {"item": {"movieid": 231 }}, "id": 1} (MKV SHREK) working

Tell me if prob come from outside Json-RPC. But When I start from GUI it's working :/
http://pastebin.com/JaPyHKAA
(2012-11-28, 09:22)Montellese Wrote: [ -> ]Does it work or not? Those debug messages are a bit of a pain. They are very useful when the user actually sends an invalid request but they are confusing if the user sends a valid request. Unfortunately I don't know at the beginning if the request is valid or not so I log them all the time (but only when debug logging is enabled).

Yes it works fine positioning by time, I just was wondering if I was doing something wrong.

Quote:Does the same path work within XBMC? AFAIK a comma is a valid character in a path so XBMC shouldn't choke on it.

On a full scan yes,

12:23:31 T:2656 DEBUG: VideoInfoScanner: Found matching Full NFO file: K:\Emily Owens, M.D\tvshow.nfo

Thanks,

Martin
(2012-11-28, 10:50)Montellese Wrote: [ -> ]
(2012-11-28, 06:57)emveepee Wrote: [ -> ]When I delete a file from a library using JSON on the movieid or tvshowid, the recently added icons don't get removed until I exit and restart xbmc. Is there something I need to do to refresh the main screen? They aren't in the recently added text list boxes just as icons.

Martin

Should be fixed once PR1852 has been merged.

Thanks it is working now.

Martin
Any reason why Addons.GetAddons does not support array for the Type filter ?
(2012-12-01, 15:10)Tolriq Wrote: [ -> ]Any reason why Addons.GetAddons does not support array for the Type filter ?

Yeah, the addons code in xbmc doesn't offer a method to do that Wink
Any reason why you can't send two requests in a batch request and merge the two result lists?
Well the question was more about the way to read the introspect Smile

Code:
{ "name": "type", "$ref": "Addon.Types" },
{ "name": "properties", "$ref": "Addon.Fields" },

Looks quite the same and both type definition are the same. So when I tried I did suppose that the type field did accept an array too but in fact no :p

Not really a problem by itself.

And for your second question since I get 7 addons type it's faster to get them all and filter on the phone since I suppose no user will have 500 or more addons in one Xbmc instance.