Fix some warnings.
This commit is contained in:
1 parent
2077febc70
commit
60758e225b
13 files changed
+25
-18
No files matched your search
@@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+ (NSArray<NSString *> *) movieProviders;
|
||||
+ (NSArray<NSString *> *) tvProviders;
|
||||
+ (NSArray<NSString *> *) languagesForProvider:(NSString *)aProvider;
|
||||
+ (instancetype) importerForProvider:(NSString *)aProviderName;
|
||||
+ (nullable instancetype) importerForProvider:(NSString *)aProviderName;
|
||||
+ (instancetype) defaultMovieProvider;
|
||||
+ (instancetype) defaultTVProvider;
|
||||
+ (NSString *) defaultMovieLanguage;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
return a;
|
||||
}
|
||||
|
||||
+ (instancetype)importerForProvider:(NSString *)aProvider {
|
||||
+ (nullable instancetype)importerForProvider:(NSString *)aProvider {
|
||||
if ([aProvider isEqualToString:@"iTunes Store"]) {
|
||||
return [[[iTunesStore alloc] init] autorelease];
|
||||
} else if ([aProvider isEqualToString:@"TheMovieDB"]) {
|
||||
|
||||
@@ -20,7 +20,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
+ (NSString *)defaultProvider;
|
||||
|
||||
+ (instancetype)importerForProvider:(NSString *)providerName;
|
||||
+ (nullable instancetype)importerForProvider:(NSString *)providerName;
|
||||
- (void) searchTitle:(NSString *)title language:(nullable NSString *)language duration:(NSUInteger)duration completionHandler:(void(^)(NSArray<SBChapterResult *> * _Nullable results))handler;
|
||||
- (void) cancel;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
return @"ChapterDB";
|
||||
}
|
||||
|
||||
+ (instancetype)importerForProvider:(NSString *)aProvider
|
||||
+ (nullable instancetype)importerForProvider:(NSString *)aProvider
|
||||
{
|
||||
if ([aProvider isEqualToString:@"ChapterDB"]) {
|
||||
return [[[SBChapterDB alloc] init] autorelease];
|
||||
|
||||
@@ -19,7 +19,7 @@ typedef NS_ENUM(NSUInteger, SBCachePolicy) {
|
||||
};
|
||||
|
||||
#pragma mark Helper routines
|
||||
+ (NSDictionary<NSString *, NSString *> *)parseFilename:(NSString *)filename;
|
||||
+ (nullable NSDictionary<NSString *, NSString *> *)parseFilename:(NSString *)filename;
|
||||
+ (NSString *)urlEncoded:(NSString *)string;
|
||||
|
||||
+ (nullable NSData *)downloadDataFromURL:(NSURL *)url withCachePolicy:(SBCachePolicy)policy;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
@implementation SBMetadataHelper
|
||||
|
||||
+ (NSDictionary<NSString *, NSString *> *)parseFilename:(NSString *)filename
|
||||
+ (nullable NSDictionary<NSString *, NSString *> *)parseFilename:(NSString *)filename
|
||||
{
|
||||
NSParameterAssert(filename);
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
+ (nullable NSDictionary *) getStoreFor:(NSString *)aLanguageString;
|
||||
|
||||
#pragma mark Quick iTunes search for metadata
|
||||
+ (MP42Metadata *) quickiTunesSearchTV:(NSString *)aSeriesName episodeTitle:(NSString *)aEpisodeTitle;
|
||||
+ (MP42Metadata *) quickiTunesSearchMovie:(NSString *)aMovieName;
|
||||
+ (nullable MP42Metadata *) quickiTunesSearchTV:(NSString *)aSeriesName episodeTitle:(NSString *)aEpisodeTitle;
|
||||
+ (nullable MP42Metadata *) quickiTunesSearchMovie:(NSString *)aMovieName;
|
||||
|
||||
#pragma mark Parse results
|
||||
+ (NSArray<NSString *> *) readPeople:(NSString *)aPeople fromXML:(NSXMLDocument *)aXml;
|
||||
|
||||
@@ -171,7 +171,7 @@ NSInteger sortMP42Metadata(id ep1, id ep2, void *context)
|
||||
|
||||
#pragma mark Quick iTunes search for metadata
|
||||
|
||||
+ (MP42Metadata *) quickiTunesSearchTV:(NSString *)aSeriesName episodeTitle:(NSString *)aEpisodeTitle {
|
||||
+ (nullable MP42Metadata *) quickiTunesSearchTV:(NSString *)aSeriesName episodeTitle:(NSString *)aEpisodeTitle {
|
||||
NSDictionary *store = [iTunesStore getStoreFor:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV|iTunes Store|Language"]];
|
||||
if (!store) {
|
||||
return nil;
|
||||
@@ -190,7 +190,7 @@ NSInteger sortMP42Metadata(id ep1, id ep2, void *context)
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (MP42Metadata *) quickiTunesSearchMovie:(NSString *)aMovieName {
|
||||
+ (nullable MP42Metadata *) quickiTunesSearchMovie:(NSString *)aMovieName {
|
||||
NSDictionary *store = [iTunesStore getStoreFor:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|Movie|iTunes Store|Language"]];
|
||||
if (!store) {
|
||||
return nil;
|
||||
|
||||
@@ -70,10 +70,17 @@
|
||||
NSMutableParagraphStyle *psL = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] autorelease];
|
||||
psL.headIndent = -10.0;
|
||||
psL.alignment = NSTextAlignmentLeft;
|
||||
_detailBoldAttr = [@{NSFontAttributeName: [NSFont systemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightBold],
|
||||
NSParagraphStyleAttributeName: psL,
|
||||
NSForegroundColorAttributeName: [NSColor grayColor]} retain];
|
||||
|
||||
if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
|
||||
_detailBoldAttr = [@{NSFontAttributeName: [NSFont systemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightBold],
|
||||
NSParagraphStyleAttributeName: psL,
|
||||
NSForegroundColorAttributeName: [NSColor grayColor]} retain];
|
||||
}
|
||||
else {
|
||||
_detailBoldAttr = [@{NSFontAttributeName: [NSFont boldSystemFontOfSize:[NSFont smallSystemFontSize]],
|
||||
NSParagraphStyleAttributeName: ps,
|
||||
NSForegroundColorAttributeName: [NSColor grayColor]} retain];
|
||||
}
|
||||
|
||||
if ([[NSFont class] respondsToSelector:@selector(monospacedDigitSystemFontOfSize:weight:)]) {
|
||||
_detailMonospacedAttr = [@{NSFontAttributeName: [NSFont monospacedDigitSystemFontOfSize:[NSFont smallSystemFontSize] weight:NSFontWeightRegular],
|
||||
|
||||
@@ -36,7 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
}
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (instancetype)initWithURLs:(NSArray<NSURL *> *)fileURLs delegate:(id <SBFileImportDelegate>)delegate error:(NSError **)error;
|
||||
- (nullable instancetype)initWithURLs:(NSArray<NSURL *> *)fileURLs delegate:(id <SBFileImportDelegate>)delegate error:(NSError **)error;
|
||||
|
||||
- (IBAction)closeWindow:(id)sender;
|
||||
- (IBAction)addTracks:(id)sender;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
@implementation SBFileImport
|
||||
|
||||
- (instancetype)initWithURLs:(NSArray<NSURL *> *)fileURLs delegate:(id <SBFileImportDelegate>)delegate error:(NSError **)error
|
||||
- (nullable instancetype)initWithURLs:(NSArray<NSURL *> *)fileURLs delegate:(id <SBFileImportDelegate>)delegate error:(NSError **)error
|
||||
{
|
||||
if ((self = [super initWithWindowNibName:@"FileImport"])) {
|
||||
_delegate = delegate;
|
||||
|
||||
@@ -33,7 +33,7 @@ extern NSString * const SBQueueDestination;
|
||||
}
|
||||
|
||||
@property (nonatomic, readonly) NSMutableDictionary *options;
|
||||
@property (nonatomic, readonly) NSURL *queueURL;
|
||||
@property (nonatomic, readonly, nullable) NSURL *queueURL;
|
||||
|
||||
+ (void)registerUserDefaults;
|
||||
- (void)saveUserDefaults;
|
||||
|
||||
@@ -88,12 +88,12 @@ NSString * const SBQueueSet = @"SBQueueSet";
|
||||
[[NSUserDefaults standardUserDefaults] setValue:[[self.options objectForKey:SBQueueSet] presetName] forKey:SBQueueSet];
|
||||
}
|
||||
|
||||
- (NSURL *)queueURL {
|
||||
- (nullable NSURL *)queueURL {
|
||||
NSURL *appSupportURL = nil;
|
||||
NSArray *allPaths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory,
|
||||
NSUserDomainMask,
|
||||
YES);
|
||||
if ([allPaths count]) {
|
||||
if (allPaths.count) {
|
||||
appSupportURL = [NSURL fileURLWithPath:[[[allPaths lastObject] stringByAppendingPathComponent:@"Subler"]
|
||||
stringByAppendingPathComponent:@"queue.sbqueue"] isDirectory:YES];
|
||||
return appSupportURL;
|
||||
|
||||
Reference in new issue
Block a user