Changeset 535

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

Calculation of totalsize from wazza
Fixes #171

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/SapphireFrappliance/SapphireMetaData.m

    r529 r535  
    17131713                        [fileMeta setObject:[dvd subtitlesString    ] forKey:SUBTITLES_KEY ]; 
    17141714                        [fileMeta setObject:[dvd mainFeatureDuration] forKey:DURATION_KEY  ]; 
     1715                        [fileMeta setObject:[dvd totalSize          ] forKey:SIZE_KEY      ]; 
    17151716 
    17161717                        [dvd release]; 
  • trunk/SapphireFrappliance/SapphireVideoTSParser.h

    r529 r535  
    2626        const NSString *subtitles; 
    2727        long long       duration; 
     28        const NSNumber *size; 
    2829} 
    2930 
     
    8182 */ 
    8283- (const NSNumber * const) mainFeatureDuration; 
     84 
     85/*! 
     86 * @brief Return the size of a ripped DVD 
     87 * 
     88 * @return  Calculated DVD size 
     89 */ 
     90- (const NSNumber * const) totalSize; 
     91 
    8392@end 
  • 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