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)



- marksoccer - 2010-06-29

Is there a way to get the name of TV Show currently playing? I can get the episode name, but not the name of the TV Series.


- topfs2 - 2010-06-29

Yes, end will set an upper limit to X first and start will set a lower limit of Y.

So if you want just one item you need to set X = Y +1; i.e. start: 1, end: 2;

Fanart isn't wrapped atm and biography I'm not even sure what that is Smile (I will create a complete list of the available fields at some point but for now checkout xbmc/lib/libjsonrpc/FileItemHandler.cpp for them)


- Fiasco - 2010-06-29

I just dl'd the xbmc source ms express ect so will examine that file.

Thanks


- marksoccer - 2010-07-01

I took a look at FileItemHandler.cpp and noticed that it is missing a bunch of fields (possibly because the fields are not populated?). Without digging in too far, it looks to me like CVideoInfoTag *videoInfo should have all the info I am looking for such as episode, showTitle, and firstAired. I found the CVideoInfoTag definition in VideoInfoTag.h. Are these fields something that can be easily added to json in the near future?


- Kabooga - 2010-07-03

Are there any plans to use songId in the API?


- Nuka1195 - 2010-07-10

topfs2, i see you've been real busy with beagle board, but is there any chance you could look at my requests.

the patch i submitted, i've since added artist and album to param list for videos. i will submit a new patch if you would consider it.


- Kabooga - 2010-07-16

Beuller?.....Beuller?.....Beuller?

Looks like a few people are waiting with baited breath...........


- dstruktiv - 2010-07-17

Hi there I'm coding a remote control app in .NET C# for Windows. I saw on the Wiki the HTTP API is depreciated (Or will be in the near future).

So I'm going with the json api, after a lot of trial and error and reading this thread I've got a basic app up and running which can send/receive info from xbmc.

What I'm having trouble with now is pulling the album art of the currently playing song. I'm getting the audio playlist and identifying the current song, then the only method I can see that is even remotely related to getting artwork would be File.Download which is described as "Specify a file to download to get info about how to download it, i.e a proper URL". So I call File.Download on the current songs thumbnail field and I get this (My app log):

Code:
7/17/2010 8:03:19 PM - Invoking: {"jsonrpc":"2.0","method":"AudioPlaylist.GetItems","id":1}
7/17/2010 8:03:19 PM - Invoking: {"jsonrpc":"2.0","method":"Files.Download","params":["special://masterprofile/Thumbnails/Music/c/cf23dc2e.tbn"],"id":1}
7/17/2010 8:03:19 PM - Invalid params.

It's a bit frustrating as we're told not to use the http api but then there's no real doco for the json api Sad Can someone please tell me the correct params to pass for File.Download ?

Layout blatantly stolen from Bram77's screen shot in this thread cause I'm not very creative lol.

Image


- Tolriq - 2010-07-17

For the moment the goal of File.Download is to give you back the way of getting the file.
I'm not really sure it's implemented, there's a talk about that in this thread.

The easiest way to get files is just to do :

Code:
http://ip:port/vfs/special://masterprofile/Thumbnails/Music/c/cf23dc2e.tbn
and you got the file Smile

As you will have others missing things in the json implementation, if you want to do all the things others do, you will more or less need http api for the moment and wait for topfs to come back and finish the json part.


- topfs2 - 2010-07-17

Yeah, terribly sorry but I have been silly busy with other things (GSoC mostly) but I will return and do much more on the jsonrpc at some point, probably this fall.

Regarding File.Download, it just takes a string as parameter not a string array. (Not sure if this is outside jsonrpc spec. :S).
Code:
"{ jsonrpc":"2.0", "method":"Files.Download","params": "special://masterprofile/Thumbnails/Music/c/cf23dc2e.tbn", "id":1 }

But as Tolriq said, this method will just tell you how to download and with the http server its already extremely standardized how it handles it but on the RAW TCP socket it might need to open up a new port for the transfer (like ftp) so those other transports might need to be poked before the download could be initialized, so its mostly a way of future proofing the solution.

Cheers,
Tobias


- dstruktiv - 2010-07-17

Thanks a lot for the responses I really appreciate it Smile

Having a problem with vsf now Sad - Thumbnail location is pulled from current song being played and spliced in to a URL:

http://127.0.0.1:80/vsf/special://masterprofile/Thumbnails/Music/7/75fd6b81.tbn

Response is: File not found

But on my PC C:\Users\Tyler\AppData\Roaming\XBMC\userdata\Thumbnails\Music\7\75fd6b81.tbn does exist.

And XBMC.log:

21:53:19 T:5400 M:2169430016 NOTICE: WebServer: GET | /vsf/special://masterprofile/Thumbnails/Music/7/75fd6b81.tbn
21:53:19 T:5400 M:2169430016 ERROR: WebServer: Failed to open special://xbmc/web/vsf/special://masterprofile/Thumbnails/Music/7/75fd6b81.tbn

Any ideas?


- Tolriq - 2010-07-17

Yes sorry my link was about using masterprofile with portable mode Smile

and it's vfs not vsf Smile

You can use :

http://127.0.0.1/vfs/special://userprofile/Thumbnails/Music/7/75fd6b81.tbn

For the moment i don't know how to get currently logged profile with json (one the multiple missing things Smile ).

For Yatse, i finally go for an hybrid plugin, using http api for getting data dans /vfs to donwload image at the base64 encoding in http api really sucks and slow things down.


- topfs2 - 2010-07-17

Tolriq Wrote:Yes sorry my link was about using masterprofile with portable mode Smile

and it's vfs not vsf Smile

You can use :

http://127.0.0.1/vfs/special://userprofile/Thumbnails/Music/7/75fd6b81.tbn

For the moment i don't know how to get currently logged profile with json (one the multiple missing things Smile ).

System.GetInfoLabels (with a string array) and then use http://wiki.xbmc.org/index.php?title=InfoLabels

example:
Code:
{ "jsonrpc": "2.0", "method": "System.GetInfoLabels", "params": ["System.ProfileName"], "id": 1 }

Ideally it should probably be moved to XBMC.GetInfoLabels but we just branched, need to discuss abit internally if its sane to move

Tolriq Wrote:For Yatse, i finally go for an hybrid plugin, using http api for getting data dans /vfs to donwload image at the base64 encoding in http api really sucks and slow things down.

This is probably the best solution so far, and httpapi will easily stay until jsonrpc can do everything httpapi can, probably even one release with them both equal before retireing it is even an option Smile


- marksoccer - 2010-07-18

Is there a way to get a sorted list of artists based on artist name (rather than artistid) without manually sorting after receiving the json string?

Also, if I decided to add some features and submit them in a patch (and stuff worked correctly), would my patch be accepted?


- jmarshall - 2010-07-18

We can't say one way or the other without seeing the patch. It will certainly be considered.

Cheers,
Jonathan