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 - calor006 - 2013-11-12

(2011-09-28, 17:40)Montellese Wrote:
jasonvp Wrote:Can you please give me an example for "Player.Seek" params (percentage)? It's driving me nuts. Huh

Player.Seek is the best example/usage of the newly supported "union type definition". Player.Seek takes two parameters. The "playerid" (as all the other Player methods do) and a "value" parameter. The "value" parameter can have the following values:
  • a number value between 0.0 and 100.0 in which case it is handled as a percentage value to which the player should seek to. So if you pass 50.0 as the value the player will seek to the middle of the file being played.
  • a string value which takes one of the following values: "smallforward", "smallbackward", "bigforward", "bigbackward". These values replace the old FooPlayer.Small/BigSkipForward/Backward methods that aren't available anymore.
  • an object containg at least one of the following properties: "hours", "minutes", "seconds", "milliseconds". This allows to define a specific time value to which the player will seek to.

Hope this helps.


Hello,

Could someone give me an example of how to use the specific time value? as opposed to a percentage. I have been all over this page and others, http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6#Player.Position.Percentage , but to avail.

Thank you for your time.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-11-12

(2013-11-12, 23:24)calor006 Wrote: Hello,

Could someone give me an example of how to use the specific time value? as opposed to a percentage. I have been all over this page and others, http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6#Player.Position.Percentage , but to avail.

Thank you for your time.

Seek to 10%:
Code:
{"jsonrpc":"2.0",  "id": "libSeek", "method": "Player.Seek", "params": {"playerid": 1, "value": 10}}

Seek to 1h23m45s:
Code:
{"jsonrpc":"2.0",  "id": "libSeek", "method": "Player.Seek", "params": {"playerid": 1, "value": {"hours": 1, "minutes": 23, "seconds": 45, "milliseconds": 678}}}



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-11-13

Finally found the time to update the list of changes from the last 3 months:

Version 6.6.1

September 13th 2013:
Commit: 97c236ff469da8dc63394754f0e320d1893f0a1b
fix Playlist.Add/Insert not working with "directory"

Version 6.6.2

September 14th 2013:
Commit: f809499d80d93be3ced9c973af116cbdbe83db51
fix "file" property not working in AudioLibrary.GetSongDetails

Version 6.6.3

October 30th 2013:
Commit: 4a57f591e6db57864c888bbc327bb335dd2241ef
fix "limits" for PVR.GetChannels

Version 6.7.0

October 31st 2013:
Commit: 47cbe448c5ca49f7ecbe1fbec6e0d84605825a18
PVR: add GetBroadcasts and GetBroadcastDetails

Version 6.8.0

November 2nd 2013:
Commit: e97d8407d9bc30fe31ada381ca99bf24bf0253a4
GUI: Add SetStereoscopicMode, GetStereoscopicMode and property stereoscopicmode to GetProperties

Version 6.9.0

November 2nd 2013:
Commit: 34984dd19509c21112a22d57edd9584db47dac1d
Add Textures namespace with GetTextures and RemoveTexture

Version 6.9.1

November 3rd 2013:
Commit: e395cac8a376becbd98f4c972fe6ac93e7f4962d
VideoLibrary: add possibility to remove artwork from video items

Version 6.10.0

November 3rd 2013:
Commits: f471af0cc1ee4f250faa5acf06b549e65188c29f, 0f5d486e56e154f0bc627db3dfda390da242b65e
VideoLibrary: add seasonid, GetSeasonDetails and SetSeasonDetails

Version 6.11.0

November 3rd 2013:
Commit: 1b7dbe5b4d13573e90e0dd0a2cf2b16d8bd83c35
add support for multiple items to Playlist.Add/Insert

Version 6.12.0

November 3rd 2013:
Commit: 85bfca08835d489877f4fa3bd47b74f1da179e31
add VideoLibrary.SetMovieSetDetails

Version 6.13.0

November 11th 2013:
Commit: 85bfca08835d489877f4fa3bd47b74f1da179e31
Add Settings namespace with GetSections, GetCategories, GetSettings, GetSettingValue, SetSettingValue and ResetSettingValue


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yallah - 2013-11-13

Hi

did you get some times to add this function (resize thumbs). perhaps in Textures.GetTextures or "GetMoviesDetails" / "GetEpisodesDetails"

thx



(2013-05-01, 15:48)Montellese Wrote: Nope there's no custom image resizing yet but it's still on the TODO list.

Here's a more or less up-to-date list of all the changes since the Frodo release: http://forum.xbmc.org/showthread.php?tid=98551&pid=1358657#pid1358657



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-11-16

Just discovered a strange bug with JSON.

Code:
{"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","params":{"limits":{"start":0,"end":1500},"properties":["episode","genre","rating","originaltitle","studio","year","plot","title","playcount","art","dateadded","mpaa","lastplayed","sorttitle","cast"]}}

Send back playcount field with the actual number episode watched like 92 and field episode contains the actual number of episode so need to substract the values to know the show watched status.

when sending :

Code:
{"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","params":{"limits":{"start":0,"end":1500},"properties":["episode","genre","rating","originaltitle","studio","year","plot","title","playcount","art","dateadded","mpaa","lastplayed","sorttitle"]}}

I.E. same request without cast Smile

Then playcount is sendback as 1 or 0 depending on the actual played status of the show or not.

This is a quite inconsistent behavior leading to some troubles Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-11-18

(2013-11-10, 19:02)Montellese Wrote: Thanks for the detailed description. The problem is not in the webserver but in the way the paths are handled by the texture caching logic. I'll try to get jmarshall to look into it.

I opened a ticket so that it can be tracked.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-11-19

(2013-11-06, 18:46)Montellese Wrote: Looking at the code it seems that we throw away filters that contain no or an empty value which could explain this behaviour.

Just so it remains on the radar, I've raised ticket #14702 for this issue.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-11-19

Not sure which commit has caused this, but with a very recent xbmc master (up to and including 93077e6cf0a445ef439e51d54592a3c339873fd9), any call to Files.GetDirectory will result in an unhandled exception:
Code:
08:41:27 T:2852652112   DEBUG: JSONRPC Server: New connection detected
08:41:27 T:2852652112    INFO: JSONRPC Server: New connection added
08:41:27 T:2852652112   DEBUG: JSONRPC: Incoming request: {"id": "libDirectory", "jsonrpc": "2.0", "params": {"directory": "nfs://192.168.0.3/mnt/share/media/Video/TVShows/The Big Bang Theory"}, "method": "Files.GetDirectory", "properties": ["file"]}
08:41:27 T:2852652112   ERROR: Action - thread TCPServer, Unhandled exception caught in thread process, aborting. auto delete: 0
08:41:27 T:2852652112   DEBUG: Thread TCPServer 2852652112 terminating

I've ruled out PR:3671 - still getting unhandled exception without this patch.

Pretty sure this has been introduced sometime since 12/13 Nov - sorry can't be more precise.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-11-19

(2013-11-16, 21:12)Tolriq Wrote: Just discovered a strange bug with JSON.

Code:
{"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","params":{"limits":{"start":0,"end":1500},"properties":["episode","genre","rating","originaltitle","studio","year","plot","title","playcount","art","dateadded","mpaa","lastplayed","sorttitle","cast"]}}

Send back playcount field with the actual number episode watched like 92 and field episode contains the actual number of episode so need to substract the values to know the show watched status.

when sending :

Code:
{"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","params":{"limits":{"start":0,"end":1500},"properties":["episode","genre","rating","originaltitle","studio","year","plot","title","playcount","art","dateadded","mpaa","lastplayed","sorttitle"]}}

I.E. same request without cast Smile

Then playcount is sendback as 1 or 0 depending on the actual played status of the show or not.

This is a quite inconsistent behavior leading to some troubles Smile

Thanks for the report. I tracked down the problem but will have to see how best to fix it.

EDIT: Mind creating a bug report on track for it as it's easier to keep track of those than of forum posts.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Tolriq - 2013-11-19

(2013-11-19, 14:26)Montellese Wrote:
(2013-11-16, 21:12)Tolriq Wrote: Just discovered a strange bug with JSON.

Code:
{"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","params":{"limits":{"start":0,"end":1500},"properties":["episode","genre","rating","originaltitle","studio","year","plot","title","playcount","art","dateadded","mpaa","lastplayed","sorttitle","cast"]}}

Send back playcount field with the actual number episode watched like 92 and field episode contains the actual number of episode so need to substract the values to know the show watched status.

when sending :

Code:
{"id":1,"jsonrpc":"2.0","method":"VideoLibrary.GetTVShows","params":{"limits":{"start":0,"end":1500},"properties":["episode","genre","rating","originaltitle","studio","year","plot","title","playcount","art","dateadded","mpaa","lastplayed","sorttitle"]}}

I.E. same request without cast Smile

Then playcount is sendback as 1 or 0 depending on the actual played status of the show or not.

This is a quite inconsistent behavior leading to some troubles Smile

Thanks for the report. I tracked down the problem but will have to see how best to fix it.

EDIT: Mind creating a bug report on track for it as it's easier to keep track of those than of forum posts.

http://trac.xbmc.org/ticket/14703


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-11-20

(2013-11-19, 10:42)MilhouseVH Wrote: Pretty sure this has been introduced sometime since 12/13 Nov - sorry can't be more precise.

I've just rebuilt OpenELEC with tip of xbmc master (cca24dd24e5873f18a65e9de2f15020b92e93858) and now instead of an unhandled exception, it's returning a JSON error:
Code:
2013-11-20 03:22:37.658858:MainThread: libDirectory.JSON SOCKET REQUEST: [{"id": "libDirectory", "jsonrpc": "2.0", "params": {"directory": "nfs://192.168.0.3/mnt/share/media/Video/TVShows/The Big Bang Theory"}, "method": "Files.GetDirectory", "properties": ["file"]}]
2013-11-20 03:22:37.664750:MainThread: libDirectory.BUFFER RECEIVED (len 89)
2013-11-20 03:22:37.664811:MainThread: libDirectory.PARSING JSON DATA: {"error":{"code":-32602,"message":"Invalid params."},"id":"libDirectory","jsonrpc":"2.0"}

I've been able to reproduce in Ubuntu 12.10 too. All the other JSON methods seem OK, just not this one...


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - edrikk - 2013-11-20

Hi,

I've got a question about player.open which I can't figure out... I have created a few .strm files which point to some ip cameras in the house. I can open the files perfectly fine in XBMC, and they work.

However, these files (although a part of my sources.xml) are not in the library (I don't want them there)... They have been set with a blank 'type'.

I'm wondering if there is a way for me to call player.open giving the api the full path/name of the .strm file to play? This way, I can program remote control keys to jump to the various streams....

Thanks!


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-11-20

(2013-11-19, 10:42)MilhouseVH Wrote: Not sure which commit has caused this, but with a very recent xbmc master (up to and including 93077e6cf0a445ef439e51d54592a3c339873fd9), any call to Files.GetDirectory will result in an unhandled exception:
Code:
08:41:27 T:2852652112   DEBUG: JSONRPC Server: New connection detected
08:41:27 T:2852652112    INFO: JSONRPC Server: New connection added
08:41:27 T:2852652112   DEBUG: JSONRPC: Incoming request: {"id": "libDirectory", "jsonrpc": "2.0", "params": {"directory": "nfs://192.168.0.3/mnt/share/media/Video/TVShows/The Big Bang Theory"}, "method": "Files.GetDirectory", "properties": ["file"]}
08:41:27 T:2852652112   ERROR: Action - thread TCPServer, Unhandled exception caught in thread process, aborting. auto delete: 0
08:41:27 T:2852652112   DEBUG: Thread TCPServer 2852652112 terminating

I've ruled out PR:3671 - still getting unhandled exception without this patch.

Pretty sure this has been introduced sometime since 12/13 Nov - sorry can't be more precise.

I tried to reproduce this on win32 but it worked fine for me.

(2013-11-20, 07:02)edrikk Wrote: Hi,

I've got a question about player.open which I can't figure out... I have created a few .strm files which point to some ip cameras in the house. I can open the files perfectly fine in XBMC, and they work.

However, these files (although a part of my sources.xml) are not in the library (I don't want them there)... They have been set with a blank 'type'.

I'm wondering if there is a way for me to call player.open giving the api the full path/name of the .strm file to play? This way, I can program remote control keys to jump to the various streams....

Thanks!

Have you tried the "file" property of the "item" parameter?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Milhouse - 2013-11-20

(2013-11-20, 08:58)Montellese Wrote: I tried to reproduce this on win32 but it worked fine for me.

I'm working on narrowing down the troublesome commit on Ubuntu, what it actually produces in the xbmc log in response to the GetDirectory request is:
Code:
06:36:34 T:139653000718080   DEBUG: JSONRPC: Incoming request: {"id": "libDirectory", "jsonrpc": "2.0", "params": {"directory": "nfs://192.168.0.3/mnt/share/media/Video/TVShows/The Big Bang Theory", "media": "files"}, "method": "Files.GetDirectory", "properties": ["file", "art", "fanart", "thumb", "size", "dateadded", "lastmodified", "mimetype"]}
06:36:34 T:139653000718080   DEBUG: CUtil::GetMatchingSource: no matching source found for [nfs://192.168.0.3/mnt/share/media/Video/TVShows/The Big Bang Theory]
and then the JSON "Invalid params" response is returned to the caller. I've gone back to the last commit on 11 Nov and that's fine, so just now working through the following commits... should know soon (hopefully!)


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2013-11-20

I know the cause of the problem of the "no matching source found" but that shouldn't cause a crash.