International iTunes Store might contains both localised and not "season" in the episode name.
This commit is contained in:
1 parent
2c555069cf
commit
ba9304122b
1 file changed
+6
-1
@@ -229,7 +229,8 @@ NSInteger sortSBMetadataResult(id ep1, id ep2, void *context)
|
|||||||
// 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 (iTunesID != 0) {
|
if (iTunesID != 0) {
|
||||||
NSURL *lookupUrl;
|
NSURL *lookupUrl;
|
||||||
lookupUrl = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/lookup?country=%@&id=%ld&entity=tvEpisode&limit=200", country, (long)iTunesID]];
|
lookupUrl = [NSURL URLWithString:[NSString stringWithFormat:@"https://itunes.apple.com/lookup?country=%@&id=%ld&entity=tvEpisode&limit=200",
|
||||||
|
country, (long)iTunesID]];
|
||||||
|
|
||||||
NSData *jsonData = [SBMetadataHelper downloadDataFromURL:lookupUrl withCachePolicy:SBDefaultPolicy];
|
NSData *jsonData = [SBMetadataHelper downloadDataFromURL:lookupUrl withCachePolicy:SBDefaultPolicy];
|
||||||
|
|
||||||
@@ -478,6 +479,10 @@ NSInteger sortSBMetadataResult(id ep1, id ep2, void *context)
|
|||||||
|
|
||||||
if ([store[@"season"] length]) {
|
if ([store[@"season"] length]) {
|
||||||
NSArray *sa = [s.lowercaseString componentsSeparatedByString:[NSString stringWithFormat:@", %@ ", store[@"season"]]];
|
NSArray *sa = [s.lowercaseString componentsSeparatedByString:[NSString stringWithFormat:@", %@ ", store[@"season"]]];
|
||||||
|
|
||||||
|
if (sa.count <= 1) {
|
||||||
|
sa = [s.lowercaseString componentsSeparatedByString:[NSString stringWithFormat:@", %@ ", @"season"]];
|
||||||
|
}
|
||||||
if (sa.count <= 1) {
|
if (sa.count <= 1) {
|
||||||
sa = [s.lowercaseString componentsSeparatedByString:[NSString stringWithFormat:@", %@ ", @"book"]];
|
sa = [s.lowercaseString componentsSeparatedByString:[NSString stringWithFormat:@", %@ ", @"book"]];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user