diff --git a/AudioFileList.m b/AudioFileList.m index 6ca89f0..377b15b 100644 --- a/AudioFileList.m +++ b/AudioFileList.m @@ -81,7 +81,15 @@ - (void) addFile:(NSString*)fileName if (_chapterMode) { Chapter *chapter = [[Chapter alloc] init]; if ([file.name length] > 0) - chapter.name = file.name; + NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"\\.\\w+$" + options:0 + error:NULL]; + chapter.name = [regex stringByReplacingMatchesInString:file.name + options:0 + range:NSMakeRange(0, [file.name length]) + withTemplate:@"$2$1"]; + + else chapter.name = file.file; [_chapters addObject:chapter];