You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Result was that artwork was null. The album has an artwork definitely. From the following unit test written in Swift, I was able to get the artwork without issues.
==>
func getAlbumArtwork(album: MPMediaItemCollection) -> UIImage? {
guard let representativeItem = album.representativeItem,
let artwork = representativeItem.value(forProperty: MPMediaItemPropertyArtwork) as? MPMediaItemArtwork else {
return nil
}
// You can specify the size of the artwork image you need
let imageSize = CGSize(width: 100, height: 100) // Example size
return artwork.image(at: imageSize)
}
<==
Maybe the problem may originate from not using MPMediaItemCollection.representativeItem for an album.
The text was updated successfully, but these errors were encountered:
Uint8List? artwork =
await _audioQuery.queryArtwork(album.id, ArtworkType.ALBUM);
if (artwork != null) {
artworks[album.id] = artwork;
}
Result was that artwork was null. The album has an artwork definitely. From the following unit test written in Swift, I was able to get the artwork without issues.
==>
func getAlbumArtwork(album: MPMediaItemCollection) -> UIImage? {
guard let representativeItem = album.representativeItem,
let artwork = representativeItem.value(forProperty: MPMediaItemPropertyArtwork) as? MPMediaItemArtwork else {
return nil
}
<==
Maybe the problem may originate from not using MPMediaItemCollection.representativeItem for an album.
The text was updated successfully, but these errors were encountered: