Skip to content

Instantly share code, notes, and snippets.

@Morse-Code
Created March 28, 2012 00:35
Show Gist options
  • Save Morse-Code/2222152 to your computer and use it in GitHub Desktop.
Save Morse-Code/2222152 to your computer and use it in GitHub Desktop.
Playlist aggregator
-(NSArray *)playlistsInFolder:(SPPlaylistFolder *)aFolder {
NSMutableArray *playlists = [NSMutableArray arrayWithCapacity:[[aFolder playlists] count]];
for (id playlistOrFolder in aFolder.playlists) {
if ([playlistOrFolder isKindOfClass:[SPPlaylist class]]) {
[playlists addObject:playlistOrFolder];
} else {
[playlists addObjectsFromArray:[self playlistsInFolder:playlistOrFolder]];
}
}
return [NSArray arrayWithArray:playlists];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment