Compare commits

..

No commits in common. "e852fdfccd149da63dac840f1591ad81b09e3cf4" and "d41e34913aa9c67e047b09b485031ae0d8e073e3" have entirely different histories.

5 changed files with 21 additions and 20 deletions

View file

@ -399,7 +399,7 @@ extern NSMutableDictionary<NSString *, AlbumArtwork *> *kArtworkDictionary;
NSURL *_Nullable urlForPath(NSString *_Nullable path) { NSURL *_Nullable urlForPath(NSString *_Nullable path) {
if(!path || ![path length]) { if(!path || ![path length]) {
return [NSURL URLWithString:@"silence://10"]; return nil;
} }
NSRange protocolRange = [path rangeOfString:@"://"]; NSRange protocolRange = [path rangeOfString:@"://"];

View file

@ -392,9 +392,7 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
for(url in urls) { for(url in urls) {
id<SentrySpan> pathTask = [sandboxTask startChildWithOperation:@"Process one folder" description:[NSString stringWithFormat:@"Processing file or folder: %@", url]]; id<SentrySpan> pathTask = [sandboxTask startChildWithOperation:@"Process one folder" description:[NSString stringWithFormat:@"Processing file or folder: %@", url]];
@try { @try {
if(!url) continue;
if([url isFileURL]) { if([url isFileURL]) {
if(![url path]) continue;
BOOL isDir; BOOL isDir;
if([[NSFileManager defaultManager] fileExistsAtPath:[url path] isDirectory:&isDir]) { if([[NSFileManager defaultManager] fileExistsAtPath:[url path] isDirectory:&isDir]) {
if(isDir == YES) { if(isDir == YES) {
@ -421,7 +419,6 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
} }
} else { } else {
// Non-file URL.. // Non-file URL..
if(![url absoluteString]) continue;
[expandedURLs setValue:url forKey:[PlaylistLoader keyForPath:[url absoluteString]]]; [expandedURLs setValue:url forKey:[PlaylistLoader keyForPath:[url absoluteString]]];
} }
@ -473,11 +470,11 @@ static inline void dispatch_sync_reentrant(dispatch_queue_t queue, dispatch_bloc
id<SentrySpan> innerTask = nil; id<SentrySpan> innerTask = nil;
NSURL *url = nil; NSURL *url = nil;
@try { @try {
url = obj;
if(containerTask) { if(containerTask) {
pathTask = [containerTask startChildWithOperation:@"Process path as container" description:[NSString stringWithFormat:@"Checking if file is container: %@", url]]; pathTask = [containerTask startChildWithOperation:@"Process path as container" description:[NSString stringWithFormat:@"Checking if file is container: %@", url]];
} }
url = obj;
[lock lock]; [lock lock];
if([uniqueURLs containsObject:url]) { if([uniqueURLs containsObject:url]) {
[lock unlock]; [lock unlock];
@ -813,7 +810,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path);
- (void)loadInfoForEntries:(NSArray *)entries { - (void)loadInfoForEntries:(NSArray *)entries {
NSMutableDictionary *queueThisJob = [[NSMutableDictionary alloc] init]; NSMutableDictionary *queueThisJob = [[NSMutableDictionary alloc] init];
for(PlaylistEntry *pe in entries) { for(PlaylistEntry *pe in entries) {
if(!pe || !pe.urlString || ![pe.urlString length] || pe.deLeted || pe.metadataLoaded) continue; if(!pe || !pe.urlString || pe.deLeted || pe.metadataLoaded) continue;
NSString *path = pe.urlString; NSString *path = pe.urlString;
NSMutableArray *entrySet = [queueThisJob objectForKey:path]; NSMutableArray *entrySet = [queueThisJob objectForKey:path];
@ -1163,7 +1160,7 @@ NSURL *_Nullable urlForPath(NSString *_Nullable path);
NSMutableIndexSet *pruneSet = [[NSMutableIndexSet alloc] init]; NSMutableIndexSet *pruneSet = [[NSMutableIndexSet alloc] init];
NSUInteger index = 0; NSUInteger index = 0;
for(PlaylistEntry *pe in resultsCopy) { for(PlaylistEntry *pe in resultsCopy) {
if(pe.deLeted || !pe.urlString || ![pe.urlString length]) { if(pe.deLeted || !pe.urlString || [pe.urlString length] < 1) {
[pruneSet addIndex:index]; [pruneSet addIndex:index];
[moc deleteObject:pe]; [moc deleteObject:pe];
} }

View file

@ -10,8 +10,6 @@
#import "SandboxBroker.h" #import "SandboxBroker.h"
#import "Logging.h"
@implementation FileSource @implementation FileSource
+ (void)initialize { + (void)initialize {
@ -36,10 +34,6 @@
sbHandle = [sandboxBroker beginFolderAccess:url]; sbHandle = [sandboxBroker beginFolderAccess:url];
NSString *path = [url path]; NSString *path = [url path];
if(!path) {
ALog(@"Invalid URL: %@", url);
return NO;
}
fex_type_t type; fex_type_t type;
fex_err_t error = fex_identify_file(&type, [path UTF8String]); fex_err_t error = fex_identify_file(&type, [path UTF8String]);

View file

@ -40,7 +40,6 @@
8307D31B2860722C000FF8EB /* SandboxBroker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SandboxBroker.h; path = ../../Utils/SandboxBroker.h; sourceTree = "<group>"; }; 8307D31B2860722C000FF8EB /* SandboxBroker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SandboxBroker.h; path = ../../Utils/SandboxBroker.h; sourceTree = "<group>"; };
8335FF6817FF765A002D8DD2 /* File_Extractor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = File_Extractor.xcodeproj; path = ../../Frameworks/File_Extractor/File_Extractor.xcodeproj; sourceTree = "<group>"; }; 8335FF6817FF765A002D8DD2 /* File_Extractor.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = File_Extractor.xcodeproj; path = ../../Frameworks/File_Extractor/File_Extractor.xcodeproj; sourceTree = "<group>"; };
834A42AD287AF25600EB9D9B /* AudioChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioChunk.h; path = ../../Audio/Chain/AudioChunk.h; sourceTree = "<group>"; }; 834A42AD287AF25600EB9D9B /* AudioChunk.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AudioChunk.h; path = ../../Audio/Chain/AudioChunk.h; sourceTree = "<group>"; };
835F15B82DF80DE1008C7054 /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = /Users/chris/Source/Repos/cog/Utils/Logging.h; sourceTree = "<absolute>"; };
83747C4F2862DD2F0021245F /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; }; 83747C4F2862DD2F0021245F /* Shared.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Shared.xcconfig; sourceTree = "<group>"; };
8D5B49B6048680CD000E48DA /* FileSource.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileSource.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; 8D5B49B6048680CD000E48DA /* FileSource.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FileSource.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
@ -94,7 +93,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
834A42AD287AF25600EB9D9B /* AudioChunk.h */, 834A42AD287AF25600EB9D9B /* AudioChunk.h */,
835F15B82DF80DE1008C7054 /* Logging.h */,
8307D31B2860722C000FF8EB /* SandboxBroker.h */, 8307D31B2860722C000FF8EB /* SandboxBroker.h */,
17ADB4080B979A8A00257CA2 /* Plugin.h */, 17ADB4080B979A8A00257CA2 /* Plugin.h */,
17ADB4180B979AEB00257CA2 /* FileSource.h */, 17ADB4180B979AEB00257CA2 /* FileSource.h */,

View file

@ -299,11 +299,17 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = ../../ThirdParty/libid3tag/include; HEADER_SEARCH_PATHS = (
../../ThirdParty/libmad/include,
../../ThirdParty/libid3tag/include,
);
INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSPrincipalClass = ""; INFOPLIST_KEY_NSPrincipalClass = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = ../../ThirdParty/libid3tag/lib; LIBRARY_SEARCH_PATHS = (
../../ThirdParty/libmad/lib,
../../ThirdParty/libid3tag/lib,
);
MACOSX_DEPLOYMENT_TARGET = 10.13; MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = co.losno.MAD; PRODUCT_BUNDLE_IDENTIFIER = co.losno.MAD;
@ -321,11 +327,17 @@
CURRENT_PROJECT_VERSION = 1; CURRENT_PROJECT_VERSION = 1;
DEAD_CODE_STRIPPING = YES; DEAD_CODE_STRIPPING = YES;
GENERATE_INFOPLIST_FILE = YES; GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = ../../ThirdParty/libid3tag/include; HEADER_SEARCH_PATHS = (
../../ThirdParty/libmad/include,
../../ThirdParty/libid3tag/include,
);
INFOPLIST_KEY_NSHumanReadableCopyright = ""; INFOPLIST_KEY_NSHumanReadableCopyright = "";
INFOPLIST_KEY_NSPrincipalClass = ""; INFOPLIST_KEY_NSPrincipalClass = "";
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
LIBRARY_SEARCH_PATHS = ../../ThirdParty/libid3tag/lib; LIBRARY_SEARCH_PATHS = (
../../ThirdParty/libmad/lib,
../../ThirdParty/libid3tag/lib,
);
MACOSX_DEPLOYMENT_TARGET = 10.13; MACOSX_DEPLOYMENT_TARGET = 10.13;
MARKETING_VERSION = 1.0; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = co.losno.MAD; PRODUCT_BUNDLE_IDENTIFIER = co.losno.MAD;