Kodi Community Forum

Full Version: help with JSON API to set artwork
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I'm not a JSON expert, but generally understand it. I'm trying to see if I am able to set artwork for collections via JSON. I think http://kodi.wiki/view/JSON-RPC_API/v6#Media.Artwork.Set is what I'm looking for. (But maybe not...)

I don't see the proper parameters for setting which Show/Movie/Collection is being impacted, then the path for the artwork.

I know there are a couple add ons for collection artwork, but I'm working on something different.

EDIT:
Looks like that's not the right API call. Is there one for setting Movie Set artwork?
VideoLibrary.SetMovieSetDetails.

http://kodi.wiki/view/JSON-RPC_API/v8#Vi...SetDetails

Added with API 6.12.0 (Gotham).
Are you sure Gotham?

It says API v8 was with Kodi 17 (kypton)?
Yes I'm sure. It's just never been documented until now with v8 - the v6 docs are missing many methods. Gotham released with API 6.14.3 (Frodo 6.0.3). Here's the PR: https://github.com/xbmc/xbmc/pull/3556
So I just checked - Looked at my json and it is supported. So, looking at my data for curl, a few questions.

http://kodi.wiki/view/JSON-RPC_API/v8#Vi...SetDetails

{ "id": 1, "jsonrpc": "2.0", "method": "VideoLibrary.SetMovieSetDetails", "params": {"setid":"120",  }

1. should my psonrpc be updated from 2.0?
2. Where can I find the parems to use?
1. "2.0" is correct, as it says in the v8 documentation: 1 JSON-RPC 2.0 compatibility

2. The params are in the documentation you just linked. Here's an example:
Code:
{"jsonrpc": "2.0", "params": {"setid": 9999, "art": {"fanart": "http://blah/blah2.jpg", "poster": "http://blah/blah1.jpg"}}, "method": "VideoLibrary.SetMovieSetDetails", "id": "libSetDetails"}
Maybe I'm reading the docs wrong, which is possible. I'm very novice to JSON and reading all the specs.

I don't see where it says fanart, etc
Code:
, under
Code:
VideoLibrary.SetMovieSetDetails

Also, what is
Code:
"id": "libSetDetails"? I've seen it as 1, but I'm not sure what that means
 
Code:
 
 
Code:
 
(2018-01-18, 16:41)sufreak Wrote: [ -> ]Maybe I'm reading the docs wrong, which is possible. I'm very novice to JSON and reading all the specs.

I don't see where it says fanart, etc

Click on the Show link below VideoLibrary.SetMovieSetDetails - it will give you the reference to Media.Artwork.Set which defines the supported artwork types.

These are the supported artwork types for Movie Sets: http://kodi.wiki/view/JSON-RPC_API/v8#Media.Artwork.Set

(2018-01-18, 16:41)sufreak Wrote: [ -> ]Also, what is
Code:
"id": "libSetDetails"? I've seen it as 1, but I'm not sure what that means
It's just an identifier. Use whatever value you like. It's really only useful in notifications, as the id you use in the request will be used in any subsequent notification(s) allowing you to match the notification with your original request (and potentially ignore any other notifications that are using a non-matching id).
Thank you for all your feedback. It's helpful and will hopefully help others.

I'm looking at http://kodi.wiki/view/JSON-RPC_API/v8#Vi...SetDetails to see the existing details. If I understand correctly, it is not showing the existing artwork? So can set movie set artwork, but can't see the current art?
To query the Movie Set artwork specify the art property - see Video.Fields.MovieSet.
Awesome, looking now. Am I missing an obvious way of querying this stuff? Or is this just your experience knowledge?
I went through years ago what you're going through now - see the script in my sig. Smile
I actually did play with that tool earlier and need to get back to it.

I'm looking at http://kodi.wiki/view/JSON-RPC_API/v8#Vi...s.MovieSet and am confused, obviously.  It says it Extends http://kodi.wiki/view/JSON-RPC_API/v8#Item.Fields.Base . I'm not seeing a way to reference the setid or anything.
You'll need to query VideoLibrary.GetMovieSets - setid is a "default" property and will always be returned in the result. For example, query for ["title", "art"] and the returned properties will be ["title", "art", "label", "setid"].
Clearly I'm missing something

curl -s --header 'Content-Type: application/json' --data-binary '{"id": 1, "jsonrpc": "2.0", "method":"VideoLibrary.GetMovieSets","params":{"setid": '$num'}}' "http://$usern:$passw@$kodiip/jsonrpc"
{
  "error": {
    "code": -32602,
    "data": {
      "message": "Too many parameters",
      "method": "VideoLibrary.GetMovieSets"
    },
    "message": "Invalid params."
  },
  "id": 1,
  "jsonrpc": "2.0"
}
Pages: 1 2