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 - Mizaki - 2012-05-14

Just had a quick look and recent episodes gave me
Code:
thumbnail: "image://http%3a%2f%2fthetvdb%2ecom%2fbanners%2fepisodes%2f248742%2f4293930%2ejpg"

I am right in thinking everything should still be local?



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

That got me confused at first as well. The new texture cache keeps track of images based on their original location and only caches an image (locally) if really necessary. So if you scrape an episode with TheTVDb, it will automatically get the episodes thumb from tvdb so the original location of that image is on thetvdb server so that's what XBMC uses to keep track of the image. When you request that image using the URI returned by JSON-RPC it will first check if the image is already cached. If that's the case it will return the cached image. Otherwise it will cache the image and then return it.


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - Mizaki - 2012-05-14

Ah, yes I see. Quick looks often result in fail Smile


RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2012-05-15

I'm having issues with the nightly builds (currently I am using the 12 May nightly build). I use Simple REST Client to do JSON testing in chrome, and it keeps giving me:
415 Unsupported Media Type

If I go back to the stable release of XBMC Eden, everything works fine.


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

(2012-05-15, 14:10)dwagner Wrote: I'm having issues with the nightly builds (currently I am using the 12 May nightly build). I use Simple REST Client to do JSON testing in chrome, and it keeps giving me:
415 Unsupported Media Type

If I go back to the stable release of XBMC Eden, everything works fine.

Please always first take a look at this thread http://forum.xbmc.org/showthread.php?tid=98551 before you start using JSON-RPC with nightly builds. It will give you an overview of what has changed and in this case it will also give you the answer to your problem:
(2012-03-25, 13:51)Montellese Wrote: Tuesday, March 27th 2012:
Commit: adff92756087a50bb116
I just pushed a major refactor of how the webserver works internally. Currently this has only one effect on how it works and that affects JSON-RPC clients using JSON-RPC over HTTP. You need to make sure you set the Content-Type in the HTTP header to "application/json" and not something like "multipart/form-data" because that is plain wrong. The new implementation has the functionality to parse POST data for certain content-types (including application/json, multipart/form-data and application/x-www-form-urlencoded) and will therefore fail if the content-type does not match the actual POST data.



RE: JSON-RPC (JSON Remote Procedure Call) interface protocol in development for XBMC - dwagner - 2012-05-15

(2012-05-15, 14:35)Montellese Wrote: Please always first take a look at this thread http://forum.xbmc.org/showthread.php?tid=98551 before you start using JSON-RPC with nightly builds. It will give you an overview of what has changed and in this case it will also give you the answer to your problem:

Thanks, I've bookmarked the page. The content type fixed the issue.



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

Having a fail day:

http://trac.xbmc.org/ticket/13038 forgot to cc Montellese.
http://trac.xbmc.org/ticket/13039 forgot to change to feature request.


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

In Frodo (from yesterday) GetArtistDetails is giving "Invalid params." and the reason looks to be that the DB hasn't been populated. If I go into an artist in the GUI and bring up their info it works thereafter. Doing a GetArtists the info is just empty.

In Eden the info is already there so I guess there might be a problem with the artist info not getting filled in on initial scrap?

Should I do a bug for the GetArtistDetails or is it more of a upstream problem from the initial artist scrap?


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

Can you be more specific about "the DB hasn't been populated"? I assume you received the "artistid" you used in GetArtistDetails from GetArtists?
But I think I know the problem and there might already be a bug report for that.

IIRC you have to manually start retrieving artist info to make it available in the database.
I'll have a look if it's the problem I think it is.


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

In the music DB table "artistinfo" only contains 3 rows from the artists I've viewed their info ("i") for in the GUI. Total artists in "artist" table is 94.

I did have a look for a JSONRPC bug report and can't find anything I think is related searching for "artistinfo".


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

Yup that's the problem. GetArtists only retrieves the list of artists available in the database whereas GetArtistDetails tries to retrieve all the details for a specific artist and if that artist doesn't have any details scraped yet it will fail. Not sure if anything can be done. Might just add a fallback to return the name of the artist so that you won't get an error response.


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

Hi, I'm working on adding JSON-RPC notification support to my XBMC2 plugin for EventGhost.

So I'm wondering why the Player.OnStop notification is different depending on if I stop a media file manually or if it stops by itself? If a video for example stops by itself I get no title or anything else but if I stop the video I get the title and other useful info.

I use Eden.

jonib



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

(2012-05-19, 21:07)jonib Wrote: So I'm wondering why the Player.OnStop notification is different depending on if I stop a media file manually or if it stops by itself? If a video for example stops by itself I get no title or anything else but if I stop the video I get the title and other useful info.

I'm just guessing here because it's hard to track the timeline of these things down but what probably happens is that if playback stops by itself, the reference to the played item is removed before the JSON-RPC notification is generated so JSON-RPC can't provided that information anymore.


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

I take it it not that easy to do the same as the GUI and populate the info? And I guess it'll get "fixed" so the artist info is populated when the artist is added eventually?


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

(2012-05-19, 21:35)Mizaki Wrote: I take it it not that easy to do the same as the GUI and populate the info?
Nope that's not that easy to achieve.

(2012-05-19, 21:35)Mizaki Wrote: And I guess it'll get "fixed" so the artist info is populated when the artist is added eventually?
I think this is actually a "feature" the way it is right now because most libraries will have one hell of a lot of artists and retrieving information for all of them will take a very long time so not doing it automatically will speed things up quite a bit. That's why there is the "Query info for all artists" entry in the context menu when viewing all artists.