Album Artwork is not loading when music is playing

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.

Replies

Hello @ashinthetray,

Thank you very much for reporting this issue.

However, with these kinds of issues, we really need more information. Specifically, we need to know where the Album you're seeing this issue with comes from. Presumably, you found this album in a response for one of the many requests MusicKit offers. Could you please tell us which one?

Also, it would definitely help to get a sysdiagnose for this ticket.

Thank you very much in advance for following up with this additional information.

Best regards,

  • Hi @JoeKun,

    I have updated the ticket with the code and also here is a bit more details: I am using player.queue = ApplicationMusicPlayer.Queue(for: queue), where queue is an [Track] and then calling the .play() method.

  • I have a suspicion this has something to do with Image caching because, I will play a track it won't load the artwork, then I will go to the previous track and go back again then the artwork will display. And also the artwork loads correctly for all locally available Tracks. Only the ones that aren't in my local music library have this loading issue.

Add a Comment

Thanks for following up with additional information @ashinthetray.

So to be very clear, this is not artwork of an Album; rather, this is artwork of a Track, or maybe more accurately Song, found in the player's ApplicationMusicPlayer's queue?

Correct?

Add a Comment