Kodi Community Forum
JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Development (/forumdisplay.php?fid=32)
+--- Forum: Development (/forumdisplay.php?fid=93)
+---- Forum: JSON-RPC (/forumdisplay.php?fid=174)
+---- Thread: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC (/showthread.php?tid=68263)



- noem - 2011-04-12 16:35

thx for the replay I got this from introspect:
Code:
"VideoPlaylist.Add" : {
            "description" : "Add item(s) to playlist",
and I thought it was working.


- Montellese - 2011-04-12 16:47

noem Wrote:thx for the replay I got this from introspect:
Code:
"VideoPlaylist.Add" : {
            "description" : "Add item(s) to playlist",
and I thought it was working.

Thx for the hint, I will have to fix that description. If you stumble upon any other odd descriptions please let us know. We didn't have the time yet to provide detailed descriptions for all of the methods, parameters and possible values but we hope that the now introspect layout (json schema) already helps a lot in determining how a method should/can be called.


- noem - 2011-04-12 16:50

sure no problem Im building a project based on the new RPC api so I will indeed let you know.


Announcement - noem - 2011-04-12 18:09

Is there any way of getting the complete list of xbmc Announcements that xbmc sends?


- topfs2 - 2011-04-12 18:14

For eden we hope to have it in the introspect at some point but easiest for now is git grep CAnnouncementManager::Announce


- noem - 2011-04-12 18:40

excellent thank you Smile


- marksoccer - 2011-04-13 01:48

Does anyone know anything about artist fanart? I alway get a valid looking value back for fanart, but sometimes, it points to a .tbn that doesn't exist. Even when I look in the GUI or the userdata folder, I can't find the tbn returned by the JSON method. I do, however, get a blank string when an artist thumbnail doesn't exist. Is there some way we can fix this? Even if it is a problem with the larger XBMC codebase, can we at least check if the file exists before sending the string via JSON so I don't have to query the server for an image that doesn't exist?


- marksoccer - 2011-04-13 01:49

Montellese Wrote:Thanks again for the report. You were right about the "item" and I fixed it in https://github.com/xbmc/xbmc/commit/db9d7e5fd4b15fda5f7539e9f40def063fd7af05. Please report back whether it works for you as well (I tested it for artistid and albumid).

Thanks Smile It works great!


- marksoccer - 2011-04-13 07:17

Also, what happened to the songid stuff? I thought I remember seeing songid as part of Playlist.Audio.Item, but I don't see it there now. How do I add a single song to the current playlist? I see AudioPlaylist.Play, but when I pass a songid, I get success:false


- Montellese - 2011-04-13 07:46

marksoccer Wrote:Does anyone know anything about artist fanart? I alway get a valid looking value back for fanart, but sometimes, it points to a .tbn that doesn't exist. Even when I look in the GUI or the userdata folder, I can't find the tbn returned by the JSON method. I do, however, get a blank string when an artist thumbnail doesn't exist. Is there some way we can fix this? Even if it is a problem with the larger XBMC codebase, can we at least check if the file exists before sending the string via JSON so I don't have to query the server for an image that doesn't exist?
There's already a bug ticket for this issue. It's not a given that any paths returned by JSON RPC actually exist but there's no way of determining that right now :Sad:

marksoccer Wrote:Also, what happened to the songid stuff? I thought I remember seeing songid as part of Playlist.Audio.Item, but I don't see it there now. How do I add a single song to the current playlist? I see AudioPlaylist.Play, but when I pass a songid, I get success:false
I'll have to look at that when I get home, can't remember if there was a reason why I removed it.


- noem - 2011-04-13 11:22

strage... or not ? Wink
JSON:
Code:
{"method":"AudioLibrary.GetArtists","id":23,"jsonrpc":"2.0","params":{"fields":["style","instrument","mood","born","formed","genre","died","disbanded","yearsactive","fanart","thumbnail"]}}}

response:
Code:
"artist" : "Ravel",
            "artistid" : 390,
            "born" : "",
            "died" : "",
            "disbanded" : "",
            "fanart" : "special://masterprofile/Thumbnails/Music/Fanart/8ff641c6.tbn",
            "formed" : "",
            "genre" : "Latin",
            "instrument" : "Producer",
            "label" : "Ravel",
            "mood" : "",
            "style" : "Tropical",
            "yearsactive" : "90's/2000's"

introspect descr:
PHP Code:
{
                  
"items" : {
                     
"enums" : [
                        
"instrument",
                        
"style",
                        
"mood",
                        
"born",
                        
"formed",
                        
"description",
                        
"genre",
                        
"died",
                        
"disbanded",
                        
"yearsactive",
                        
"musicbrainzartistid",
                        
"fanart",
                        
"thumbnail"
                     
],
                     
"type" "string" 
Where is the thumbnail field ? Smile


- Montellese - 2011-04-13 12:12

noem Wrote:Where is the thumbnail field ? Smile

Currently the "thumbnail" field has to be handled different than most other fields in the code and the way it is currently coded the "thumbnail" field is only returned if it is requested in the "fields" array AND if it has a value. So it seems that in your case there is no thumbnail for that artists and that's why the "thumbnail" portperty does not appear in the response. But for the sake of uniformity I might change it so that it is returned on request independent of whether it has a value or not.

Another approach would be to drop all the requested fields which don't have a value set like in your example born, died, disbanded, formed and mood but I don't really like that. If a client requests a field it should be returned no matter what (so even if it is empty).


- noem - 2011-04-13 12:55

Thx for the replay Smile got something else nowSmile

Code:
{"method":"Files.GetSources","id":101,"jsonrpc":"2.0","params":{"media":"files"}}

returns:
Code:
{
   "id" : 101,
   "jsonrpc" : "2.0",
   "result" : {
      "limits" : {
         "end" : 1,
         "start" : 0,
         "total" : 1
      },
      "shares" : [
         {
            "label" : "Media"
         }
      ]
   }
}

now I won't too use Files.GetDirectory wich requires "directory:"\path\" but I dont get the path from GetSources ....


- Montellese - 2011-04-13 13:03

That's a bug as it should return a "file" property for every share. Please create a bug ticket and CC me so I don't forget about it. I think a recent change caused this to break but should be pretty easy to solve.

Please also create a bug ticket (with me on CC) for the "thumbnail" property not turning up all the time otherwise I might forget about that one as well.


- noem - 2011-04-13 14:19

Just wondering are movie collections going to be supported by JSON in eden?