Created
April 26, 2013 17:04
-
-
Save grav/5468757 to your computer and use it in GitHub Desktop.
One way of getting all tracks for an artist with the Cocoa Spotify API! Oh lawd ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSURL *artistUrl = [NSURL URLWithString:AebersoldSpotifyUri]; | |
[SPArtistBrowse browseArtistAtURL:artistUrl inSession:[SPSession sharedSession] type:SP_ARTISTBROWSE_NO_TRACKS callback:^(SPArtistBrowse *artistBrowse) { | |
[SPAsyncLoading waitUntilLoaded:artistBrowse timeout:10.0 then:^(NSArray *loaded, NSArray *notLoaded) { | |
for(SPAlbum *a in artistBrowse.albums){ | |
[SPAlbumBrowse browseAlbumAtURL:a.spotifyURL inSession:[SPSession sharedSession] callback:^(SPAlbumBrowse *albumBrowse) { | |
[SPAsyncLoading waitUntilLoaded:albumBrowse timeout:10.0 then:^(NSArray *loadedItems, NSArray *notLoadedItems) { | |
for(SPTrack *t in albumBrowse.tracks){ | |
NSLog(@"%@",t); | |
} | |
}]; | |
}]; | |
} | |
}]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment