Fixed build

This commit is contained in:
Damiano Galassi committed 2015-09-14 10:58:09 +02:00
1 parent 93c779e02b
commit 7ff4c086d0
4 files changed
+23 -23

No files matched your search

+8 -8
View File
@@ -17,11 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
BOOL _isCancelled; BOOL _isCancelled;
} }
typedef enum SBCachePolicy : NSUInteger { typedef NS_ENUM(NSUInteger, SBCachePolicy) {
SBDefaultPolicy = 0, SBDefaultPolicy,
SBReturnCacheElseLoad, SBReturnCacheElseLoad,
SBReloadIgnoringLocalCacheData, SBReloadIgnoringLocalCacheData,
} SBCachePolicy; };
#pragma mark Helper routines #pragma mark Helper routines
+ (NSDictionary<NSString *, NSString *> *)parseFilename:(NSString *)filename; + (NSDictionary<NSString *, NSString *> *)parseFilename:(NSString *)filename;
@@ -53,13 +53,13 @@ typedef enum SBCachePolicy : NSUInteger {
#pragma mark Methods to be overridden #pragma mark Methods to be overridden
- (NSArray<NSString *> *) languages; - (NSArray<NSString *> *) languages;
- (NSArray<MP42Metadata *> * _Nullable) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage; - (nullable NSArray<MP42Metadata *> *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage;
- (NSArray<MP42Metadata *> * _Nullable) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(NSString * _Nullable)aSeasonNum episodeNum:(NSString * _Nullable)aEpisodeNum; - (nullable NSArray<MP42Metadata *> *) searchTVSeries:(NSString *)aSeriesName language:(NSString *)aLanguage seasonNum:(nullable NSString *)aSeasonNum episodeNum:(nullable NSString *)aEpisodeNum;
- (NSArray<MP42Metadata *> * _Nullable) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage; - (nullable NSArray<MP42Metadata *> *) searchMovie:(NSString *)aMovieTitle language:(NSString *)aLanguage;
- (MP42Metadata * _Nullable) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage; - (nullable MP42Metadata *) loadTVMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage;
- (MP42Metadata * _Nullable) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage; - (nullable MP42Metadata *) loadMovieMetadata:(MP42Metadata *)aMetadata language:(NSString *)aLanguage;
@end @end
+3 -3
View File
@@ -174,7 +174,7 @@
IOReturn io_success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep, IOReturn io_success = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep,
kIOPMAssertionLevelOn, reasonForActivity, &assertionID); kIOPMAssertionLevelOn, reasonForActivity, &assertionID);
BOOL result = NO; BOOL result = NO;
NSDictionary<NSString *, NSNumber *> *attributes = [self saveAttributes]; NSDictionary<NSString *, NSNumber *> *options = [self saveAttributes];
self.mp4.progressHandler = ^(double progress){ self.mp4.progressHandler = ^(double progress){
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
@@ -187,12 +187,12 @@
case NSSaveOperation: case NSSaveOperation:
// movie file already exists, so we'll just update // movie file already exists, so we'll just update
// the movie resource. // the movie resource.
result = [self.mp4 updateMP4FileWithAttributes:attributes error:outError]; result = [self.mp4 updateMP4FileWithOptions:options error:outError];
break; break;
case NSSaveAsOperation: case NSSaveAsOperation:
// movie does not exist, create a new one from scratch. // movie does not exist, create a new one from scratch.
result = [self.mp4 writeToUrl:url withAttributes:attributes error:outError]; result = [self.mp4 writeToUrl:url options:options error:outError];
break; break;
default: default:
+10 -10
View File
@@ -491,18 +491,21 @@
#pragma mark NSComboBox delegates and protocols #pragma mark NSComboBox delegates and protocols
- (NSString *)comboBox:(NSComboBox *)comboBox completedString:(NSString *)uncompletedString { - (NSString *)comboBox:(NSComboBox *)comboBox completedString:(NSString *)uncompletedString {
if (!uncompletedString || ([uncompletedString length] < 1)) return nil;
if (uncompletedString.length < 1) {
return nil;
}
if (comboBox == tvSeriesName) { if (comboBox == tvSeriesName) {
NSArray *previousTVseries = [[NSUserDefaults standardUserDefaults] arrayForKey:@"Previously used TV series"]; NSArray *previousTVseries = [[NSUserDefaults standardUserDefaults] arrayForKey:@"Previously used TV series"];
if (previousTVseries == nil) return nil; if (previousTVseries == nil) { return nil; }
NSEnumerator *previousTVseriesEnum = [previousTVseries objectEnumerator];
NSString *s; for (NSString *s in previousTVseries) {
while ((s = (NSString *) [previousTVseriesEnum nextObject])) { if ([s.lowercaseString hasPrefix:uncompletedString.lowercaseString]) {
if ([[s lowercaseString] hasPrefix:[uncompletedString lowercaseString]]) {
return s; return s;
} }
} }
return nil;
} }
return nil; return nil;
} }
@@ -535,9 +538,6 @@
} }
- (NSInteger)numberOfItemsInComboBox:(NSComboBox *)comboBox { - (NSInteger)numberOfItemsInComboBox:(NSComboBox *)comboBox {
// for some unknown reason, the number of items displayed won't be correct unless these member variables get accessed
// bug to fix!
//NSLog(@"in numberOfItemsInComboBox; box numberOfVisibleItems = %d, cell numberOfVisibleItems = %d", (int) [comboBox numberOfVisibleItems], (int) [[comboBox cell] numberOfVisibleItems]);
if (comboBox == tvSeriesName) { if (comboBox == tvSeriesName) {
return self.tvSeriesNameSearchArray.count; return self.tvSeriesNameSearchArray.count;
} }
+2 -2
View File
@@ -315,11 +315,11 @@
if (!self.cancelled) { if (!self.cancelled) {
if ([self.URL isEqualTo:self.destURL] && [self.mp4File hasFileRepresentation]) { if ([self.URL isEqualTo:self.destURL] && [self.mp4File hasFileRepresentation]) {
// We have an existing mp4 file, update it // We have an existing mp4 file, update it
noErr = [self.mp4File updateMP4FileWithAttributes:self.attributes error:outError]; noErr = [self.mp4File updateMP4FileWithOptions:self.attributes error:outError];
} else { } else {
// Write the new file to disk // Write the new file to disk
noErr = [self.mp4File writeToUrl:self.destURL noErr = [self.mp4File writeToUrl:self.destURL
withAttributes:self.attributes options:self.attributes
error:outError]; error:outError];
} }
} }