Post marked as solved
Click to stop watching this thread.
You have stopped watching this post. Click to start watching again.
Post marked as solved with 6 replies, 0 views
Following up on this thread, I can successfully load playlists using MusicDataRequest. For example I can see playlist returned with and id of "p.aJe0ME5I3eZQ84d" from my Apple Music account.
Trying your code fetch the tracks of the playlist did not work out of the box. I had to modify it to
var playlistRequest = MusicCatalogResourceRequest<Playlist>(matching: \.id, equalTo: MusicItemID(playlistId)), i.e. wrapping the returned playlist id to a MusicItemID. Is this correct?
Because using the id this way, it results in the following error:
[DataRequesting] Failed to perform MusicDataRequest.Context(
url: https://api.music.apple.com/v1/catalog/nl/playlists/p.aJe0ME5I3eZQ84d?l=en-GB&include=tracks&omit%5Bresource%5D=autos,
currentRetryCounts: [.other: 1]
) with MusicDataRequest.Error(
status: 404,
code: 40400,
title: "Resource Not Found",
detailText: "Resource with requested id was not found",
id: "4B4ETVMCUXDRBAJ5OCLJLAKLSU",
originalResponse: MusicDataResponse(
data: 159 bytes,
urlResponse: <NSHTTPURLResponse: 0x00000002829a78a0>
)
).
What am I doing wrong?