Changeset 1170
- Timestamp:
- 02/24/2010 06:40:01 PM (2 years ago)
- Location:
- branches/PlayerFramework/SapphireFrappliance
- Files:
-
- 2 modified
-
MetaData/SapphireMObjects/SapphireFileMetaData.m (modified) (2 diffs)
-
MetaDataImporting/SapphireVideoTSParser.m (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/PlayerFramework/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m
r1165 r1170 324 324 { 325 325 /*Check modified date*/ 326 NSDictionary *props = [[NSFileManager defaultManager] fileAttributesAtPath:self.path traverseLink:YES]; 326 NSString *path = nil; 327 NSFileManager *fm = [NSFileManager defaultManager]; 328 if([self fileContainerTypeValue] == FILE_CONTAINER_TYPE_VIDEO_TS) 329 { 330 NSString *vtsPath = [self.path stringByAppendingPathComponent:@"VIDEO_TS"]; 331 NSEnumerator *fileEnum = [[fm directoryContentsAtPath:vtsPath] objectEnumerator]; 332 NSString *file; 333 while((file = [fileEnum nextObject]) != nil) 334 { 335 NSString *lowerFile = [file lowercaseString]; 336 if([lowerFile hasSuffix:@".ifo"] && ![[lowerFile lastPathComponent] isEqualToString:@"video_ts.ifo"]) 337 { 338 path = [vtsPath stringByAppendingPathComponent:file]; 339 break; 340 } 341 } 342 } 343 else 344 path = self.path; 345 NSDictionary *props = [fm fileAttributesAtPath:path traverseLink:YES]; 327 346 int modTime = [[props objectForKey:NSFileModificationDate] timeIntervalSince1970]; 328 347 … … 511 530 { 512 531 SapphireVideoTsParser *dvd = [[SapphireVideoTsParser alloc] initWithPath:path]; 513 514 [fileMeta setObject:[dvd videoFormatsString ] forKey:META_FILE_VIDEO_DESC_KEY]; 515 [fileMeta setObject:[dvd audioFormatsString ] forKey:META_FILE_AUDIO_DESC_KEY]; 516 [fileMeta setObject:[dvd subtitlesString ] forKey:META_FILE_SUBTITLES_KEY ]; 517 [fileMeta setObject:[dvd mainFeatureDuration] forKey:META_FILE_DURATION_KEY ]; 518 [fileMeta setObject:[dvd totalSize ] forKey:META_FILE_SIZE_KEY ]; 532 id description = [dvd videoFormatsString]; 533 if(description) 534 [fileMeta setObject:description forKey:META_FILE_VIDEO_DESC_KEY]; 535 description = [dvd audioFormatsString]; 536 if(description) 537 [fileMeta setObject:description forKey:META_FILE_AUDIO_DESC_KEY]; 538 description = [dvd mainFeatureDuration]; 539 if(description) 540 [fileMeta setObject:description forKey:META_FILE_DURATION_KEY]; 541 description = [dvd totalSize]; 542 if(description) 543 [fileMeta setObject:description forKey:META_FILE_SIZE_KEY]; 544 description = [dvd subtitlesString]; 545 if(description) 546 [fileMeta setObject:description forKey:META_FILE_SUBTITLES_KEY ]; 519 547 520 548 [dvd release]; -
branches/PlayerFramework/SapphireFrappliance/MetaDataImporting/SapphireVideoTSParser.m
r913 r1170 24 24 // Instead of declaring them in the header, we declare them here in a category that extends the class. 25 25 26 @interface SapphireVideoTsParser ( InternalMethods)26 @interface SapphireVideoTsParser () 27 27 28 28 /*! … … 76 76 #define vts_VideoIsWidescreen(attrs) ( attrs[0] & 0x0c) 77 77 78 #define vts_AudioIsDTS(attrs) ((attrs[0] & 0xe0) == 0x 0c)78 #define vts_AudioIsDTS(attrs) ((attrs[0] & 0xe0) == 0xc0) 79 79 #define vts_AudioIsSurround(attrs) ( attrs[0] & 0x02) 80 80 #define vts_AudioIsCommentary(attrs) ( attrs[5] > 1) … … 100 100 static NSString *languageFromEncodedChars( const char firstChar, const char secondChar ) 101 101 { 102 static NSLocale *currentLocale = nil;102 NSLocale *currentLocale = [NSLocale currentLocale]; 103 103 const char langCode[] = { firstChar, secondChar, 0 }; 104 104 105 if( currentLocale == nil )106 currentLocale = [NSLocale currentLocale];107 108 105 return [currentLocale displayNameForKey:NSLocaleLanguageCode 109 106 value:[NSString stringWithCString:langCode encoding:NSASCIIStringEncoding]]; … … 319 316 audio = commaSeparatedStringFromCollection( audioList ); 320 317 } 321 322 if( audio == nil )323 audio = BRLocalizedString( @"Not specified", @"No Audio information available for a DVD" );;324 318 } 325 319 … … 355 349 subtitles = commaSeparatedStringFromCollection( subtitleList ); 356 350 } 357 358 if( subtitles == nil )359 subtitles = BRLocalizedString( @"None", @"No Subtitle information available for a DVD" );360 351 } 361 352
