diff --git a/Playlist/PlaylistLoader.m b/Playlist/PlaylistLoader.m index 81f898a2d..f2054135b 100644 --- a/Playlist/PlaylistLoader.m +++ b/Playlist/PlaylistLoader.m @@ -349,6 +349,10 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc } } ++ (NSString *)keyForPath:(NSString *)path { + return [path stringByReplacingOccurrencesOfString:@"." withString:@"%2E"]; +} + - (NSArray *)insertURLs:(NSArray *)urls atIndex:(NSInteger)index sort:(BOOL)sort { __block NSMutableSet *uniqueURLs = [NSMutableSet set]; @@ -396,7 +400,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc [[SandboxBroker sharedSandboxBroker] addFolderIfMissing:url]; NSArray *pathURLs = [self fileURLsAtPath:[url path]]; for(NSURL *url in pathURLs) { - [expandedURLs setValue:url forKey:[url absoluteString]]; + [expandedURLs setValue:url forKey:[PlaylistLoader keyForPath:[url absoluteString]]]; } } else if(addOtherFilesInFolder) { NSURL *folderUrl = [url URLByDeletingLastPathComponent]; @@ -404,18 +408,18 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc [[SandboxBroker sharedSandboxBroker] requestFolderForFile:url]; NSArray *pathURLs = [self fileURLsAtPath:[folderUrl path]]; for(NSURL *url in pathURLs) { - [expandedURLs setValue:url forKey:[url absoluteString]]; + [expandedURLs setValue:url forKey:[PlaylistLoader keyForPath:[url absoluteString]]]; } [folderURLs addObject:folderUrl]; } } else { [[SandboxBroker sharedSandboxBroker] addFileIfMissing:url]; - [expandedURLs setValue:url forKey:[url absoluteString]]; + [expandedURLs setValue:url forKey:[PlaylistLoader keyForPath:[url absoluteString]]]; } } } else { // Non-file URL.. - [expandedURLs setValue:url forKey:[url absoluteString]]; + [expandedURLs setValue:url forKey:[PlaylistLoader keyForPath:[url absoluteString]]]; } [pathTask finish]; diff --git a/Plugins/FFMPEG/FFMPEGDecoder.m b/Plugins/FFMPEG/FFMPEGDecoder.m index 7eb3f7dd3..23bf20f29 100644 --- a/Plugins/FFMPEG/FFMPEGDecoder.m +++ b/Plugins/FFMPEG/FFMPEGDecoder.m @@ -586,10 +586,11 @@ static uint8_t reverse_bits[0x100]; } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } [array addObject:value]; } diff --git a/Plugins/Flac/FlacDecoder.m b/Plugins/Flac/FlacDecoder.m index bd909bb62..23d770b3a 100644 --- a/Plugins/Flac/FlacDecoder.m +++ b/Plugins/Flac/FlacDecoder.m @@ -181,10 +181,11 @@ FLAC__StreamDecoderWriteStatus WriteCallback(const FLAC__StreamDecoder *decoder, } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } [array addObject:value]; } diff --git a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm index 2e6499b12..e8c3ec085 100644 --- a/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm +++ b/Plugins/HighlyComplete/HighlyComplete/HCDecoder.mm @@ -222,10 +222,11 @@ static int parse_time_crap(NSString *value) { } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } if([array count]) { NSString *existing = array[0]; diff --git a/Plugins/MIDI/MIDI/MIDIMetadataReader.mm b/Plugins/MIDI/MIDI/MIDIMetadataReader.mm index 10e761b37..ec165a45e 100644 --- a/Plugins/MIDI/MIDI/MIDIMetadataReader.mm +++ b/Plugins/MIDI/MIDI/MIDIMetadataReader.mm @@ -29,10 +29,11 @@ } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } [array addObject:value]; } diff --git a/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm b/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm index f9f8bf186..7d66d0c83 100644 --- a/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm +++ b/Plugins/OpenMPT/OpenMPT/OMPTMetadataReader.mm @@ -28,10 +28,11 @@ } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } [array addObject:value]; } diff --git a/Plugins/Opus/Opus/OpusDecoder.m b/Plugins/Opus/Opus/OpusDecoder.m index fdcf1732f..cbd5e0c58 100644 --- a/Plugins/Opus/Opus/OpusDecoder.m +++ b/Plugins/Opus/Opus/OpusDecoder.m @@ -137,10 +137,11 @@ opus_int64 sourceTell(void *_stream) { } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } [array addObject:value]; } diff --git a/Plugins/Vorbis/VorbisDecoder.m b/Plugins/Vorbis/VorbisDecoder.m index 544400354..25811a196 100644 --- a/Plugins/Vorbis/VorbisDecoder.m +++ b/Plugins/Vorbis/VorbisDecoder.m @@ -117,10 +117,11 @@ long sourceTell(void *datasource) { } static void setDictionary(NSMutableDictionary *dict, NSString *tag, NSString *value) { - NSMutableArray *array = [dict valueForKey:tag]; + NSString *realKey = [tag stringByReplacingOccurrencesOfString:@"." withString:@"․"]; + NSMutableArray *array = [dict valueForKey:realKey]; if(!array) { array = [[NSMutableArray alloc] init]; - [dict setObject:array forKey:tag]; + [dict setObject:array forKey:realKey]; } [array addObject:value]; }