Hello!
I am trying a basic MusicCatalogResourceRequest to pull in a particular Artist from Apple Music. When printing out the result, it only contains the id and name of the Artist;
ex :
Artist(id: "78011850", name: "deadmau5")
It is missing all of the instance properties as defined on the developer documentation.
This is the snippet I am using, is there something missing? I am trying to fetch the related albums, but it is always returning nil.
static func catalogAlbumsForArtistId(artistId: MusicItemID) async -> MusicItemCollection<MusicKit.Album>? {
do {
let artistRequest = MusicCatalogResourceRequest<MusicKit.Artist>(matching: \.id, equalTo: artistId)
let artistResponse = try await artistRequest.response()
if let artist = artistResponse.items.first {
print("artist")
return artist.albums
}
} catch {
print(error)
}
return nil
}
Thanks! 😃