[Path Config] Properly report broken bookmarks
Broken bookmarks weren't reporting as isStale, but rather, were failing to resolve at all, and without this change, they were impossible to detect in a migrated configuration. Signed-off-by: Christopher Snowhill <kode54@gmail.com>lastfm
parent
ab285417ae
commit
0e2bfeb671
|
@ -44,11 +44,7 @@
|
|||
BOOL isStale = YES;
|
||||
NSError *err = nil;
|
||||
NSURL *bookmarkUrl = [NSURL URLByResolvingBookmarkData:token.bookmark options:NSURLBookmarkResolutionWithSecurityScope relativeToURL:nil bookmarkDataIsStale:&isStale error:&err];
|
||||
if(!bookmarkUrl) {
|
||||
ALog(@"Stale bookmark for path: %@, with error: %@", token.path, [err localizedDescription]);
|
||||
continue;
|
||||
}
|
||||
[self addObject:@{ @"path": token.path, @"valid": (isStale ? NSLocalizedPrefString(@"ValidNo") : NSLocalizedPrefString(@"ValidYes")), @"isFolder": @(token.folder) }];
|
||||
[self addObject:@{ @"path": token.path, @"valid": ((!bookmarkUrl || isStale) ? NSLocalizedPrefString(@"ValidNo") : NSLocalizedPrefString(@"ValidYes")), @"isFolder": @(token.folder), @"token": token }];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue