Renamed MetadataImporter to SBMetadataImporter.
This commit is contained in:
1 parent
a05dd0d4e8
commit
47d99e8915
13 files changed
+72
-72
No files matched your search
+1
-1
@@ -13,7 +13,7 @@
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface MetadataImporter : NSObject {
|
||||
@interface SBMetadataImporter : NSObject {
|
||||
@private
|
||||
BOOL _isCancelled;
|
||||
}
|
||||
+9
-9
@@ -9,21 +9,21 @@
|
||||
#import <MP42Foundation/MP42Metadata.h>
|
||||
#import <MP42Foundation/MP42Languages.h>
|
||||
|
||||
#import "MetadataImporter.h"
|
||||
#import "SBMetadataImporter.h"
|
||||
|
||||
#import "SBMetadataSearchController.h"
|
||||
|
||||
#import "iTunesStore.h"
|
||||
#import "TheMovieDB3.h"
|
||||
#import "TheTVDB.h"
|
||||
#import "SBiTunesStore.h"
|
||||
#import "SBTheMovieDB3.h"
|
||||
#import "SBTheTVDB.h"
|
||||
|
||||
@interface MetadataImporter ()
|
||||
@interface SBMetadataImporter ()
|
||||
|
||||
@property (atomic, readwrite) BOOL isCancelled;
|
||||
|
||||
@end
|
||||
|
||||
@implementation MetadataImporter
|
||||
@implementation SBMetadataImporter
|
||||
|
||||
@synthesize isCancelled = _isCancelled;
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
}
|
||||
|
||||
+ (NSArray<NSString *> *)languagesForProvider:(NSString *)aProvider {
|
||||
MetadataImporter *m = [MetadataImporter importerForProvider:aProvider];
|
||||
SBMetadataImporter *m = [SBMetadataImporter importerForProvider:aProvider];
|
||||
NSArray *a = [m languages];
|
||||
return a;
|
||||
}
|
||||
@@ -54,11 +54,11 @@
|
||||
}
|
||||
|
||||
+ (instancetype)defaultMovieProvider {
|
||||
return [MetadataImporter importerForProvider:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|Movie"]];
|
||||
return [SBMetadataImporter importerForProvider:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|Movie"]];
|
||||
}
|
||||
|
||||
+ (instancetype)defaultTVProvider {
|
||||
return [MetadataImporter importerForProvider:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV"]];
|
||||
return [SBMetadataImporter importerForProvider:[[NSUserDefaults standardUserDefaults] valueForKey:@"SBMetadataPreference|TV"]];
|
||||
}
|
||||
|
||||
+ (NSString *)defaultMovieLanguage {
|
||||
@@ -8,8 +8,8 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#import "MetadataImporter.h"
|
||||
#import "SBMetadataImporter.h"
|
||||
|
||||
@interface TheMovieDB3 : MetadataImporter
|
||||
@interface TheMovieDB3 : SBMetadataImporter
|
||||
|
||||
@end
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
#import "SBMetadataSearchController.h"
|
||||
|
||||
#import "TheMovieDB3.h"
|
||||
#import "iTunesStore.h"
|
||||
#import "SBTheMovieDB3.h"
|
||||
#import "SBiTunesStore.h"
|
||||
|
||||
#define API_KEY @"b0073bafb08b4f68df101eb2325f27dc"
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
// load image variables from configuration
|
||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://api.themoviedb.org/3/configuration?api_key=%@", API_KEY]];
|
||||
NSData *jsonData = [SBMetadataHelper downloadDataFromURL:url withCachePolicy:SBDefaultPolicy];
|
||||
NSArray *posters = r[@"images.posters"];
|
||||
NSArray *posters = r[@"images"][@"posters"];
|
||||
|
||||
if (jsonData && posters && [posters isKindOfClass:[NSArray class]]) {
|
||||
NSDictionary *config = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
|
||||
@@ -169,7 +169,7 @@
|
||||
metadata[@"Long Description"] = r[@"overview"];
|
||||
metadata[@"Studio"] = [TheMovieDB3 commaJoinedSubentriesOf:r[@"production_companies"] forKey:@"name"];
|
||||
|
||||
NSDictionary *casts = r[@"casts"];
|
||||
NSDictionary<NSString *, NSArray *> *casts = r[@"casts"];
|
||||
metadata[@"Cast"] = [TheMovieDB3 commaJoinedSubentriesOf:casts[@"cast"] forKey:@"name"];
|
||||
metadata[@"Director"] = [TheMovieDB3 commaJoinedSubentriesOf:casts[@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Director"];
|
||||
metadata[@"Artist"] = [TheMovieDB3 commaJoinedSubentriesOf:casts[@"crew"] forKey:@"name" withKey:@"job" equalTo:@"Director"];
|
||||
@@ -6,8 +6,8 @@
|
||||
//
|
||||
//
|
||||
|
||||
#import "MetadataImporter.h"
|
||||
#import "SBMetadataImporter.h"
|
||||
|
||||
@interface TheTVDB : MetadataImporter
|
||||
@interface TheTVDB : SBMetadataImporter
|
||||
|
||||
@end
|
||||
@@ -10,9 +10,9 @@
|
||||
#import <MP42Foundation/MP42Ratings.h>
|
||||
#import <MP42Foundation/MP42Languages.h>
|
||||
|
||||
#import "TheTVDB.h"
|
||||
#import "SBTheTVDB.h"
|
||||
|
||||
#import "iTunesStore.h"
|
||||
#import "SBiTunesStore.h"
|
||||
#import "XMLReader.h"
|
||||
|
||||
#define API_KEY @"3498815BE9484A62"
|
||||
@@ -8,11 +8,11 @@
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "MetadataImporter.h"
|
||||
#import "SBMetadataImporter.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface iTunesStore : MetadataImporter
|
||||
@interface iTunesStore : SBMetadataImporter
|
||||
|
||||
#pragma mark iTunes stores
|
||||
+ (nullable NSDictionary *) getStoreFor:(NSString *)aLanguageString;
|
||||
@@ -9,7 +9,7 @@
|
||||
#import <MP42Foundation/MP42Metadata.h>
|
||||
#import <MP42Foundation/MP42Ratings.h>
|
||||
|
||||
#import "iTunesStore.h"
|
||||
#import "SBiTunesStore.h"
|
||||
#import "SBMetadataSearchController.h"
|
||||
|
||||
@implementation iTunesStore
|
||||
Reference in new issue
Block a user