Hi there!
I am trying to fetch a record label's top and latest releases. For example, for "Big Machine Label Group", I can see the top and latest releases on Apple Music.
I get the latest and top releases if I use the endpoint to get a catalog record label and query parameters to extend.
https://api.music.apple.com/v1/catalog/us/record-labels/1552967199?views=top-releases,latest-releases
However, I am getting nil
for these values using MusicCatalogResourceRequest
. Here's the code:
let request = MusicCatalogResourceRequest<RecordLabel>(matching: \.id, equalTo: "1552967199")
let response = try await request.response()
guard let recordLabel = response.items.first else { return }
print(recordLabel.topReleases)
print(recordLabel.latestReleases)
I cannot add properties for these either to get detailed info because I think there is no PartialMusicProperty
when Root
is RecordLabel
.
Can you point me to what I am doing wrong?
Hello @snuff4,
This issue is resolved in iOS 16 beta 1.
Just make sure to load the .latestReleases and .topReleases properties of the RecordLabel.
You can even use these APIs on older deployment targets, as long as you use the latest SDK to build your app.
I hope this helps.
Best regards,