CUE Reader: Fix enumerating sheets and tag reading

The reader should have been skipping the properties of CUE sheets when
reading the referenced data for the inner files.

Fixes #235

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-02-13 12:18:58 -08:00
parent 7ef583340d
commit cad09b8912
6 changed files with 13 additions and 6 deletions

View File

@ -12,5 +12,6 @@
}
+ (NSDictionary *)propertiesForURL:(NSURL *)url;
+ (NSDictionary *)propertiesForURL:(NSURL *)url skipCue:(BOOL)skip;
@end

View File

@ -15,7 +15,13 @@
+ (NSDictionary *)propertiesForURL:(NSURL *)url {
@autoreleasepool {
return [[PluginController sharedPluginController] propertiesForURL:url];
return [[PluginController sharedPluginController] propertiesForURL:url skipCue:NO];
}
}
+ (NSDictionary *)propertiesForURL:(NSURL *)url skipCue:(BOOL)skip {
@autoreleasepool {
return [[PluginController sharedPluginController] propertiesForURL:url skipCue:skip];
}
}

View File

@ -93,7 +93,7 @@
- (id<CogSource>)audioSourceForURL:(NSURL *)url;
- (NSArray *)urlsForContainerURL:(NSURL *)url;
- (NSDictionary *)metadataForURL:(NSURL *)url skipCue:(BOOL)skip;
- (NSDictionary *)propertiesForURL:(NSURL *)url;
- (NSDictionary *)propertiesForURL:(NSURL *)url skipCue:(BOOL)skip;
- (id<CogDecoder>)audioDecoderForSource:(id<CogSource>)source skipCue:(BOOL)skip;
- (int)putMetadataInURL:(NSURL *)url;

View File

@ -486,7 +486,7 @@ static PluginController *sharedPluginController = nil;
}
// If no properties reader is defined, use the decoder's properties.
- (NSDictionary *)propertiesForURL:(NSURL *)url {
- (NSDictionary *)propertiesForURL:(NSURL *)url skipCue:(BOOL)skip {
NSString *urlScheme = [url scheme];
if([urlScheme isEqualToString:@"http"] ||
[urlScheme isEqualToString:@"https"])
@ -531,7 +531,7 @@ static PluginController *sharedPluginController = nil;
}
{
id<CogDecoder> decoder = [self audioDecoderForSource:source skipCue:NO];
id<CogDecoder> decoder = [self audioDecoderForSource:source skipCue:skip];
if(![decoder open:source]) {
return nil;
}

View File

@ -48,7 +48,7 @@
// Embedded cuesheet check
fileMetadata = [NSClassFromString(@"AudioMetadataReader") metadataForURL:url skipCue:YES];
NSDictionary *alsoMetadata = [NSClassFromString(@"AudioPropertiesReader") propertiesForURL:url];
NSDictionary *alsoMetadata = [NSClassFromString(@"AudioPropertiesReader") propertiesForURL:url skipCue:YES];
NSString *sheet = [fileMetadata objectForKey:@"cuesheet"];
if(!sheet || ![sheet length]) sheet = [alsoMetadata objectForKey:@"cuesheet"];

View File

@ -45,7 +45,7 @@
// Embedded cuesheet check
fileMetadata = [audioMetadataReader metadataForURL:url skipCue:YES];
NSDictionary *alsoMetadata = [NSClassFromString(@"AudioPropertiesReader") propertiesForURL:url];
NSDictionary *alsoMetadata = [NSClassFromString(@"AudioPropertiesReader") propertiesForURL:url skipCue:YES];
NSString *sheet = [fileMetadata objectForKey:@"cuesheet"];
if(!sheet || ![sheet length]) sheet = [alsoMetadata objectForKey:@"cuesheet"];