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)



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - bradvido88 - 2012-11-09

Thanks, I figured it out now. The problem was I was querying an old video...

Another question: When using VideoLibrary.SetMovieDetails and setting the "tag"... the tags that I specify in the String[] always get unioned with the existing tags for the movie (instead of replacing the existing tags). This is undesirable.
As far as I know, there is no way to delete a tag, and I would expect a Setblahblah() method to just replace what is already there instead of unioning the tags.

We would either need a way to delete tag links or to fix this method so it works as i described.




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

The tag behaviour is a limitation right now because scrapers do not support them. If we would delete the tags associated with a media item before any update it would result in the loss of tags on every re-scrape of a media file which is certainly not what the user wants/expects. I agree that when using the SetFooDetails methods from JSON-RPC that it should replace and not append to existing tags.


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

I worked around the limitation and should be fixed with https://github.com/xbmc/xbmc/commit/8c7f319f7e0e6c64adb0489a1eb2e7267ebdd900


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - VeeV - 2012-11-11

Is there a way to get the Banner Thumbnail for the TvShows in API v5? So far Thumbnail give me the poster.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Martijn - 2012-11-11

(2012-11-11, 17:39)VeeV Wrote: Is there a way to get the Banner Thumbnail for the TvShows in API v5? So far Thumbnail give me the poster.

use the "art" property


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

(2012-11-10, 09:51)Montellese Wrote: I worked around the limitation and should be fixed with https://github.com/xbmc/xbmc/commit/8c7f319f7e0e6c64adb0489a1eb2e7267ebdd900

Thanks Montellese. The fix looks good. I'll test it out when I update my build!


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

(2012-11-11, 17:44)Martijn Wrote:
(2012-11-11, 17:39)VeeV Wrote: Is there a way to get the Banner Thumbnail for the TvShows in API v5? So far Thumbnail give me the poster.

use the "art" property

Thanks, I just missed this one Smile


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

I've now switched to using the JSON-RPC interface for updating library video titles (previously using direct sql updates).
However, this is much slower, ~4 seconds.

In looking at the XBMC log, I see why. When i call VideoLibrary.SetEpisodeDetails, XBMC refreshes every part of the episode (not just the parts I specified in params) including actor/director/writer links.

Is this intentional or a bug? Or is there something wrong with my method call params?

Code:
14:05:45 T:13392   DEBUG: webserver: request received for /jsonrpc
14:05:45 T:13392   DEBUG: JSONRPC: Incoming request: {"jsonrpc": "2.0", "method": "VideoLibrary.SetEpisodeDetails", "params": {"episodeid":1059, "title":"(H) Going Under"}, "id": "1"}
14:05:45 T:13392   DEBUG: JSONRPC: Calling videolibrary.setepisodedetails
14:05:45 T:13392   DEBUG: JSONRPC: Type mismatch in type
14:05:45 T:13392   DEBUG: Mysql Start transaction
14:05:45 T:13392   DEBUG: Mysql execute: delete from actorlinkepisode where idEpisode=1059
14:05:45 T:13392   DEBUG: Mysql execute: delete from directorlinkepisode where idEpisode=1059
14:05:45 T:13392   DEBUG: Mysql execute: delete from writerlinkepisode where idEpisode=1059
14:05:46 T:13392   DEBUG: Mysql execute: delete from streamdetails where idFile=1705
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/38331.jpg</thumb>' where idActor=5703
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/38331.jpg' where art_id=3132
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5703,1059,'',0)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://cf2.imgobject.com/t/p/original/kITkYMh1VZgHSAMlMxsZ6jaUF7C.jpg</thumb>' where idActor=3911
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://cf2.imgobject.com/t/p/original/kITkYMh1VZgHSAMlMxsZ6jaUF7C.jpg' where art_id=3121
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(3911,1059,'',1)
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(6075,1059,'',2)
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(2650,1059,'',3)
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(6050,1059,'',4)
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(6076,1059,'',5)
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5457,1059,'',6)
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(3172,1059,'',7)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/38330.jpg</thumb>' where idActor=5689
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/38330.jpg' where art_id=3115
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5689,1059,'Michael Scofield',8)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://cf2.imgobject.com/t/p/original/xvVfyCCFhmBTWL0eTIkGRfqsPQH.jpg</thumb>' where idActor=3665
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://cf2.imgobject.com/t/p/original/xvVfyCCFhmBTWL0eTIkGRfqsPQH.jpg' where art_id=1111
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(3665,1059,'Lincoln Burrows',9)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/38329.jpg</thumb>' where idActor=4337
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/38329.jpg' where art_id=3116
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(4337,1059,'Dr. Sara Tancredi',10)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/92101.jpg</thumb>' where idActor=5690
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/92101.jpg' where art_id=3117
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5690,1059,'Wyatt',11)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/92091.jpg</thumb>' where idActor=453
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/92091.jpg' where art_id=3118
14:05:46 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(453,1059,'Roland Glenn',12)
14:05:46 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://cf2.imgobject.com/t/p/original/A0BkWq6d72Pl5mFBK05ZfuBDuWH.jpg</thumb>' where idActor=2422
14:05:46 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://cf2.imgobject.com/t/p/original/A0BkWq6d72Pl5mFBK05ZfuBDuWH.jpg' where art_id=641
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/78009.jpg</thumb>' where idActor=5693
14:05:47 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/78009.jpg' where art_id=3122
14:05:47 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5693,1059,'Gretchen Morgan (Susan B. Anthony)',16)
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/78008.jpg</thumb>' where idActor=5694
14:05:47 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/78008.jpg' where art_id=3123
14:05:47 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5694,1059,'Norman “Lechero” St. John',17)
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/78007.jpg</thumb>' where idActor=5695
14:05:47 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/78007.jpg' where art_id=3124
14:05:47 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5695,1059,'Benjamin Miles “C-Note” Franklin ',18)
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://cf2.imgobject.com/t/p/original/fLeX81BNscc9EzDPAr2sEhdzA7n.jpg</thumb>' where idActor=531
14:05:47 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://cf2.imgobject.com/t/p/original/fLeX81BNscc9EzDPAr2sEhdzA7n.jpg' where art_id=119
14:05:47 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(531,1059,'Alexander \"Alex\" Mahone',19)
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/77837.jpg</thumb>' where idActor=5696
14:05:47 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/77837.jpg' where art_id=3125
14:05:47 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5696,1059,'Sofia Lugo',20)
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/77836.jpg</thumb>' where idActor=5511
14:05:47 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/77836.jpg' where art_id=3024
14:05:47 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(5511,1059,'Theodore \"T-Bag\" Bagwell',21)
14:05:47 T:13392   DEBUG: Mysql execute: update actors set strThumb='<thumb>http://thetvdb.com/banners/actors/145091.jpg</thumb>' where idActor=5697
14:05:48 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/actors/144371.jpg' where art_id=3133
14:05:48 T:13392   DEBUG: Mysql execute: insert into actorlinkepisode (idActor, idEpisode, strRole, iOrder) values(4168,1059,'Lisa Tabak',30)
14:05:48 T:13392   DEBUG: Mysql execute: insert into writerlinkepisode (idWriter,idEpisode) values(6077,1059)
14:05:48 T:13392   DEBUG: Mysql execute: insert into directorlinkepisode (idDirector,idEpisode) values(5948,1059)
14:05:48 T:13392   DEBUG: Mysql execute: UPDATE art SET url='http://thetvdb.com/banners/episodes/75340/389989.jpg' where art_id=3215
14:05:48 T:13392   DEBUG: Mysql execute: update episode set c00='(H) Going Under',c01='Michael gets medical attention from the most unlikely of places, and Charles Westmoreland returns to help uncover the true meaning of Scylla. Meanwhile, Lincoln and Sucre race to stop Gretchen before Scylla is lost forever.',c02='',c03='7.700000',c04='Zach Estrin',c05='2008-12-15',c06='<thumb>http://thetvdb.com/banners/episodes/75340/389989.jpg</thumb>',c07='',c08=NULL,c09='60',c10='Karen Gaviola',c11='',c12='4',c13='15',c14='',c15='-1',c16='-1',c17='-1',c18='smb://ONYX/StreamingVideos/TV Shows/Prison.Break/Season.4/S04E15 - Going Under.strm',c19='209',c20='389989' where idEpisode=1059
14:05:48 T:13392   DEBUG: Mysql commit transaction



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

That's how updating information in XBMC currently works in general. If you update a movie, it will update all the information available for that movie even if only one value changed.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - yumcimil - 2012-11-17

I've just switched to using JSON for control of XBMC via iRule. Previously I was sending keypresses via the HTTP API so that I could combine GUI navigation and seeking in the same command, which switched depending on the context - Up/Seek10+ etc.., same as the standard remote behaviour - I can't work out a way to do this using the new API - is there something I've missed?


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - VeeV - 2012-11-18

The [Files.GetDirectory] doesn't seems to accept "art" as parameters (Invalid params). I thought it should as [List.Item.All] extends [Video.Details.File] ? Am I missing something?


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

Thanks for the report. It's missing in http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v5#List.Fields.Files so you get an error when requesting it.


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

Fixed in https://github.com/xbmc/xbmc/commit/7ec59c27a01cd5bad789d4fbbcf1e1b787fb0172.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - VeeV - 2012-11-19

Ok, I think the same is happening with channel, channeltype, hidden, locked, endtime, channelnumber, tag, starttime. Might be worth double checking it.


AW: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Montellese - 2012-11-19

I've added "tag" with that commit as well so that should be fixed. The PVR channel related properties aren't available because they don't make any sense on file level.

If they are listed as returned properies I'll remove them from there.