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 - 2012-03-05

In general JSON-RPC should always provide the same thumbnail as visible in the GUI except when there is no thumbnail (and the GUI shows a default album) or if the song is played through a plugin. There is no logic in XBMC that automatically retrieves an album cover if there is none during playback.


- jimk72 - 2012-03-06

Ok I'll look into it more. I never noticed it untill I ran them side by side to check latency from xbmc to my remote program.


- jimk72 - 2012-03-07

after further testing I have found those songs when selected using xbmc there is no thumb so the DB has no entry for that song but if my program tells xbmc to play it using the song ID a thumb shows up in xbmc but no thumb is sent when requesting it. What I think may be happening is the mp3 files this happens on are around 3-4mb more than the rest and I believe they have imbeded thumbnails. I think xbmc reads the tag of the file and displays the image when just playing but if selected from library no image shows.

more testing i found:
If I play the song from the library no image shows up but using files the album image shows up.

I am not sure how many people have mp3s with embeded album thumbs in them so It may be no big deal.

I have over 25,000 and there are only about 30 that I found that did this.


- dmogle - 2012-03-07

Sorry if this question has been asked elsewhere, hours of searching have yielded no results. I'm poking around the jsonrpc api over tcp on a Dharma install (still jsonrpc v2) and I can use all the commands without username/password authentication. Is this the intended functionality or do I have something weird in my settings that's allowing un-authenticated clients access? Thanks in advance.

EDIT: In case it's helpful, here's what I get when running jsonrpc.permission:

{"jsonrpc":"2.0","id":1,"method":"jsonrpc.permission"}
{
"id" : 1,
"jsonrpc" : "2.0",
"result" : {
"ControlAnnounce" : true,
"ControlPlayback" : true,
"ControlPower" : true,
"Logging" : true,
"ReadData" : true,
"ScanLibrary" : true
}
}


- Montellese - 2012-03-07

jimk72 Wrote:after further testing I have found those songs when selected using xbmc there is no thumb so the DB has no entry for that song but if my program tells xbmc to play it using the song ID a thumb shows up in xbmc but no thumb is sent when requesting it. What I think may be happening is the mp3 files this happens on are around 3-4mb more than the rest and I believe they have imbeded thumbnails. I think xbmc reads the tag of the file and displays the image when just playing but if selected from library no image shows.

more testing i found:
If I play the song from the library no image shows up but using files the album image shows up.

I am not sure how many people have mp3s with embeded album thumbs in them so It may be no big deal.

I have over 25,000 and there are only about 30 that I found that did this.
Thanks for this very thorough investigation. Looks like it's a problem in XBMC in general that the embedded covers are not always retrieved. Can you create a feature request ticket (or is it a bug, I'm not sure myself) to improve handling of embedded covers? If they would be extracted as soon as an album is added to the music library they could be used by JSON-RPC as well.

dmogle Wrote:Sorry if this question has been asked elsewhere, hours of searching have yielded no results. I'm poking around the jsonrpc api over tcp on a Dharma install (still jsonrpc v2) and I can use all the commands without username/password authentication. Is this the intended functionality or do I have something weird in my settings that's allowing un-authenticated clients access? Thanks in advance.

The only authentication you can enable right now (both in Dharma and in Eden) is when accessing the webserver itself (see Settings -> Network). But in that case you will have to authenticate every access to the webserver whether it is to access a webinterface or use JSON-RPC. I have plans to implement some kind of authentication for JSON-RPC which will allow a client to specify which permissions it requires and then prompt the user with the possibility to accept or reject a client. But that probably won't even make it into Eden+1 (although I already have done a lot of work for it).


- joZ666 - 2012-03-10

devastator83 Wrote:Hi,

I love the 'new' JSON API! At the moment I am writing a script for my Philips Pronto remote control.

Whenever it 'wakes up' from sleep, I have to do 3 requests:
1) GetActivePlayer: to check if the active player has changed while the remote was sleeping
2) Player.GetProperties (if 1 returned a player): to get the player status
3) Player.GetItem: to check if the played video/song changed.

It would be handy if I could do this with 1 or 2 calls only.
GetActivePlayer could e.g. return the speed and the library id of the currently played item.

I cache the library item id to check if the playback item has changed, in which case I download the new data with Player.GetItem.

Or does such a call already exist to fit my needs ?

Thanks for your work !

I'd love to get a copy of a script for the pronto. Been searching and trying to program something myself, but I suck at it. heck I can't even get on way IP working.
if someone got a working .xcf I'd be stoked if you could mail it to me.

[email protected]

/joZ666


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Goersch - 2012-03-12

Hi,

sorry, about this easy question; but I'm just starting to dig into the json-rpc interface of XMBC
and didn't get any info on the other forum yet.

I would like to get/read the active WindowID. All I found was one question about the WindowID from last september here in this thread, but there was no more information till then.

Do I have the possibility to get the current WindowID via json-rpc ? If yes, what kind of call would I have to do ?

Thanks !
Georg


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-03-12

(2012-03-12, 21:15)Goersch Wrote: Do I have the possibility to get the current WindowID via json-rpc ? If yes, what kind of call would I have to do ?

Currently there's no way to retrieve the ID of the currently active window in XBMC through JSON-RPC but there will be in the future.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Goersch - 2012-03-13

Ok, thanks for the information Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - mzanetti - 2012-03-16

Hi, am I doing something wrong or is this a bug?

This works:
Code:
{ "id" : 35, "jsonrpc" : "2.0", "method" : "Playlist.Add", "params" : { "item" : { "file" : "/path/to/some/file.ogg" }, "playlistid" : 0 } }

But this fails with "Invalid parameter"
Code:
{ "id" : 18, "jsonrpc" : "2.0", "method" : "Playlist.Add", "params" : { "item" : { "directory" : "/path/to/some/dir/" }, "playlistid" : 0 } }

According to the introspect, directory should be valid for Playlist.Item.

Thanks


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-03-16

It returns Invalid Parameter if there is no valid file in the directory you provided does not contain any playable files.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - MindTooth - 2012-03-16

Can I ask a humble question on why this isn't working:
Code:
{"jsonrpc" : "2.0", "method" : "VideoLibrary.GetSeasons", "params" : { "properties": [ "season", "showtitle" ], "tvshowid" : 50}, "id" : 1}
Trying to display the seasons of Dexter which are the tvshowid 50.

Any help is greatly appreciated Big Grin


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-03-16

What is the response you get? An error or an empty list or something else? Does VideoLibrary.GetEpisodes return a list of episodes for that tvshowid?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Amboss - 2012-03-16

(2012-03-16, 00:17)Montellese Wrote: It returns Invalid Parameter if there is no valid file in the directory you provided does not contain any playable files.

Should a directory not be considered a "valid file" in this context? If you arrange albums in directories there will not be a vaild file in the album directory as all titles will stay in the subdirectory if there is more than one CD to an album.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - MindTooth - 2012-03-16

Response:
Code:
{"id":1,"jsonrpc":"2.0","result":{"limits":{"end":0,"start":0,"total":0}}}

Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodes", "params": { "properties": ["title"], "tvshowid": 50}, "id": 1}
Gives the same response above.

Code:
{"jsonrpc" : "2.0", "method" : "VideoLibrary.GetTVShows", "id" : 1}
Gives:
Code:
{"id":1,"jsonrpc":"2.0","result":{"limits":{"end":51,"start":0,"total":51},"tvshows":[{"label":"A History of Scotland","tvshowid":65},{"label":"American Chopper: Senior vs Junior","tvshowid":64},{"label":"Archer (2009)","tvshowid":63},{"label":"Being Human","tvshowid":61},{"label":"Boardwalk Empire","tvshowid":60},{"label":"Breaking Bad","tvshowid":59},{"label":"Breakout Kings","tvshowid":57},{"label":"British Masters","tvshowid":70},{"label":"Californication","tvshowid":56},{"label":"Castle (2009)","tvshowid":54},{"label":"Cougar Town","tvshowid":51},{"label":"Dexter","tvshowid":50},{"label":"Face Off","tvshowid":48},{"label":"Fringe","tvshowid":45},{"label":"Game of Thrones","tvshowid":44},{"label":"Halo Legends","tvshowid":42},{"label":"Hawaii Five-0 (2010)","tvshowid":41},{"label":"Homeland","tvshowid":138},{"label":"House","tvshowid":40},{"label":"How the States Got Their Shapes","tvshowid":84},{"label":"Justified","tvshowid":36},{"label":"Leverage","tvshowid":35},{"label":"Lost Girl","tvshowid":33},{"label":"Merlin (2008)","tvshowid":32},{"label":"Monty Python: Almost The Truth (The Lawyer's Cut)","tvshowid":31},{"label":"Nikita","tvshowid":29},{"label":"Psych","tvshowid":26},{"label":"Republic of Doyle","tvshowid":25},{"label":"Restoration Home","tvshowid":24},{"label":"Richard Hammond's Journey To...","tvshowid":67},{"label":"Ringer","tvshowid":200},{"label":"Rising Rebuilding Ground Zero","tvshowid":95},{"label":"Royal Pains","tvshowid":23},{"label":"Sons of Anarchy","tvshowid":96},{"label":"Supernatural","tvshowid":20},{"label":"Teen Wolf","tvshowid":19},{"label":"The Big Bang Theory","tvshowid":18},{"label":"The Borgias","tvshowid":17},{"label":"The Impressionists Painting and Revolution","tvshowid":97},{"label":"The Killing (2011)","tvshowid":15},{"label":"The Mentalist","tvshowid":14},{"label":"The Restoration Man","tvshowid":201},{"label":"The Secret Circle","tvshowid":195},{"label":"The Vampire Diaries","tvshowid":11},{"label":"The Walking Dead","tvshowid":10},{"label":"Top Gear","tvshowid":8},{"label":"Transformers","tvshowid":7},{"label":"Warehouse 13","tvshowid":5},{"label":"Weeds","tvshowid":4},{"label":"White Collar","tvshowid":3},{"label":"XIII (2011)","tvshowid":2}]}}