indragiek / SNRMusicKit

All-in-one framework for browsing and playing music from various sources on iOS and OS X
150 stars 19 forks source link

SPArtist+SMKArtist fetchAlbumsWithSortDescriptors:predicate:completionHandler: returns SPTrack #12

Open hohl opened 11 years ago

hohl commented 11 years ago

I would expect that SPArtist+SMKArtist fetchAlbumsWithSortDescriptors:predicate:completionHandler: would pass a NSArray of SMKAlbum compatible items (like the MPMediaLibrary implementation does), but instead I get an array of SPTrack (which of course only implements SMKTrack).

It's a pity but I don't have any idea why this happens. Do you have an idea?

hohl commented 11 years ago

Replacing the lines 28 to 32 in SPArtist+SMKArtist with the following line fixed the issue for me:

[SMKSpotifyHelpers loadItemsAynchronously:@[browse]
                          sortDescriptors:sortDescriptors
                                predicate:predicate
                             sortingQueue:queue
                        completionHandler:^(NSArray *tracks, NSError *error) {
                            if (error) {
                                handler(nil, error);
                            } else {
                                handler(browse.albums, nil);
                            }
                        }];