Roles / Composer
#1
Hi,

How can I retrieve "Composers" with  AudioLibrary.GetRoles 

(Audio.Artist.Roles,Audio.Details.Role,Audio.Fields.Role)

this is works

{"jsonrpc":"2.0","id":"AudioLibrary.GetRoles","method":"AudioLibrary.GetRoles","params":{"limits":{ "start" : 0, "end": 50},"sort":{"method":"label","order":"ascending"}}}

{
    "id": "AudioLibrary.GetRoles",
    "jsonrpc": "2.0",
    "result": {
        "limits": {
            "end": 2,
            "start": 0,
            "total": 2
        },
        "roles": [
            {
                "label": "Artist",
                "roleid": 1
            },
            {
                "label": "Composer",
                "roleid": 2
            }
        ]
    }
}
Reply
#2
You don't use Audiolibrary.GetRoles, that will simply return a list of the various roles that the music library know about, in your case as you can see "artist" and "composer".

If you want to list the artists that are composers then use AudioLibrary.GetArtists with a suitable filter. For example something like.
Code:
{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.GetArtists",
"params": { "limits": { "start" : 0, "end": 750}, "filter": {"role":"composer"},
"properties": ["style","born","died","gender", "type", "disambiguation", "sortname", "roles", "genre","songgenres"]} }
Reply
#3
Thanks ,

How can I retrieve list of all "Composers" Labels and then retrieve  "AudioLibrary.GetArtists" filtered by specific composer label or id ?
Reply
#4
I'm having difficulty understanding what you want to achieve.

If by " list of all Composers Labels" you mean their names then use the request I gave previously.

Use Audiolibrary.GetArtistDetails to get the infromation about a single artist (that could be a composer), although you can get the same details for many artists with one call using Audiolibrary.GetArtists.

Composers are not something separate from artists, a subset of artists are composers, "composer" is a role that some artists contribute to the music
Reply
#5
Can I query list off all composers name from local music library ?
Then , Can I show the artists list name or alums list name filtered by specific composer name

For example:

Composers list:
Johann Sebastian Bach         -->  all songs sorted by albums name or artist name 
Wolfgang Amadeus Mozart    --> all songs sorted by albums name or artist name
Reply
#6
To list all composers
Code:
{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.GetArtists", "filter": {"role":"composer"} }

To list all songs with specific composer
Code:
{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.GetSongs", "filter": {"artist": "Wolfgang Amadeus Mozart", "role":"composer"} }

Or using IDs assuming you have used GetRoles and GetArtists and have these values
Code:
{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.GetSongs", "filter": {"artistid": 3560, "roleid":2} }

Obviously you can add properties, limits and sort order to the request as required.
Reply
#7
Dave ,

Thank's for your help !
Reply
#8
Hi,

The following request works perfectly :

{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.GetSongs", "params":{ "filter": {"artist": "Wolfgang Amadeus Mozart", "role":"composer"}, "properties": ["title", ...] }}

But when I try to combine it with another condition using boolean "and", it fails :

{"jsonrpc": "2.0", "id": 1, "method": "AudioLibrary.GetSongs", "params":{ "filter": {"and": [{"artist": "Wolfgang Amadeus Mozart", "role": "composer"}, {"field": "title", "operator": "contains", "value": "symphony"}]}, "properties": ["title", ...] }}

Yet I already used successfully the "and" / "or" syntax with "field" conditions...

Is it normal ? Is there a way to achieve what I need ?

Thank you very much in advance
Reply

Logout Mark Read Team Forum Stats Members Help
Roles / Composer0