Commit 00f96afc authored by Carola Nitz's avatar Carola Nitz Committed by Felix Paul Kühne

added a folderTrackNumber to remember the order in a folder

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 60c71ff3
......@@ -70,6 +70,7 @@ extern NSString *kMLFileTypeAudio;
@property (nonatomic, retain) NSString *artist;
@property (nonatomic, retain) NSString *album;
@property (nonatomic, retain) NSNumber *albumTrackNumber;
@property (nonatomic, retain) NSNumber *folderTrackNumber;
@property (nonatomic, retain) NSString *genre;
@property (nonatomic, retain) MLAlbumTrack *albumTrack;
......
......@@ -32,6 +32,7 @@
{
}
+ (NSArray *)allLabels;
- (NSArray *)sortedFolderItems;
@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSSet* files;
......@@ -45,5 +46,6 @@
- (void)addFiles:(NSSet *)value;
- (void)removeFiles:(NSSet *)value;
@end
......@@ -86,6 +86,7 @@ NSString *kMLFileTypeAudio = @"audio";
{
return [self isKindOfType:kMLFileTypeAudio];
}
- (BOOL)isSupportedAudioFile
{
NSUInteger options = NSRegularExpressionSearch | NSCaseInsensitiveSearch;
......@@ -170,6 +171,7 @@ NSString *kMLFileTypeAudio = @"audio";
@dynamic artist;
@dynamic album;
@dynamic albumTrackNumber;
@dynamic folderTrackNumber;
@dynamic genre;
@dynamic albumTrack;
......
......@@ -50,4 +50,15 @@
@dynamic name;
@dynamic files;
- (NSArray *)sortedFolderItems
{
NSArray *folderItems = [[self valueForKey:@"files"] allObjects];
NSSortDescriptor *folderItemDescriptor =
[[NSSortDescriptor alloc] initWithKey:@"folderTrackNumber"
ascending:YES
selector:@selector(compare:)];
return [[folderItems sortedArrayUsingDescriptors:@[folderItemDescriptor]] retain];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment