Show
Ignore:
Timestamp:
05/15/08 15:19:36 (4 years ago)
Author:
gbooker
Message:

Calculation of totalsize from wazza
Fixes #171

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/SapphireFrappliance/SapphireVideoTSParser.m

    r529 r535  
    183183 
    184184        unsigned long long ifoSz = 0; 
     185        unsigned long long total = 0; 
    185186 
    186187        // The largest IFO file (not including VIDEO_TS.IFO) corresponds to the main feature 
    187188        while( filePath = [enumerator nextObject] ) 
    188189        { 
     190                unsigned long long sz = [[[fm fileAttributesAtPath:[videotsPath stringByAppendingPathComponent:filePath] traverseLink:YES] valueForKey:NSFileSize] unsignedLongLongValue]; 
     191                total += sz; 
     192 
    189193                if( [[filePath lowercaseString] hasSuffix:@".ifo"] && [[filePath lastPathComponent] caseInsensitiveCompare:@"video_ts.ifo"] != NSOrderedSame ) 
    190194                { 
    191                         unsigned long long sz = [[[fm fileAttributesAtPath:[videotsPath stringByAppendingPathComponent:filePath] traverseLink:YES] valueForKey:NSFileSize] unsignedLongLongValue]; 
    192  
    193195                        if ( sz > ifoSz ) 
    194196                        { 
     
    198200                } 
    199201        } 
     202 
     203        size = [NSNumber numberWithLongLong:total]; 
    200204 
    201205        if( ifoPath != nil ) 
     
    404408} 
    405409 
     410- (const NSNumber * const) totalSize 
     411{ 
     412        return size; 
     413} 
     414 
    406415@end