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)



- ErlendSB - 2012-02-13

Sounds perfect.

I'll keep any eye on the Introspect Nerd


- Montellese - 2012-02-13

Hehe usually I announce all (semi-)major additions/changes in here. But that stuff isn't going to be available until after Eden has been released.


Playlist.GetPlaylists - doozer - 2012-02-14

I'm trying to get a list of all playlists, including user created ones:

Code:
{"jsonrpc": "2.0", "method": "Playlist.GetPlaylists", "id": "Playlist.GetPlaylists"}

But even though I have a user created .m3u playlist, I only get:
Code:
{"id":"Playlist.GetPlaylists","jsonrpc":"2.0","result":[{"playlistid":0,"type":"audio"},{"playlistid":1,"type":"video"},{"playlistid":2,"type":"picture"}]}

Is there another request I should be sending to see the custom playlists, as I seem to only get the system defined ones?

Thanks,
Matt.


VideoLibrary.GetMovies filter by genreid - doozer - 2012-02-14

Hi All,

Anyone know how to request a list of movies in the library that match a genreid?

Thanks,
Matt.


- mikebzh44 - 2012-02-14

doozer Wrote:I'm trying to get a list of all playlists, including user created ones:

Code:
{"jsonrpc": "2.0", "method": "Playlist.GetPlaylists", "id": "Playlist.GetPlaylists"}

But even though I have a user created .m3u playlist, I only get:
Code:
{"id":"Playlist.GetPlaylists","jsonrpc":"2.0","result":[{"playlistid":0,"type":"audio"},{"playlistid":1,"type":"video"},{"playlistid":2,"type":"picture"}]}

Is there another request I should be sending to see the custom playlists, as I seem to only get the system defined ones?

Thanks,
Matt.
Hello.

I have post the same question few days ago Wink

Here is the response of Montellese : http://forum.xbmc.org/showpost.php?p=1013421&postcount=1680


- doozer - 2012-02-14

mikebzh44 Wrote:Hello.

I have post the same question few days ago Wink

Here is the response of Montellese : http://forum.xbmc.org/showpost.php?p=1013421&postcount=1680

Thanks for the heads up. Crazy searching for answers in 170 pages of replies!


- mikebzh44 - 2012-02-14

Hello.

I'm using this request :

Code:
json_query = xbmc.executeJSONRPC('{"jsonrpc": "2.0", "method": "Files.GetDirectory", "params": {"directory": "special://profile/playlists/video/cartoons.xsp", "media": "video", "properties": ["originaltitle"]}, "id": 1}')

But I have a warning in the log :

Code:
WARNING: CUtil::GetMatchingSource... no matching source found for [special://profile/playlists/video/cartoons.xsp]

But request's result is OK.

Is it due to Beta 3 ?


- Montellese - 2012-02-14

That warning might be because I added checks so you can't access locked sources through JSON-RPC until you unlocked them in XBMC GUI. For that I added a call to CUtil::GetMatchingSource(). Just ignore the warning. Will see if I can get rid of it for JSON-RPC.


- mikebzh44 - 2012-02-14

Thanks.


- mikebzh44 - 2012-02-14

An other question.

If I want to count the number of movies watched and unwatched in a specific playlist, I have to :
- use Files.GetDirectory to retrieve all the movies from the playlist
- for each movie, I have to get playcount with VideoLibrary.GetMovieDetails
- if playcount = 0 so movie is unwatched, otherwise is watched

There is no way to put a filter on the playlist to get only unwatched movies or watched movies ?

Sorry if it's a silly question Sad


- Montellese - 2012-02-14

No there is no filtering (yet, but for Files.GetDirectory there probably never will be because as the method name says it operates on files and not on a database). But you don't need the extra call to VideoLibrary.GetMovieDetails, you can retrieve the "playcount" property directly from Files.GetDirectory.


- mikebzh44 - 2012-02-14

On more time "Thank for the tip" !

I haven't notice that resume and playcount were inherited properties.


- spike411 - 2012-02-15

Hello,
would it be possible to add Player.Play and Player.Pause methods (in addition to Player.PlayPause) for "discrete" playback control (so clients don't have to "decide" depending on the player status)? If it makes any sense.

Thanks
(I hope such a request belongs here)


- Montellese - 2012-02-15

Such a feature request has been provided a week or two ago at http://trac.xbmc.org/ticket/12564. See the Trac ticket for information on how it will probably be implemented.


- Tolriq - 2012-02-15

About this ticket Smile

I've got a new need that comes with it, it was already discussed before i think but can't remember when, and get into this new need Sad

Do you think it's possible for some of the player operations to add the support of PlayerId -1 that will pause / play whatever is currently running, even if music and pictures are running ?

See : http://forum.xbmc.org/showthread.php?p=1018502#post1018502 for more details of why it may be needed.

One solution actually since playerid are limited to 1 2 3 is to send a batch of the 3 commands, but perhaps the -1 would be more coder friendly.