MPMediaQuery artists return duplicates

I am using Apple Media Player Framework in my application. To retrieve elements, I use MPMediaQuery as described in their docs. This works well, but when using a predefined query to retrieve all artists, I get duplicate entries for several artists.

Can someone explain why there are duplicates? How can I crush them?

 NSArray *collections = [[MPMediaQuery artistsQuery] collections]; 

(And there are no typos or differences in the case on behalf of the performer!)

+7
source share
1 answer

I noticed that this only happens when there are albums with several artists.

Instead of just [MPMediaQuery artistQuery] following pretends to be this behavior:

 MPMediaQuery *artistsQuery = [MPMediaQuery artistsQuery]; artistsQuery.groupingType = MPMediaGroupingAlbumArtist; NSArray *collections = [artistQuery collection]; 
+4
source

All Articles