When fetching user's Albums each album didn't contain Copyright string 🤔 For sure I doing something wrong.
Task {
do {
let url = URL(string: "https://api.music.apple.com/v1/me/library/albums")!
let urlRequest = URLRequest(url: url)
let albumsRequest = MusicDataRequest(urlRequest: urlRequest)
let albumsResponse = try await albumsRequest.response()
let decoder = JSONDecoder()
let usersAlbums = try decoder.decode(MusicItemCollection<Album>.self, from: albumsResponse.data)
print("🎶👀 Here's a user's Albums - \(usersAlbums)")
albums.append(contentsOf: usersAlbums)
let copyrightInfo = usersAlbums.first?.copyright
print("© Copyright Albums string - \(String(describing: copyrightInfo))")
} catch let error {
print("Oops, error when fetching albums \(error.localizedDescription)")
}
}