Remove the meta string cache
It wasn't helping anyway. Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
564a8739d0
commit
02f49093a3
|
@ -19,16 +19,8 @@
|
|||
extern NSPersistentContainer *kPersistentContainer;
|
||||
extern NSMutableDictionary<NSString *, AlbumArtwork *> *kArtworkDictionary;
|
||||
|
||||
static NSMutableDictionary *kMetadataCache = nil;
|
||||
|
||||
@implementation PlaylistEntry (Extension)
|
||||
|
||||
+ (void)initialize {
|
||||
if(!kMetadataCache) {
|
||||
kMetadataCache = [[NSMutableDictionary alloc] init];
|
||||
}
|
||||
}
|
||||
|
||||
// The following read-only keys depend on the values of other properties
|
||||
|
||||
+ (NSSet *)keyPathsForValuesAffectingUrl {
|
||||
|
@ -789,14 +781,6 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
|||
}
|
||||
|
||||
- (NSString *_Nullable)readAllValuesAsString:(NSString *_Nonnull)tagName {
|
||||
NSMutableDictionary *dict = [kMetadataCache objectForKey:self.urlString];
|
||||
if(dict) {
|
||||
NSString *value = [dict objectForKey:tagName];
|
||||
if(value) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
id metaObj = self.metadataBlob;
|
||||
|
||||
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
||||
|
@ -805,13 +789,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
|||
NSArray *values = [metaDict objectForKey:tagName];
|
||||
|
||||
if(values) {
|
||||
NSString *value = [values componentsJoinedByString:@", "];
|
||||
if(!dict) {
|
||||
dict = [[NSMutableDictionary alloc] init];
|
||||
[kMetadataCache setObject:dict forKey:self.urlString];
|
||||
}
|
||||
[dict setObject:value forKey:tagName];
|
||||
return value;
|
||||
return [values componentsJoinedByString:@", "];
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -820,7 +798,6 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
|||
|
||||
- (void)deleteAllValues {
|
||||
self.metadataBlob = nil;
|
||||
[kMetadataCache removeObjectForKey:self.urlString];
|
||||
}
|
||||
|
||||
- (void)deleteValue:(NSString *_Nonnull)tagName {
|
||||
|
@ -857,11 +834,6 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path) {
|
|||
}
|
||||
|
||||
- (void)addValue:(NSString *_Nonnull)tagName fromString:(NSString *_Nonnull)value {
|
||||
NSMutableDictionary *dict = [kMetadataCache objectForKey:self.urlString];
|
||||
if(dict) {
|
||||
[dict removeObjectForKey:tagName];
|
||||
}
|
||||
|
||||
id metaObj = self.metadataBlob;
|
||||
|
||||
if(metaObj && [metaObj isKindOfClass:[NSDictionary class]]) {
|
||||
|
|
Loading…
Reference in New Issue