Merged galad87/subler into master
This commit is contained in:
commit
036e9fddea
2 files changed
+5
-5
No files matched your search
@@ -146,20 +146,20 @@ NSInteger sortSBMetadataResult(id ep1, id ep2, void *context)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSData *jsonData = [SBMetadataHelper downloadDataFromURL:url withCachePolicy:SBDefaultPolicy];
|
NSData *jsonData = [SBMetadataHelper downloadDataFromURL:url withCachePolicy:SBDefaultPolicy];
|
||||||
NSInteger id;
|
NSInteger iTunesID = 0;
|
||||||
|
|
||||||
if (jsonData) {
|
if (jsonData) {
|
||||||
NSDictionary *d = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
|
NSDictionary *d = [NSJSONSerialization JSONObjectWithData:jsonData options:0 error:nil];
|
||||||
|
|
||||||
if ([d isKindOfClass:[NSDictionary class]]) {
|
if ([d isKindOfClass:[NSDictionary class]]) {
|
||||||
id = [SBiTunesStore showOrSeasonIdFromResults:d forShow:aSeriesName andSeason:aSeasonNum andSeasonString:season];
|
iTunesID = [SBiTunesStore showOrSeasonIdFromResults:d forShow:aSeriesName andSeason:aSeasonNum andSeasonString:season];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have an ID, use the lookup API to get episodes for that show/season
|
// If we have an ID, use the lookup API to get episodes for that show/season
|
||||||
if (id != 0) {
|
if (iTunesID != 0) {
|
||||||
NSURL *lookupUrl;
|
NSURL *lookupUrl;
|
||||||
lookupUrl = [NSURL URLWithString:[NSString stringWithFormat:@"http://itunes.apple.com/lookup?id=%ld&entity=tvEpisode&limit=200", (long)id]];
|
lookupUrl = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/lookup?id=%ld&entity=tvEpisode&limit=200", (long)iTunesID]];
|
||||||
|
|
||||||
jsonData = [SBMetadataHelper downloadDataFromURL:lookupUrl withCachePolicy:SBDefaultPolicy];
|
jsonData = [SBMetadataHelper downloadDataFromURL:lookupUrl withCachePolicy:SBDefaultPolicy];
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule MP42Foundation updated: 2d67e1b718...45619d646a.
Reference in new issue
Block a user