@@ -523,7 +523,7 @@ - (void)checkExceptions{
523
523
NSManagedObjectContext *moc = self.managedObjectContext ;
524
524
bool found = false ;
525
525
NSPredicate *predicate;
526
- for (int i = 0 ; i < 2 ; i++) {
526
+ for (int i = 0 ; i < 3 ; i++) {
527
527
528
528
NSFetchRequest *allExceptions = [[NSFetchRequest alloc ] init ];
529
529
__block NSError *error = nil ;
@@ -537,14 +537,19 @@ - (void)checkExceptions{
537
537
predicate = [NSPredicate predicateWithFormat: @" (detectedTitle ==[c] %@) AND ((detectedSeason == %i) OR (detectedSeason == %i))" , _DetectedTitle, 0 , 1 ];
538
538
}
539
539
}
540
- else if (i== 1 && [[NSUserDefaults standardUserDefaults ] boolForKey: @" UseAutoExceptions" ]) {
540
+ else if (i < 3 && [[NSUserDefaults standardUserDefaults ] boolForKey: @" UseAutoExceptions" ]) {
541
541
NSLog (@" Checking Auto Exceptions" );
542
- allExceptions.entity = [NSEntityDescription entityForName: @" AutoExceptions " inManagedObjectContext: moc];
542
+ allExceptions.entity = [NSEntityDescription entityForName: @" AutoCorrection " inManagedObjectContext: moc];
543
543
if (_DetectedSeason == 1 || _DetectedSeason == 0 ) {
544
544
predicate = [NSPredicate predicateWithFormat: @" (detectedTitle ==[c] %@) AND ((group == %@) OR (group == %@))" , _DetectedTitle, _DetectedGroup, @" ALL " ];
545
545
}
546
546
else {
547
- predicate = [NSPredicate predicateWithFormat: @" ((detectedTitle ==[c] %@) OR (detectedTitle ==[c] %@) OR (detectedTitle ==[c] %@)) AND ((group == %@) OR (group == %@))" , [NSString stringWithFormat: @" %@ %i " , _DetectedTitle, _DetectedSeason], [NSString stringWithFormat: @" %@ S%i " , _DetectedTitle, _DetectedSeason], [NSString stringWithFormat: @" %@ %@ Season" , _DetectedTitle, [Utility numbertoordinal: _DetectedSeason]], _DetectedGroup, @" ALL " ];
547
+ if (i == 1 ) {
548
+ predicate = [NSPredicate predicateWithFormat: @" ((detectedTitle ==[c] %@) OR (detectedTitle ==[c] %@) OR (detectedTitle ==[c] %@)) AND ((group == %@) OR (group == %@))" , [NSString stringWithFormat: @" %@ %i " , _DetectedTitle, _DetectedSeason], [NSString stringWithFormat: @" %@ S%i " , _DetectedTitle, _DetectedSeason], [NSString stringWithFormat: @" %@ %@ Season" , _DetectedTitle, [Utility numbertoordinal: _DetectedSeason]], _DetectedGroup, @" ALL " ];
549
+ }
550
+ else {
551
+ predicate = [NSPredicate predicateWithFormat: @" (detectedTitle ==[c] %@) AND ((group == %@) OR (group == %@))" , _DetectedTitle, _DetectedGroup, @" ALL " ];
552
+ }
548
553
}
549
554
}
550
555
else {break ;}
@@ -598,8 +603,10 @@ - (void)checkExceptions{
598
603
if (tmpepisode > 0 ) {
599
604
_DetectedEpisode = [NSString stringWithFormat: @" %i " , tmpepisode];
600
605
}
606
+ if (_DetectedSeason > 0 && i != 2 ) {
607
+ _DetectedSeason = 0 ;
608
+ }
601
609
_DetectedType = @" " ;
602
- _DetectedSeason = 0 ;
603
610
_DetectedTitleisEpisodeZero = false ;
604
611
found = true ;
605
612
break ;
0 commit comments