Hi Apple Engineers,
In my app Caset, the album artwork is no longer displaying correctly, instead the console is printing with error:
[Artwork] [MPArtwork] Failed to create directory at 'file:///var/mobile/Media/iTunes_Control/iTunes/Artwork/Caches/96x96/61/' with error: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “61” in the folder “96x96”." UserInfo={NSFilePath=/var/mobile/Media/iTunes_Control/iTunes/Artwork/Caches/96x96/61, NSUnderlyingError=0x280552dc0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
Here is the code I am using to display the album artwork of the current item:
@ObservedObject private var playerQueue = ApplicationMusicPlayer.shared.queue
//In the BODY
switch playerQueue.currentEntry?.item {
case .song(let song):
if let artwork = song.artwork {
ArtworkImage(artwork, width: 40, height: 40)
}
case .musicVideo(let video):
if let artwork = video.artwork {
ArtworkImage(artwork, width: 70, height: 40)
}
case nil:
EmptyView()
}
Related bug has been filed here: FB10189431
This unexpected behavior is new and was previously worked as expected in early versions of iOS 15.