Show
Ignore:
Timestamp:
02/24/2010 06:40:01 PM (2 years ago)
Author:
gbooker
Message:

Corrected some issues with video_ts importing

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/PlayerFramework/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m

    r1165 r1170  
    324324{ 
    325325        /*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]; 
    327346        int modTime = [[props objectForKey:NSFileModificationDate] timeIntervalSince1970]; 
    328347         
     
    511530                { 
    512531                        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 ]; 
    519547                         
    520548                        [dvd release];