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)



- Montellese - 2011-04-13

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

Currently you can use an optional field to get the name of a movie set but nothing more.
What would you need? Methods to get all movie sets and all movies of a set like VideoLibrary.GetMovieSets() and VideoLibrary.GetMovieSetDetails()?


- noem - 2011-04-13

Montellese Wrote:Currently you can use an optional field to get the name of a movie set but nothing more.
What would you need? Methods to get all movie sets and all movies of a set like VideoLibrary.GetMovieSets() and VideoLibrary.GetMovieSetDetails()?

That would be awesome Nod
I will drop you a ticket for that.
Regards


- topfs2 - 2011-04-13

Montellese Wrote: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).

I vote for the latter, atleast thats the way I wanted it in the beginning. What I had in mind is that the client could do foo.isNull(). For sake of clarity I guess we could havethe return be:
Code:
"artist" : "Ravel",
            "artistid" : 390,
            "thumbnail" : null

If its omitted completely or set to null both are valid approaches IMO, just not "". Which do you think is best?

But if you push in unknown fields shouldn't it error even since its not in the enum with the new schema?


- carmenm - 2011-04-14

Hi,

I am seriously thinking of making TCP my main application interface with XBMC.
I want to do that because of annoucements. Thanks to them i might drop a timer that checks every second the state of the players Confused
So i have a feature request about it. right now we get messages like this
Quote: {"jsonrpc":"2.0","method":"Announcement","params":{"message":"PlaybackStopped","sender":"xbmc"}}
Could we get the concerned player in the data fields of params?

Thanks


- marksoccer - 2011-04-14

Does anyone have a method to play/add a single song (without using a filename) using the latest API?


- Montellese - 2011-04-15

For anyone using the new json rpc API:

I fixed the bug (http://trac.xbmc.org/ticket/11435) where Files.GetSources didn't return a "file" property and I also re-added "songid" to AudioPlaylist.Add()/Insert().


- marksoccer - 2011-04-15

Montellese Wrote:For anyone using the new json rpc API:

I fixed the bug (http://trac.xbmc.org/ticket/11435) where Files.GetSources didn't return a "file" property and I also re-added "songid" to AudioPlaylist.Add()/Insert().

Thanks. It works!


- hippojay - 2011-04-15

Hi,

Wheres the best place to make suggestions for JSON-RPC functionality? Here or is there a thread elsewhere?


- topfs2 - 2011-04-15

Well you can do it here but anywhere really, atleast if you want discussion. If its a sane feature you can also do it with feature request trac ticket, if possible give as much information as possible (method name, permissions needed what the parameters are.) essentially what is in the schema.


- mzanetti - 2011-04-17

Hi,

I'm having big troublies using the Files. namespace:

- I can successfully browse all the files. I can also use AudioPlaylist.Add using files I retrieved from the Files namespace and start playing it. However, when I add such a file to the Playlist, the playlist fails to deliver useful metadata for this file. Calls to AudioPlaylist.GetItems just returns a list of empty items. In this example you can see how I create a Playlist and try to retrieve metadata of the items afterwards (line 85): http://pastebin.com/9UJdiaMM
EDIT: I might add the xbmc itself does show valid metadata for those items in the playlist and the nowplaying view. It just fails to deliver those metadata through the json-api.

- Next problem is the playback of special files. For example I can browse the last.fm stuff using the Files namespace. But adding and playing back such an item fails

example:
<<< sending: "{"id": 27, "jsonrpc": "2.0", "method": "AudioPlaylist.Clear"}"
>>> Incoming: "{"id":27,"jsonrpc":"2.0","result":"OK"}"
<<< sending: "{"id": 28, "jsonrpc": "2.0", "method": "AudioPlaylist.Add", "params": {"item": {"file": "lastfm://user/mylastfmuser/personal"}}}"
>>> Incoming: "{"id":28,"jsonrpc":"2.0","result":"OK"}"

this results in the AudioPlaylist having one entry with no text label. Sending AudioPlaylist.Play(0) does nothing. Clicking on this item using the keyboard (or mouse or remote) throws an error message that the item cannot be played back.

Am I doing something wrong or is the Files namespace API not really complete yet?
Thanks


- slash - 2011-04-17

Hi,

Sorry if this has been already asked but I've wrote some code to add

VideoLibrary.GetMoviesGenres and wanted to know what is the best way to submit it (trac, patch files, etc ...)

Also, I'm willing to write some other Methods like:
- VideoLibrary.GetTVShowsGenres

And some Methods to integrate scraping into the web interface like :
- VideoLibrary.SetContent
- VideoLibrary.getContent


Let me know

Thanks in advance

slash


- Montellese - 2011-04-17

slash Wrote:Sorry if this has been already asked but I've wrote some code to add

VideoLibrary.GetMoviesGenres and wanted to know what is the best way to submit it (trac, patch files, etc ...)

Hey slash thanks for writing some code for JSON-RPC. The best way to submit patches is to go to github, get an account, fork the XBMC repo, apply your changes to your forked repo and then create a pull request. Sounds complicated but on github it's pretty easy.
Once you have a github account, go to the XBMC repo (https://github.com/xbmc/xbmc) and press the "Fork" button. This will create your own repo with XBMC's source code. Now clone your repo (git clone <your-github-url>), apply your changes, commit them (git commit) and then push them online (git push origin master). Once you have done that go back to your repository on github and press the "Pull Request" button. You'll be able to specify the commits you would like to include in your pull request and you can provide some description and then everyone of team xbmc with get notified about your pull request and someone (probably topfs2 or me) will take a look at it.

Thanks for your help.


- hippojay - 2011-04-17

topfs2 Wrote:Well you can do it here but anywhere really, atleast if you want discussion. If its a sane feature you can also do it with feature request trac ticket, if possible give as much information as possible (method name, permissions needed what the parameters are.) essentially what is in the schema.

Thanks - I was looking for more library modification features:
* VideoLibrary.setWatched/setPlaycount
* VideoLibrary.setResume

And the ability to pull out the resume time from the library ( so the addition of another field to videoLibrary.getmovies/getepisodes).

I want to provide as much info as possible, is there a template or something I could use to get this in a format you guys like for a trac?


- slash - 2011-04-17

Montellese Wrote:Hey slash thanks for writing some code for JSON-RPC. The best way to submit patches is to go to github, get an account, fork the XBMC repo, apply your changes to your forked repo and then create a pull request. Sounds complicated but on github it's pretty easy. (...) then everyone of team xbmc with get notified about your pull request and someone (probably topfs2 or me) will take a look at it.

Thanks for your help.

Thanks for little how-to Wink I will give it a shot.

cheers


- topfs2 - 2011-04-17

hippojay Wrote:Thanks - I was looking for more library modification features:
* VideoLibrary.setWatched/setPlaycount
* VideoLibrary.setResume

And the ability to pull out the resume time from the library ( so the addition of another field to videoLibrary.getmovies/getepisodes).

I want to provide as much info as possible, is there a template or something I could use to get this in a format you guys like for a trac?

not really, mostly common sense. What we are looking for is essentially what is in the schema.

As for setwatched and setplaycount (I guess setresume would fit in also) I'd suggest an entire Update which takes an ID and a lot of optional key, values. that way it would cover the entire editing of the library.