{"action":"created","issue":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/9300","repository_url":"https://api.github.com/repos/xbmc/xbmc","labels_url":"https://api.github.com/repos/xbmc/xbmc/issues/9300/labels{/name}","comments_url":"https://api.github.com/repos/xbmc/xbmc/issues/9300/comments","events_url":"https://api.github.com/repos/xbmc/xbmc/issues/9300/events","html_url":"https://github.com/xbmc/xbmc/pull/9300","id":139335592,"number":9300,"title":"Improvements to AudioLibrary.GetArtists, GetAlbums and GetSongs ","user":{"login":"DaveTBlake","id":13371422,"avatar_url":"https://avatars.githubusercontent.com/u/13371422?v=3","gravatar_id":"","url":"https://api.github.com/users/DaveTBlake","html_url":"https://github.com/DaveTBlake","followers_url":"https://api.github.com/users/DaveTBlake/followers","following_url":"https://api.github.com/users/DaveTBlake/following{/other_user}","gists_url":"https://api.github.com/users/DaveTBlake/gists{/gist_id}","starred_url":"https://api.github.com/users/DaveTBlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaveTBlake/subscriptions","organizations_url":"https://api.github.com/users/DaveTBlake/orgs","repos_url":"https://api.github.com/users/DaveTBlake/repos","events_url":"https://api.github.com/users/DaveTBlake/events{/privacy}","received_events_url":"https://api.github.com/users/DaveTBlake/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/xbmc/xbmc/labels/Improvement","name":"Improvement","color":"0b02e1"},{"url":"https://api.github.com/repos/xbmc/xbmc/labels/JSON-RPC%20API%20Change","name":"JSON-RPC API Change","color":"e11d21"},{"url":"https://api.github.com/repos/xbmc/xbmc/labels/Krypton","name":"Krypton","color":"fbca04"},{"url":"https://api.github.com/repos/xbmc/xbmc/labels/Music","name":"Music","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":36,"created_at":"2016-03-08T17:07:59Z","updated_at":"2016-03-15T14:31:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/xbmc/xbmc/pulls/9300","html_url":"https://github.com/xbmc/xbmc/pull/9300","diff_url":"https://github.com/xbmc/xbmc/pull/9300.diff","patch_url":"https://github.com/xbmc/xbmc/pull/9300.patch"},"body":"API improvements to AudioLibrary.GetArtists, GetAlbums and GetSongs. This follows on from  #8015 and the addition of artist roles to the music library, and adresses some flaws that were in the initial API implementation for accessing artist role data.\r\n\r\nIt also attempts to fix some longer standing issues: GetArtists now returns the song genres and genreids of the songs of each artist, and a flag if the artist is an \"album artist\". Thus returning the data values that correspond to the filters. It  makes it clearer in the documentation that the only genre filtering currently offered is song genre (not the artist genre value that can be scraped, stored and displayed but is not used in queries). Extending filtering to all kinds of genre (artist and album) is something for another PR.\r\n\r\n@Montellese you have seen all of this before, so hope that all is well.\r\n@JoeTheFox finally catching up with the iOS remote!\r\n@Tolriq I think this covers the many things you pointed out with roles, but also improves GetArtists generally in the way I said I would. More work to do of course, especially with genre, but this seems enough for one PR."},"comment":{"url":"https://api.github.com/repos/xbmc/xbmc/issues/comments/196846214","html_url":"https://github.com/xbmc/xbmc/pull/9300#issuecomment-196846214","issue_url":"https://api.github.com/repos/xbmc/xbmc/issues/9300","id":196846214,"user":{"login":"DaveTBlake","id":13371422,"avatar_url":"https://avatars.githubusercontent.com/u/13371422?v=3","gravatar_id":"","url":"https://api.github.com/users/DaveTBlake","html_url":"https://github.com/DaveTBlake","followers_url":"https://api.github.com/users/DaveTBlake/followers","following_url":"https://api.github.com/users/DaveTBlake/following{/other_user}","gists_url":"https://api.github.com/users/DaveTBlake/gists{/gist_id}","starred_url":"https://api.github.com/users/DaveTBlake/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaveTBlake/subscriptions","organizations_url":"https://api.github.com/users/DaveTBlake/orgs","repos_url":"https://api.github.com/users/DaveTBlake/repos","events_url":"https://api.github.com/users/DaveTBlake/events{/privacy}","received_events_url":"https://api.github.com/users/DaveTBlake/received_events","type":"User","site_admin":false},"created_at":"2016-03-15T14:31:43Z","updated_at":"2016-03-15T14:31:43Z","body":">If by default you want to hide currently unused roles for easier usage from GUI for example, please add an allroles options like other to return all the data.\r\n\r\nI think that excluding unused roles by default (as currently) makes practical sense. And I am happy to add an option to also return the unused roles to the API. But if I simply do that it raises 2 concerns: \r\n\r\na) It will mean that GetRoles is returning filtered data without returning the value it is filtered on, or I also add a \"unused\" flag that also gets returned (and it feels the issue gets bigger and bigger)\r\n\r\nb) The principle that no filters means all data is contradicted. This is the  case with GetArtists because there was no reasonable backward compatible way around it, it just broke too much. Are you, and @Montellese, happy for GetRoles to do that?\r\n\r\nThe other approach is just to abandon the idea of predefined/pre-populated roles - all roles (except 1) are used or they get deleted. My addition of composer and conductor role on table creation was accidental, it helped with initial testing but cleaning (if that currently worked) will remove any unused. I am undecided if holding standard roles with set IDs has a use. Maybe some kinds of UI would benefit? My early ideas all roles were fixed, maybe ths is just a hangover from that? Either way it either needs implementing fully, or removing.\r\n\r\nAll points on your previous post noted @Tolriq, I just have no comment to make at this time."}}