diff --git a/Audio/PluginController.m b/Audio/PluginController.m index 12c6d051c..f0023aaf3 100644 --- a/Audio/PluginController.m +++ b/Audio/PluginController.m @@ -356,41 +356,55 @@ static PluginController *sharedPluginController = nil; } } } - + NSMutableArray * stringList = [[NSMutableArray alloc] init]; - + [stringList addObject:plistHeader]; + + // These aren't handled by decoders, but as containers + NSArray * staticTypes = @[ + @[@"M3U Playlist File", @"m3u.icns", @"m3u", @"m3u8"], + @[@"PLS Playlist File", @"pls.icns", @"pls"], + @[@"RAR Archive of SPC Files", @"vg.icns", @"rsn"], + @[@"7Z Archive of VGM Files", @"vg.icns", @"vgm7z"] + ]; + + NSMutableArray * assocTypes = [[NSMutableArray alloc] init]; + + [assocTypes addObjectsFromArray:staticTypes]; for (NSString * decoderString in decodersRegistered) { Class decoder = NSClassFromString(decoderString); if (decoder && [decoder respondsToSelector:@selector(fileTypeAssociations)]) { NSArray * types = [decoder fileTypeAssociations]; - for (NSArray * type in types) { - [stringList addObject:@"\t\t\n\ + [assocTypes addObjectsFromArray:types]; + } + } + + for (NSArray * type in assocTypes) { + [stringList addObject:@"\t\t\n\ \t\t\tCFBundleTypeExtensions\n\ \t\t\t\n\ "]; - for (size_t i = 2; i < [type count]; ++i) { - [stringList addObject:@"\t\t\t\t"]; - [stringList addObject:[[type objectAtIndex:i] lowercaseString]]; - [stringList addObject:@"\n"]; - } - [stringList addObject:@"\t\t\t\n\ + for (size_t i = 2; i < [type count]; ++i) { + [stringList addObject:@"\t\t\t\t"]; + [stringList addObject:[[type objectAtIndex:i] lowercaseString]]; + [stringList addObject:@"\n"]; + } + [stringList addObject:@"\t\t\t\n\ \t\t\tCFBundleTypeIconFile\n\ \t\t\t"]; - [stringList addObject:[type objectAtIndex:1]]; - [stringList addObject:@"\n\ + [stringList addObject:[type objectAtIndex:1]]; + [stringList addObject:@"\n\ \t\t\tCFBundleTypeName\n\ \t\t\t"]; - [stringList addObject:[type objectAtIndex:0]]; - [stringList addObject:@"\n\ + [stringList addObject:[type objectAtIndex:0]]; + [stringList addObject:@"\n\ \t\t\tCFBundleTypeRole\n\ \t\t\tViewer\n\ \t\t\tLSTypeIsPackage\n\ \t\t\t\n\ \t\t\n"]; - } - } } [stringList addObject:plistFooter];