Changeset 397

Show
Ignore:
Timestamp:
12/13/07 11:56:03 (1 year ago)
Author:
gbooker
Message:

Be more resilient against idiotic data in tvrage, such as a ?? episode number like Miniseries: http://www.tvrage.com/Battlestar_Galactica/episode_guide/1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireTVShowImporter.m

    r391 r397  
    264264                                        /*Get the season number and ep numbers*/ 
    265265                                        NSScanner *scanner = [NSScanner scannerWithString:epInfoStr]; 
    266                                         if([epInfoStr rangeOfString:@" - " options:0].location != NSNotFound) 
     266                                        NSRange range = [epInfoStr rangeOfString:@" - " options:0]; 
     267                                        if(range.location != NSNotFound) 
    267268                                        { 
    268269                                                [scanner scanInt:&epNumber]; 
     
    271272                                                [scanner scanUpToCharactersFromSet:decimalSet intoString:nil]; 
    272273                                                [scanner scanInt:&ep]; 
    273                                                 [scanner scanCharactersFromSet:skipSet intoString:nil];                                                  
     274                                                [scanner setScanLocation:range.length + range.location]; 
     275                                                if(seasonNum == 0) 
     276                                                        seasonNum = season; 
    274277                                        } 
    275278                                        else