Fixed sorting for non-0 padded files.
parent
983699ab2f
commit
3b9d20fdc5
|
@ -201,15 +201,11 @@
|
||||||
NSArray *sortedURLs;
|
NSArray *sortedURLs;
|
||||||
if (sort == YES)
|
if (sort == YES)
|
||||||
{
|
{
|
||||||
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"absoluteString" ascending:YES];
|
sortedURLs = [expandedURLs sortedArrayUsingSelector:@selector(compareTrackNumbers:)];
|
||||||
|
|
||||||
sortedURLs = [expandedURLs sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDescriptor]];
|
|
||||||
|
|
||||||
[sortDescriptor release];
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sortedURLs = [expandedURLs copy];
|
sortedURLs = expandedURLs;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (url in sortedURLs)
|
for (url in sortedURLs)
|
||||||
|
|
|
@ -14,3 +14,9 @@
|
||||||
- (NSComparisonResult)compareTrackNumbers:(NSString *)aString;
|
- (NSComparisonResult)compareTrackNumbers:(NSString *)aString;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@interface NSURL (CogSort)
|
||||||
|
|
||||||
|
- (NSComparisonResult)compareTrackNumbers:(NSURL *)aURL;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -19,3 +19,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
@implementation NSURL (CogSort)
|
||||||
|
|
||||||
|
- (NSComparisonResult)compareTrackNumbers:(NSURL *)aURL
|
||||||
|
{
|
||||||
|
return [[self absoluteString] compareTrackNumbers:[aURL absoluteString]];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
Loading…
Reference in New Issue