![]() |
API - Get Albums by Artist Basic Help - 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: API - Get Albums by Artist Basic Help (/showthread.php?tid=354551) |
API - Get Albums by Artist Basic Help - hernandito - 2020-05-18 Hi Gang, I am trying to get the API to list all the album's by a specific artist. I want to get the album, albumid, thumbnail, year, track count. Quote:/jsonrpc?request={"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params": { "filter": { "artist" : "Oasis" }, { "limits": { "start" : 0, "end": 50 }, "properties": ["playcount", "artist", "artistid", "thumbnail", "year", ], "sort": { "order": "ascending", "method": "album", "ignorearticle": true } }, "id": "libAlbums"} I cannot figure out how to compose the request. I have tried searching by artistid as well without luck. I have tried many combinations of the "filter" parameters. But nothing seems to work. I suspect it has to do w/ the fact that the Artist is behind a 0: (sub array?) as shown on image below: ![]() Long Explanation: I am trying to build a PHP web application to list all the artists; and for each artist list their albums; and for each album the songs. I already have the API to get artists list: Quote:/jsonrpc?request={"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "params": { "limits": { "start" : 0, "end": 475 }, "properties": [ "thumbnail" ], "sort": { "order": "ascending", "method": "artist", "ignorearticle": true } }, "id": 1}/jsonrpc?request={"jsonrpc": "2.0", "method": "AudioLibrary.GetSongs", "params": { "filter": { "albumid" : 333 }, "properties": [ "artist","track"]}, "sort": { "order": "ascending", "method": "track"}, "id": "libAlbums"} I also have the API to get song list for each album working. Quote:/jsonrpc?request={"jsonrpc": "2.0", "method": "AudioLibrary.GetSongs", "params": { "filter": { "albumid" : 333 }, "properties": [ "artist","track"]}, "sort": { "order": "ascending", "method": "track"}, "id": "libAlbums"}I simply cannot figure out how to filter the Albums by Artist. Thank you in advance. H. RE: API - Get Albums by Artist Basic Help - black_eagle - 2020-05-18
If you use artist as the field rather than albumartist then you will get all the albums that Oasis appear on, including compilations. If you use albumartist you will only get their albums.
RE: API - Get Albums by Artist Basic Help - hernandito - 2020-05-18 (2020-05-18, 20:46)black_eagle Wrote:Oh man.... that is great! I have been trying for hours and hours.... It works perfectly. Thank you! H. |