Compare commits

..

No commits in common. "d4fec5c70e09e34cd7404d052ebc3255d8a63d3c" and "9055bc45f35a71951cd793f3a01092dfc14a8bca" have entirely different histories.

3 changed files with 8 additions and 26 deletions

View file

@ -363,7 +363,6 @@ static void * kDSPRubberbandNodeContext = &kDSPRubberbandNodeContext;
- (void)setEndOfStream:(BOOL)e {
if(endOfStream && !e) {
while(processEntered);
[self fullShutdown];
}
[super setEndOfStream:e];

View file

@ -21,16 +21,6 @@ extern NSMutableDictionary<NSString *, AlbumArtwork *> *kArtworkDictionary;
@implementation PlaylistEntry (Extension)
// The following is needed for handling any tag names with periods in them, as KVE wants to treat these as nested objects
// Let's hack in U+2024 and hope nobody notices!
+ (NSString *)keyForMetaTag:(NSString *)tagName {
return [tagName stringByReplacingOccurrencesOfString:@"." withString:@""];
}
+ (NSString *)metaTagForKey:(NSString *)key {
return [key stringByReplacingOccurrencesOfString:@"" withString:@"."];
}
// The following read-only keys depend on the values of other properties
+ (NSSet *)keyPathsForValuesAffectingUrl {
@ -533,8 +523,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
}
self.volume = 1;
for(NSString *key in metadata) {
NSString *tagName = [PlaylistEntry metaTagForKey:key];
NSString *lowerKey = [tagName lowercaseString];
NSString *lowerKey = [key lowercaseString];
id valueObj = [metadata objectForKey:key];
NSArray *values = nil;
NSString *firstValue = nil;
@ -593,7 +582,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
} else if([lowerKey isEqualToString:@"albumart"]) {
self.albumArt = dataValue;
} else {
[metaDict setObject:values forKey:key];
[metaDict setObject:values forKey:lowerKey];
}
}
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDict];
@ -873,9 +862,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
NSDictionary *metaDict = (NSDictionary *)metaObj;
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
NSArray *values = [metaDict objectForKey:realKey];
NSArray *values = [metaDict objectForKey:tagName];
if(values) {
return [values componentsJoinedByString:@", "];
@ -895,9 +883,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
NSDictionary *metaDict = (NSDictionary *)metaObj;
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
[metaDictCopy removeObjectForKey:realKey];
[metaDictCopy removeObjectForKey:tagName];
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
}
@ -916,9 +903,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
NSDictionary *metaDict = (NSDictionary *)metaObj;
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
[metaDictCopy setObject:values forKey:realKey];
[metaDictCopy setObject:values forKey:tagName];
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
}
@ -930,9 +916,8 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
NSDictionary *metaDict = (NSDictionary *)metaObj;
NSMutableDictionary *metaDictCopy = [metaDict mutableCopy];
NSString *realKey = [PlaylistEntry keyForMetaTag:tagName];
NSArray *values = [metaDictCopy objectForKey:realKey];
NSArray *values = [metaDictCopy objectForKey:tagName];
NSMutableArray *valuesCopy;
if(values) {
valuesCopy = [values mutableCopy];
@ -941,7 +926,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
}
[valuesCopy addObject:value];
values = [NSArray arrayWithArray:valuesCopy];
[metaDictCopy setObject:values forKey:realKey];
[metaDictCopy setObject:values forKey:tagName];
self.metadataBlob = [NSDictionary dictionaryWithDictionary:metaDictCopy];
}

View file

@ -100,7 +100,6 @@ static SandboxBroker *kSharedSandboxBroker = nil;
if(![url isFileURL]) return url;
NSString *s = [url path];
if(!s) return NULL; // Cool, the resource no longer exists!
NSRange fragmentRange = [s rangeOfString:@"#"
options:NSBackwardsSearch];
@ -271,7 +270,6 @@ static inline void dispatch_async_reentrant(dispatch_queue_t queue, dispatch_blo
if(![fileUrl isFileURL]) return;
NSURL *url = [SandboxBroker urlWithoutFragment:fileUrl];
if(!url) return;
dispatch_async_reentrant(dispatch_get_main_queue(), ^{
SandboxEntry *_entry = nil;
@ -424,7 +422,7 @@ static inline void dispatch_async_reentrant(dispatch_queue_t queue, dispatch_blo
- (const void *)beginFolderAccess:(NSURL *)fileUrl {
if(!fileUrl) return NULL;
NSURL *folderUrl = [SandboxBroker urlWithoutFragment:fileUrl];
if(!folderUrl || ![folderUrl isFileURL]) return NULL;
if(![folderUrl isFileURL]) return NULL;
__block SandboxEntry *_entry = nil;