2017-11-16, 05:06
Updated: Implemented in Kodi 18. Dave took this request and ran with it, now the music library has complete support for extra artwork. Freely named artwork for the music library can be added to existing library items from the GUI and JSON-RPC (as described originally), plus scrapers can set extended artwork for new items and there are new advancedsettings options to identify additional artwork from the file system. Active artwork assigned from scrapers is also limited by the advancedsettings.xml configuration so each Kodi installation has a single place to configure all automatically added artwork, but the full list of available artwork is still saved for manual selection in the "Choose art" dialog.
The music library has some support for freely named artwork like the video library (for images like logos and discart), but it is missing a couple of interfaces to set this artwork: from the GUI and from JSON-RPC.
On the GUI side for music media items (artists, albums, and tracks/songs), there should be a "Choose art" button on the info window like the video library to replace the "Get thumb" and "Get fanart" buttons, which allows users to set any type of artwork for that item (screenshot of "Choose art" window in the video library).
For JSON-RPC, we need an optional param "art" for each media type method, to both get and set artwork.
A request to get all artwork for one particular artist would look like
And the result:
The request and result should be similar for "AudioLibrary.GetArtistDetails", ".GetAlbumDetails", and ".GetSongDetails"; and the request will be similar but the result will be a list of items for the methods "AudioLibrary.GetArtists", ".GetAlbums", ".GetSongs", ".GetRecentlyAddedAlbums", ".GetRecentlyAddedSongs", ".GetRecentlyPlayedAlbums", and ".GetRecentlyPlayedSongs".
Comparable video library methods are "VideoLibrary.GetTVShowDetails", "VideoLibrary.GetTVShows", and "VideoLibrary.GetRecentlyAddedEpisodes".
"art" is a flat map of art type to URL/path of the artwork, image URL encoded.
To set artwork, we need a request like
"art" is still a flat map, but the URL/path is not image URL encoded (or maybe just doesn't have to be). Art added this way is applied as an update to existing art, so any artwork that exists but isn't specified in this request stays as is. If the value is null, then the existing art with that type should be removed. The methods "AudioLibrary.SetArtistDetails", ".SetAlbumDetails", and ".SetSongDetails" need this param. A comparable video library method with this behavior is "VideoLibrary.SetTVShowDetails".
Posted at the request of @DaveBlake. Thanks for your time.
The music library has some support for freely named artwork like the video library (for images like logos and discart), but it is missing a couple of interfaces to set this artwork: from the GUI and from JSON-RPC.
On the GUI side for music media items (artists, albums, and tracks/songs), there should be a "Choose art" button on the info window like the video library to replace the "Get thumb" and "Get fanart" buttons, which allows users to set any type of artwork for that item (screenshot of "Choose art" window in the video library).
For JSON-RPC, we need an optional param "art" for each media type method, to both get and set artwork.
A request to get all artwork for one particular artist would look like
Code:
{"jsonrpc":"2.0","method":"AudioLibrary.GetArtistDetails","params":{"artistid":1,"properties":["art"]},"id":8}
And the result:
Code:
{"artistdetails": {
"art": {
"banner": "image://http%3a%2f%2fthetvdb.com%2fbanners%2fgraphical%2f80287-g.jpg/",
"clearlogo": "image://https%3a%2f%2fassets.fanart.tv%2ffanart%2ftv%2f80287%2fclearlogo%2fcodemonkeys-80287.png/",
"fanart": "image://http%3a%2f%2fthetvdb.com%2fbanners%2ffanart%2foriginal%2f80287-3.jpg/",
"thumb": "image://http%3a%2f%2fthetvdb.com%2fbanners%2fposters%2f80287-2.jpg/"
},
"artist": "Code Monkeys"
"label": "Code Monkeys",
"artistid": 1
}}
The request and result should be similar for "AudioLibrary.GetArtistDetails", ".GetAlbumDetails", and ".GetSongDetails"; and the request will be similar but the result will be a list of items for the methods "AudioLibrary.GetArtists", ".GetAlbums", ".GetSongs", ".GetRecentlyAddedAlbums", ".GetRecentlyAddedSongs", ".GetRecentlyPlayedAlbums", and ".GetRecentlyPlayedSongs".
Comparable video library methods are "VideoLibrary.GetTVShowDetails", "VideoLibrary.GetTVShows", and "VideoLibrary.GetRecentlyAddedEpisodes".
"art" is a flat map of art type to URL/path of the artwork, image URL encoded.
To set artwork, we need a request like
Code:
{"jsonrpc":"2.0","method":"AudioLibrary.SetArtistDetails","params":{"artistid":1,"art":{"banner":"http://thetvdb.com/banners/graphical/80287-g.jpg"}},"id":8}
"art" is still a flat map, but the URL/path is not image URL encoded (or maybe just doesn't have to be). Art added this way is applied as an update to existing art, so any artwork that exists but isn't specified in this request stays as is. If the value is null, then the existing art with that type should be removed. The methods "AudioLibrary.SetArtistDetails", ".SetAlbumDetails", and ".SetSongDetails" need this param. A comparable video library method with this behavior is "VideoLibrary.SetTVShowDetails".
Posted at the request of @DaveBlake. Thanks for your time.