Check the class type in the initialize method
This commit is contained in:
1 parent
4c63819987
commit
40a57a3fe6
1 file changed
+2
@@ -22,6 +22,7 @@ static NSArray *TVDBlanguages;
|
|||||||
@implementation TheTVDB
|
@implementation TheTVDB
|
||||||
|
|
||||||
+ (void)initialize {
|
+ (void)initialize {
|
||||||
|
if (self == [TheTVDB class]) {
|
||||||
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/api/%@/languages.xml", API_KEY]];
|
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"http://thetvdb.com/api/%@/languages.xml", API_KEY]];
|
||||||
NSData *languagesXML = [MetadataImporter downloadDataFromURL:url withCachePolicy:SBReturnCacheElseLoad];
|
NSData *languagesXML = [MetadataImporter downloadDataFromURL:url withCachePolicy:SBReturnCacheElseLoad];
|
||||||
NSDictionary *languages = [XMLReader dictionaryForXMLData:languagesXML error:NULL];
|
NSDictionary *languages = [XMLReader dictionaryForXMLData:languagesXML error:NULL];
|
||||||
@@ -43,6 +44,7 @@ static NSArray *TVDBlanguages;
|
|||||||
TVDBlanguages = [[NSArray arrayWithArray:languagesResult] retain];
|
TVDBlanguages = [[NSArray arrayWithArray:languagesResult] retain];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (NSArray *) languages {
|
- (NSArray *) languages {
|
||||||
return TVDBlanguages;
|
return TVDBlanguages;
|
||||||
|
|||||||
Reference in new issue
Block a user