Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Display only audio files

  • Loading branch information...
commit 0685cc04c1184e679769fc590360b6d65e4c6594 1 parent 2134d4b
@danielctull authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 DCTMusicModel/DCTMusicModel.m
View
6 DCTMusicModel/DCTMusicModel.m
@@ -64,8 +64,10 @@ - (void)_import {
[backgroundContext performBlock:^{
- MPMediaQuery *mediaQuery = [MPMediaQuery new];
- NSArray *items = mediaQuery.items;
+ MPMediaPropertyPredicate *predicate = [MPMediaPropertyPredicate predicateWithValue:[NSNumber numberWithInteger:MPMediaTypeAnyAudio] forProperty:MPMediaItemPropertyMediaType];
+ MPMediaQuery *query = [MPMediaQuery new];
+ [query addFilterPredicate:predicate];
+ NSArray *items = [query items];
CGFloat count = (CGFloat)[items count];
NSMutableDictionary *artistsDictionary = [NSMutableDictionary new];
Please sign in to comment.
Something went wrong with that request. Please try again.