dummy456 1 Posted August 2, 2021 Posted August 2, 2021 (edited) I have created a music library and I am trying to get json response for it but haven't been able to find a way to get the response I want with emby api. I would really appreciate if anyone could help me! I have a folder structure like this: Music: Album1: Music1.mp3 Music2.mp3 Album2: Music1.mp3 Music2.mp3 and I am trying to get response like this: Items[ Album1: { AlbumName Music1: { Name .... } Music2: { Name .... } }, Album2: { AlbumName Music1: { Name .... } Music2: { Name .... } } ] Edited August 2, 2021 by dummy456 1
Luke 42077 Posted August 3, 2021 Posted August 3, 2021 Hi, you can't change the structure of the api response. You'd have to get the response json as it is and then convert it to the structure that you'd like. https://github.com/MediaBrowser/Emby/wiki
dummy456 1 Posted August 3, 2021 Author Posted August 3, 2021 oh ok, so currently I have managed to figure out get albums like the following, but is there any way I can also get an objects of songs as well in the same array by adding something to the url? http://emby:port/emby/Items?Recursive=true&IncludeItemTypes=MusicAlbum&api_key="key" { "Items": [ { "Name": "Album1", "IsFolder": true, "Type": "MusicAlbum", }, { "Name": "Album2", "IsFolder": true, "Type": "MusicAlbum", }, { "Name": "Album3", "IsFolder": true, "Type": "MusicAlbum", } ], "TotalRecordCount": 3 }
Luke 42077 Posted August 3, 2021 Posted August 3, 2021 Hi, no you'd have to get the songs using a separate query from the albums.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now