GregMo 24 Posted May 4, 2023 Posted May 4, 2023 I'm sure this has to be very simple and I'm just over looking it, but how would one get all the songs from a specific album ID? I would think that there would be a service similar to the /shows/ service that would allow me to do something like /albums/<albumid>/songs to get a list of them all but if so, I can't find a reference to it. Then I found the post below which seems to speak to what I'm trying to do, but not exactly the same, and I can't seem to figure out how to modify it to fit my desired result.
Luke 42077 Posted May 4, 2023 Posted May 4, 2023 Hi, have you tried monitoring the xhr requests using the browser debugger, to see what the album screen is doing?
Solution Cheesegeezer 3104 Posted May 5, 2023 Solution Posted May 5, 2023 On 04/05/2023 at 07:02, GregMo said: I'm sure this has to be very simple and I'm just over looking it, but how would one get all the songs from a specific album ID? I would think that there would be a service similar to the /shows/ service that would allow me to do something like /albums/<albumid>/songs to get a list of them all but if so, I can't find a reference to it. Then I found the post below which seems to speak to what I'm trying to do, but not exactly the same, and I can't seem to figure out how to modify it to fit my desired result. Greg, just use items service, you need parentId and ensure its recursive and set includeitemtypes to audio this will get what you need.
GregMo 24 Posted May 6, 2023 Author Posted May 6, 2023 (edited) On 5/5/2023 at 7:36 AM, Cheesegeezer said: just use items service, you need parentId and ensure its recursive and set includeitemtypes to audio this will get what you need. I thought that this was what I needed to do but I couldn't not seem to get the ParentId to return as a response. I just now had the idea that the ParentId surely has to be the AlbumId, right? Well it was. Got what I needed now. Thanks! FYI, you shouldn't have to use IncludeItemTypes unless you're trying to filter out different types. If you have an album that only has songs as it's children, then leaving off the IncludeItemTypes returns the same results as including it does. That said, if someone is like me, and wanting to try to write code that will work with either shows are songs, in shows you would use the SeriesId as the ParentId and you would have to filter for just the "Episode" type. Edited May 7, 2023 by GregMo
Cheesegeezer 3104 Posted May 7, 2023 Posted May 7, 2023 31 minutes ago, GregMo said: I thought that this was what I needed to do but I couldn't not seem to get the ParentId to return as a response. I just now had the idea that the ParentId surely has to be the AlbumId, right? Well it was. Got what I needed now. Thanks! FYI, you shouldn't have to use IncludeItemTypes unless you're trying to filter out different types. If you have an album that only has songs as it's children, then leaving off the IncludeItemTypes returns the same results as including it does. That said, if someone is like me, and wanting to try to write code that will work with either shows are songs, in shows you would use the SeriesId as the ParentId and you would have to filter for just the "Episode" type. FYI… when using a recursive query, it’s important to state exactly what you want returned. Otherwise you can end up with more items returned than you want and do more processing to filter out the crap you dont. You should get familiar with itemtypes and mediaTypes.. they will help your make your calls efficient. cheers
GregMo 24 Posted May 7, 2023 Author Posted May 7, 2023 7 minutes ago, Cheesegeezer said: You should get familiar with itemtypes and mediaTypes.. they will help your make your calls efficient. Yeah, I'm with ya... if [ $MatchType = Audio ]; then IncludeItemTypes=Audio ParentId=$AlbumId else IncludeItemTypes=Episode ParentId=$SeriesId fi url=$Host"/Items?Recursive=true&IncludeItemTypes="$IncludeItemTypes"&ParentId="$ParentId full_parent_data=`curl -s -X GET -H "$EmbyXToken" -H "Content-Type: application/json" $url` 1
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