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)



- Martijn - 2012-01-13

Montellese Wrote:The problem with your approach is, as Mizaki pointed out correctly, that some ppl don't have seperate directories for seasons and other people have the epidose files of the same season in different directories (maybe even on different harddiscs) so you need to take that into account.

I can't take every possibility into account and this seems to be the most logical way that would fit the majority of users.
If they don't have separate folders for seasons it also doesn't work in skins that will be using this. The other problem you pointed out that if they aren't in the same folder would make it very difficult to program and slow.

This was an extra option so they will just have to disable it.

I already have it so that the season posters are save like XBMC exports them. "seasonxx.tbn"
I still need to figure out a good way to push the newly downloaded directly into the XBMC database so the new ones are used instead of the previously scraped ones.


- dwagner - 2012-01-17

Hi Montellese,

I've been fiddling with the recentlyadded functions for movies and musicalbums. I noted that if I set the limit above 25 that I will still only get 25 items back. Is there a reason for the limitation?


- dwagner - 2012-01-17

Is there a way in the JSON API to list all movies by movieid in descending order?


- Montellese - 2012-01-17

dwagner Wrote:Hi Montellese,

I've been fiddling with the recentlyadded functions for movies and musicalbums. I noted that if I set the limit above 25 that I will still only get 25 items back. Is there a reason for the limitation?

That's the limitation defined by XBMC's implementation of the video database. The "limits" parameter can't do any special magic there.

dwagner Wrote:Is there a way in the JSON API to list all movies by movieid in descending order?

Yes just don't define any sort method at all or specify the sort method to "none". Then it will simply return the movies in the order they were added to the database which will automatically lead to it being sorted by movieid.


- dwagner - 2012-01-17

Montellese Wrote:Yes just don't define any sort method at all or specify the sort method to "none". Then it will simply return the movies in the order they were added to the database which will automatically lead to it being sorted by movieid.
trying to sort this in descending order does not work for me. It still shows in ascending order.
"sort":{"method":"none", "order":"descending"}


- Montellese - 2012-01-17

dwagner Wrote:trying to sort this in descending order does not work for me. It still shows in ascending order.
"sort":{"method":"none", "order":"descending"}

Yes because "none" means it doesn't do any sorting so it will ignore the "order" as well. It just happens to be the case that not sorting means that it will be sorted by the database id in ascending order.


- blademansw - 2012-01-17

Hi All

I am working on a .Net async library for the new API (http://code.google.com/p/xbmc-json-v3/) which is based on a previous project for Dharma.

I am getting a problem with AudioLibrary.GetArtistDetails.

Here is my Json request
Code:
{
  "jsonrpc": "2.0",
  "method": "AudioLibrary.GetArtistDetails",
  "params": {
    "artistid": 86,
    "properties": [
      "instrument",
      "style",
      "mood",
      "born",
      "formed",
      "description",
      "genre",
      "died",
      "disbanded",
      "yearsactive",
      "musicbrainzartistid",
      "fanart",
      "thumbnail"
    ]
  },
  "id": 1
}

This returns the following:
Code:
{
  "error": {
    "code": -32602,
    "message": "Invalid params."
  },
  "id": 1,
  "jsonrpc": "2.0"
}

Can anyone see anything wrong with my request - I have validated that the artistid is a valid ID by looking directly in the database.

Cheers


- Montellese - 2012-01-18

Did you also make sure that the artist with that artistid is returned by AudioLibrary.GetArtists? Because it only lists those artists that actually have an album/track connected to them because otherwise it doesn't make any sense to list them. So seeing it in the database doesn't necessarily mean that it will show up in XBMC GUI or in the output of JSON-RPC.

If there would be a problem with one of the other parameters you provide in your request you would get a more detailed error description.


- blademansw - 2012-01-18

Montellese Wrote:Did you also make sure that the artist with that artistid is returned by AudioLibrary.GetArtists? Because it only lists those artists that actually have an album/track connected to them because otherwise it doesn't make any sense to list them. So seeing it in the database doesn't necessarily mean that it will show up in XBMC GUI or in the output of JSON-RPC.

If there would be a problem with one of the other parameters you provide in your request you would get a more detailed error description.

Hi Montellese. Thanks for your reply.

I have just this minute found the problem, it was because I had neglected to manually scrape the artists in XBMC, so the database had minimal info about the artist and I guess this caused the exception within XBMC when I tried to call GetArtistDetails

Nothing wrong with the API at all!

Thanks


- dwagner - 2012-01-18

Hi Montellese,

Much like movies, I wanted to get TV Shows by tvshowid, but it seems the behavior of VideoLibrary.GetTVShows is different from that of movies, in that if no sort is specified the library still gets ordered by label.

Is there a way to get it by tvshow id?


- Montellese - 2012-01-19

No there isn't, you'll have to do the sorting yourself.


- dwagner - 2012-01-19

Montellese Wrote:No there isn't, you'll have to do the sorting yourself.
Sadly that won't work for what I'm trying to do as I'm trying to avoid having to download the entire list, and only get the newest ids. I'll add add sort by id as a feature request.


- __teoREtik__ - 2012-01-19

Hello, everyone. Tell me please, is it possible to get info about movie actors via JSON API like it does in HTTP API queryvideodatabase() method by passing there SQL construction? I'm working with XBMC Dharma.


- dwagner - 2012-01-19

__teoREtik__ Wrote:Hello, everyone. Tell me please, is it possible to get info about movie actors via JSON API like it does in HTTP API queryvideodatabase() method by passing there SQL construction? I'm working with XBMC Dharma.

Its not yet possible to just list actors and then query movies by actor. I have a feature request for this
http://trac.xbmc.org/ticket/12148

You can however list movies with actor information by using "cast" for properties.


- __teoREtik__ - 2012-01-20

dwagner Wrote:Its not yet possible to just list actors and then query movies by actor. I have a feature request for this
http://trac.xbmc.org/ticket/12148

You can however list movies with actor information by using "cast" for properties.

Do you mean that I can add to "fields" object in VideoLibrary.GetMovies request "cast" property to get all movies with this actors from DB?