OCD
This commit is contained in:
1 parent
a9b370a541
commit
562b057315
10 files changed
+36
-22
No files matched your search
@@ -23,7 +23,7 @@
|
||||
|
||||
@interface MetadataImporter ()
|
||||
|
||||
@property (readwrite) BOOL isCancelled;
|
||||
@property (atomic, readwrite) BOOL isCancelled;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
@interface SBImageBrowserView : IKImageBrowserView {
|
||||
NSArray *_pasteboardTypes;
|
||||
}
|
||||
@property(readwrite, retain) NSArray *pasteboardTypes;
|
||||
@property(nonatomic, readwrite, retain) NSArray *pasteboardTypes;
|
||||
@end
|
||||
@@ -9,6 +9,8 @@
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <MP42Foundation/MP42Logging.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@class SBLogger;
|
||||
|
||||
@interface SBLogWindowController : NSWindowController <MP42Logging> {
|
||||
@@ -19,3 +21,5 @@
|
||||
- (instancetype)initWithLogger:(SBLogger *)logger;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
@interface SBLogWindowController ()
|
||||
|
||||
@property (assign) IBOutlet NSTextView *logView;
|
||||
@property (readonly) SBLogger *logger;
|
||||
@property (nonatomic, assign) IBOutlet NSTextView *logView;
|
||||
@property (nonatomic, readonly) SBLogger *logger;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
+5
-1
@@ -9,15 +9,19 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <MP42Foundation/MP42Logging.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface SBLogger : NSObject <MP42Logging> {
|
||||
NSURL *_fileURL;
|
||||
id <MP42Logging> _delegate;
|
||||
}
|
||||
|
||||
@property (assign, readwrite) id <MP42Logging> delegate;
|
||||
@property (atomic, assign, readwrite, nullable) id <MP42Logging> delegate;
|
||||
|
||||
- (instancetype)initWithLogFile:(NSURL *)fileURL;
|
||||
|
||||
- (void)clearLog;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
|
||||
@interface SBLogger ()
|
||||
|
||||
@property (readonly) NSURL *fileURL;
|
||||
@property (nonatomic, readonly) NSURL *fileURL;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -18,15 +18,15 @@
|
||||
|
||||
@interface SBMetadataSearchController () <NSTableViewDelegate, SBArtworkSelectorDelegate>
|
||||
|
||||
@property (readwrite, retain) MetadataImporter *currentSearcher;
|
||||
@property (readwrite, retain) NSArray *resultsArray;
|
||||
@property (nonatomic, readwrite, retain) MetadataImporter *currentSearcher;
|
||||
@property (nonatomic, readwrite, retain) NSArray<MP42Metadata *> *resultsArray;
|
||||
|
||||
@property (readwrite, retain) MP42Metadata *selectedResult;
|
||||
@property (nonatomic, readwrite, retain) MP42Metadata *selectedResult;
|
||||
|
||||
@property (readwrite, retain) NSDictionary *selectedResultTags;
|
||||
@property (readwrite, retain) NSArray *selectedResultTagsArray;
|
||||
@property (nonatomic, readwrite, retain) NSDictionary *selectedResultTags;
|
||||
@property (nonatomic, readwrite, retain) NSArray<NSString *> *selectedResultTagsArray;
|
||||
|
||||
@property (readwrite, retain) NSMutableArray *tvSeriesNameSearchArray;
|
||||
@property (nonatomic, readwrite, retain) NSMutableArray<NSString *> *tvSeriesNameSearchArray;
|
||||
|
||||
#pragma mark Metadata provider
|
||||
- (void) createLanguageMenus;
|
||||
@@ -360,23 +360,26 @@
|
||||
[resultsTable setEnabled:NO];
|
||||
[metadataTable setEnabled:NO];
|
||||
|
||||
NSArray<NSURL *> *URLs = [self.selectedResult.artworkFullsizeURLs copy];
|
||||
NSArray<NSString *> *providerNames = [self.selectedResult.artworkProviderNames copy];
|
||||
|
||||
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
||||
|
||||
[indexes enumerateIndexesUsingBlock:^(NSUInteger idx, BOOL *stop) {
|
||||
NSData *artworkData = [MetadataImporter downloadDataFromURL:[self.selectedResult.artworkFullsizeURLs objectAtIndex:idx] withCachePolicy:SBDefaultPolicy];
|
||||
NSData *artworkData = [MetadataImporter downloadDataFromURL:URLs[idx] withCachePolicy:SBDefaultPolicy];
|
||||
|
||||
// Hack, download smaller iTunes version if big iTunes version is not available
|
||||
if (!artworkData) {
|
||||
NSString *provider = [self.selectedResult.artworkProviderNames objectAtIndex:idx];
|
||||
NSString *provider = providerNames[idx];
|
||||
if ([provider isEqualToString:@"iTunes"]) {
|
||||
NSURL *url = [self.selectedResult.artworkFullsizeURLs objectAtIndex:idx];
|
||||
NSURL *url = URLs[idx];
|
||||
url = [[url URLByDeletingPathExtension] URLByAppendingPathExtension:@"600x600-75.jpg"];
|
||||
artworkData = [MetadataImporter downloadDataFromURL:url withCachePolicy:SBDefaultPolicy];
|
||||
}
|
||||
}
|
||||
|
||||
// Add artwork to metadata object
|
||||
if (artworkData && [artworkData length]) {
|
||||
if (artworkData && artworkData.length) {
|
||||
MP42Image *artwork = [[MP42Image alloc] initWithData:artworkData type:MP42_ART_JPEG];
|
||||
[self.selectedResult.artworks addObject:artwork];
|
||||
[artwork release];
|
||||
@@ -386,8 +389,11 @@
|
||||
dispatch_sync(dispatch_get_main_queue(), ^{
|
||||
[self addMetadata];
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
[URLs release];
|
||||
[providerNames release];
|
||||
|
||||
} else {
|
||||
[self addMetadata];
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ extern NSString *SBPresetManagerUpdatedNotification;
|
||||
- (MP42Metadata *)setWithName:(NSString *)name;
|
||||
- (BOOL)removePresetAtIndex:(NSUInteger)index;
|
||||
|
||||
@property(readonly) NSArray<MP42Metadata *> *presets;
|
||||
@property(atomic, readonly) NSArray<MP42Metadata *> *presets;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -31,8 +31,8 @@ extern NSString * const SBQueueDestination;
|
||||
NSMutableDictionary *_options;
|
||||
}
|
||||
|
||||
@property (readonly) NSMutableDictionary *options;
|
||||
@property (readonly) NSURL *queueURL;
|
||||
@property (nonatomic, readonly) NSMutableDictionary *options;
|
||||
@property (nonatomic, readonly) NSURL *queueURL;
|
||||
|
||||
+ (void)registerUserDefaults;
|
||||
- (void)saveUserDefaults;
|
||||
|
||||
@@ -24,6 +24,6 @@
|
||||
NSArray *_pasteboardTypes;
|
||||
NSInteger _defaultEditingColumn;
|
||||
}
|
||||
@property(readwrite, retain) NSArray *pasteboardTypes;
|
||||
@property(readwrite) NSInteger defaultEditingColumn;
|
||||
@property(nonatomic, readwrite, retain) NSArray *pasteboardTypes;
|
||||
@property(nonatomic, readwrite) NSInteger defaultEditingColumn;
|
||||
@end
|
||||
Reference in new issue
Block a user