Ticket #171: dvd_size.diff
| File dvd_size.diff, 2.4 KB (added by wazza, 4 years ago) |
|---|
-
SapphireMetaData.m
1712 1712 [fileMeta setObject:[dvd audioFormatsString ] forKey:AUDIO_DESC_KEY]; 1713 1713 [fileMeta setObject:[dvd subtitlesString ] forKey:SUBTITLES_KEY ]; 1714 1714 [fileMeta setObject:[dvd mainFeatureDuration] forKey:DURATION_KEY ]; 1715 [fileMeta setObject:[dvd totalSize ] forKey:SIZE_KEY ]; 1715 1716 1716 1717 [dvd release]; 1717 1718 } // VIDEO_TS -
SapphireVideoTSParser.h
25 25 const NSString *audio; 26 26 const NSString *subtitles; 27 27 long long duration; 28 const NSNumber *size; 28 29 } 29 30 30 31 /*! … … 80 81 * @return Calculated DVD running time 81 82 */ 82 83 - (const NSNumber * const) mainFeatureDuration; 84 85 /*! 86 * @brief Return the size of a ripped DVD 87 * 88 * @return Calculated DVD running time 89 */ 90 - (const NSNumber * const) totalSize; 91 83 92 @end -
SapphireVideoTSParser.m
182 182 NSString *ifoPath = nil; 183 183 184 184 unsigned long long ifoSz = 0; 185 unsigned long long total = 0; 185 186 186 187 // The largest IFO file (not including VIDEO_TS.IFO) corresponds to the main feature 187 188 while( filePath = [enumerator nextObject] ) 188 189 { 190 unsigned long long sz = [[[fm fileAttributesAtPath:[videotsPath stringByAppendingPathComponent:filePath] traverseLink:YES] valueForKey:NSFileSize] unsignedLongLongValue]; 191 total += sz; 192 189 193 if( [[filePath lowercaseString] hasSuffix:@".ifo"] && [[filePath lastPathComponent] caseInsensitiveCompare:@"video_ts.ifo"] != NSOrderedSame ) 190 194 { 191 unsigned long long sz = [[[fm fileAttributesAtPath:[videotsPath stringByAppendingPathComponent:filePath] traverseLink:YES] valueForKey:NSFileSize] unsignedLongLongValue];192 193 195 if ( sz > ifoSz ) 194 196 { 195 197 ifoPath = [videotsPath stringByAppendingPathComponent:filePath]; … … 198 200 } 199 201 } 200 202 203 size = [NSNumber numberWithLongLong:total]; 204 201 205 if( ifoPath != nil ) 202 206 ifo = [NSFileHandle fileHandleForReadingAtPath:ifoPath]; 203 207 … … 403 407 return [NSNumber numberWithLongLong:duration]; 404 408 } 405 409 410 - (const NSNumber * const) totalSize 411 { 412 return size; 413 } 414 406 415 @end
