API - Get Albums by Artist Basic Help
#1
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:
Image

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.
Image
Reply
#2
json:
{"jsonrpc":"2.0","id":1,"method":"AudioLibrary.GetAlbums","params": {"properties":["playcount", "artist", "artistid", "thumbnail", "year"],"filter":{"field":"albumartist", "operator":"is", "value":"Oasis"}, "sort":{"method":"album","order":"ascending"}}}

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.
Learning Linux the hard way !!
Reply
#3
(2020-05-18, 20:46)black_eagle Wrote:
json:
{"jsonrpc":"2.0","id":1,"method":"AudioLibrary.GetAlbums","params": {"properties":["playcount", "artist", "artistid", "thumbnail", "year"],"filter":{"field":"albumartist", "operator":"is", "value":"Oasis"}, "sort":{"method":"album","order":"ascending"}}}

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.
Oh man.... that is great!

I have been trying for hours and hours.... It works perfectly.

Thank you!

H.
Image
Reply

Logout Mark Read Team Forum Stats Members Help
API - Get Albums by Artist Basic Help0