Changeset 547

Show
Ignore:
Timestamp:
05/26/08 15:35:25 (7 months ago)
Author:
gbooker
Message:

Move the cover art files to where they should be

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/CoreData/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m

    r545 r547  
    156156                self.tvEpisode = ep; 
    157157                if(ep != nil) 
     158                { 
    158159                        self.fileClassValue = FILE_CLASS_TV_SHOW; 
     160                        NSString *epCoverPath = [ep coverArtPath]; 
     161                        NSString *oldBasePath = [[epCoverPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[self.path lastPathComponent]]; 
     162                        NSString *oldCoverPath = searchCoverArtExtForPath([oldBasePath stringByDeletingPathExtension]); 
     163                        NSFileManager *fm = [NSFileManager defaultManager]; 
     164                        if(oldCoverPath != nil) 
     165                        { 
     166                                NSString *newPath = [epCoverPath stringByAppendingPathExtension:[oldCoverPath pathExtension]]; 
     167                                [fm movePath:oldCoverPath toPath:newPath handler:nil]; 
     168                        } 
     169                } 
    159170                importType |= IMPORT_TYPE_TVSHOW_MASK; 
    160171        }