Changeset 1173

Show
Ignore:
Timestamp:
02/25/2010 07:43:24 AM (2 years ago)
Author:
gbooker
Message:

Record correct modification date for video_ts

Files:
1 modified

Legend:

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

    r1170 r1173  
    428428                updated=TRUE ; 
    429429                NSMutableDictionary *fileMeta = [NSMutableDictionary dictionary]; 
    430                 NSString *path = [file path]; 
     430                NSString *path; 
     431                NSFileManager *fm = [NSFileManager defaultManager]; 
    431432                 
    432                 NSDictionary *props = [[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:YES]; 
     433                if([file fileContainerTypeValue] == FILE_CONTAINER_TYPE_VIDEO_TS) 
     434                { 
     435                        NSString *vtsPath = [[file path] stringByAppendingPathComponent:@"VIDEO_TS"]; 
     436                        NSEnumerator *fileEnum = [[fm directoryContentsAtPath:vtsPath] objectEnumerator]; 
     437                        NSString *file; 
     438                        while((file = [fileEnum nextObject]) != nil) 
     439                        { 
     440                                NSString *lowerFile = [file lowercaseString]; 
     441                                if([lowerFile hasSuffix:@".ifo"] && ![[lowerFile lastPathComponent] isEqualToString:@"video_ts.ifo"]) 
     442                                { 
     443                                        path = [vtsPath stringByAppendingPathComponent:file]; 
     444                                        break; 
     445                                } 
     446                        } 
     447                } 
     448                else 
     449                        path = [file path]; 
     450                NSDictionary *props = [fm fileAttributesAtPath:path traverseLink:YES]; 
    433451                int modTime = [[props objectForKey:NSFileModificationDate] timeIntervalSince1970]; 
    434452                /*Set modified, size, and version*/