Changeset 1299 for trunk

Show
Ignore:
Timestamp:
07/05/10 17:33:37 (23 months ago)
Author:
gbooker
Message:

When upgrading, ignore parent.path and instead recompute it since previous database may be incorrect.

Location:
trunk/SapphireFrappliance/MetaData/SapphireMObjects
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireDirectoryMetaData.m

    r1251 r1299  
    7373        { 
    7474                NSString *path = [oldDir valueForKey:@"path"]; 
    75                 NSString *parentPath = [oldDir valueForKeyPath:@"parent.path"]; 
    76                 if(parentPath != nil) 
     75                NSString *parentPath = [path stringByDeletingLastPathComponent]; 
     76                if(parentPath != nil && ![parentPath isEqualToString:@"/"]) 
    7777                        ((SapphireDirectoryMetaData *)[lookup objectForKey:path]).parent = [lookup objectForKey:parentPath]; 
    7878        } 
  • trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m

    r1295 r1299  
    166166                NSString *path = [oldFile valueForKey:@"path"]; 
    167167                newFile.path = path; 
    168                 newFile.parent = [dirLookup objectForKey:[oldFile valueForKeyPath:@"parent.path"]]; 
     168                newFile.parent = [dirLookup objectForKey:[path stringByDeletingLastPathComponent]]; 
    169169                newFile.audioDescription = [oldFile valueForKey:@"audioDescription"]; 
    170170                newFile.audioFormatID = [oldFile valueForKey:@"audioFormatID"];