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)



- Fiasco - 2011-03-16

I want to query for my movie list

{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "start": 0, "end": 100, "sortorder":"ascending", "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating"] }, "id": 1}

Is there anyway to only query for movies of a particular genre? Or to sort by the date the movies were added to the database? Or to search for movies that contain a string in their title? Or the MPAA rating?

Is there a complete list of the GetMovies "fields" available somewhere?


- wuench - 2011-03-17

Fiasco Wrote:I want to query for my movie list

{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": { "start": 0, "end": 100, "sortorder":"ascending", "fields": ["genre", "director", "trailer", "tagline", "plot", "plotoutline", "title", "originaltitle", "lastplayed", "showtitle", "firstaired", "duration", "season", "episode", "runtime", "year", "playcount", "rating"] }, "id": 1}

Is there anyway to only query for movies of a particular genre? Or to sort by the date the movies were added to the database? Or to search for movies that contain a string in their title?

Is there a complete list of the GetMovies "fields" available somewhere?

I think the source for the fields are from /xbmc/video/videoinfotag.cpp


- Fiasco - 2011-03-18

{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieInfo", "params": {"movieid": 5} , "id" : 1}

Is this not the proper way to pull info on a single movie (I get a method not found error)


- Montellese - 2011-03-18

Fiasco Wrote:Is there anyway to only query for movies of a particular genre?
No currently not.

Fiasco Wrote:Or to sort by the date the movies were added to the database?
I have a list of all valid sort values somewhere but I'll have to digg it up first. The parameter name for the sort value is "sortmethod".

Fiasco Wrote:Or to search for movies that contain a string in their title?
No.

Fiasco Wrote:Or the MPAA rating?
MPAA rating can be retrieved with the "mpaa" field.

Fiasco Wrote:Is there a complete list of the GetMovies "fields" available somewhere?
I have such a list somewhere as well but I'll have to dig it up as well.

Fiasco Wrote:{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieInfo", "params": {"movieid": 5} , "id" : 1}

Is this not the proper way to pull info on a single movie (I get a method not found error)

Which version of XBMC are you using? Dharma (and 10.1) does not provide a method to query a single movie by ID. The source code and therefore the nightly builds contain a "VideoLibrary.GetMovieDetails" method which will serve this purpose.


- Fiasco - 2011-03-18

Thanks Montellese,

Is a search function planned?

Thanks

Montellese Wrote:No currently not.


I have a list of all valid sort values somewhere but I'll have to digg it up first. The parameter name for the sort value is "sortmethod".


No.


MPAA rating can be retrieved with the "mpaa" field.


I have such a list somewhere as well but I'll have to dig it up as well.



Which version of XBMC are you using? Dharma (and 10.1) does not provide a method to query a single movie by ID. The source code and therefore the nightly builds contain a "VideoLibrary.GetMovieDetails" method which will serve this purpose.



- Montellese - 2011-03-18

Fiasco Wrote:Is a search function planned?

Currently not but Feature Request tickets on Trac are always welcome.
We can't promise to implement them all or when they will be implemented but without a ticket they will surely be forgotten soon.


- carmenm - 2011-03-19

Hi,

i started working on open source remote for iphone. I got json rpc to work correctly. Now i ahave a few questions:
- is there a method to now if xbmc is currently scanning for content? I ask because i would like to know when a scan has finished (notification)
- As i said i am just starting, and i am thinking about how i am gonna update the database on the iphone. Is there any way to get all the changes since a specific date? that way i could store the last update date. If not what is the best way to do that.
- about now playing: the way to get the current infos is to get the playlist, then the current item? My problem with that is that i dont see how to get info about the current item after that. So it must not be the right solution Confused

That s it for now.
Sorry, i am a noob with json

Thanks


- topfs2 - 2011-03-19

JSON RPC does not send on start or stop of scan, version 3 does send when content alters in the library. You will get an added and an deletion notification.

Start and stop of scan is not relevant information as the server may not have a scan process really (in the future we might use inotify and don't really scan but when a new movie appears on the disk we do a scrape and we are done.) i.e. the client does not need to know the nitty gritty details for any particular reason. (atleast AFAICT)


- carmenm - 2011-03-19

what is version 3?


- topfs2 - 2011-03-19

version 2 is in dharma, version 3 is in trunk and version 4 will be in eden.

(odd numbers are development and even are release versions)


- carmenm - 2011-03-19

Nice! So if i use the trunk i can get content alteration alerts?
If so is there any example somewhere on how to do that?

Thanks


- topfs2 - 2011-03-19

THey aren't documented yet, I hope we will be able to fit that into the new schema montellese is working on, otherwise we'll add them to the wiki.

Connect to xbmc via telnet localhost 9090 (not 100% sure on the syntax of it) and start a scan and you'll see the notifications.


- Fiasco - 2011-03-19

Do "remote button" functions exist yet (menu, up, down, left, right, ok, rewind, ect) in JSON?


- Montellese - 2011-03-19

Fiasco Wrote:Do "remote button" functions exist yet (menu, up, down, left, right, ok, rewind, ect) in JSON?

No they don't. I think there's already a feature request for that though.


- wuench - 2011-03-19

Montellese Wrote:No they don't. I think there's already a feature request for that though.

There is a ticket for navigation commands.