I am using the Apple Media Player Framework in my application. To fetch items I am using the MPMediaQuery
as described in their documents. Which works well, but when using the predefined query to retrieve all artists, I get duplicated entries for few artists.
Can somebody explain why there are duplicates? How do I suppress them?
NSArray *collections = [[MPMediaQuery artistsQuery] collections];
(And no there aren't any typos or differences in the casing in the name of the artist!)
I've noticed that this occurs only when there are albums with multiple artists.
Instead of just [MPMediaQuery artistQuery]
, the following pretends this behavior:
MPMediaQuery *artistsQuery = [MPMediaQuery artistsQuery];
artistsQuery.groupingType = MPMediaGroupingAlbumArtist;
NSArray *collections = [artistQuery collection];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With