Changeset 643

Show
Ignore:
Timestamp:
07/27/08 17:12:30 (4 months ago)
Author:
gbooker
Message:

Merge [642]

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.m

    r624 r643  
    743743                } 
    744744        } 
     745        NSFileManager *fileAgent=[NSFileManager defaultManager]; 
     746        NSString * coverart=[[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:@"@MOVIES"]; 
     747        [fileAgent constructPath:coverart]; 
     748        int imdbNumber = [SapphireMovie imdbNumberFromString:[tran IMDBLink]]; 
     749        coverart=[coverart stringByAppendingPathComponent:[NSString stringWithFormat:@"%d", imdbNumber]]; 
    745750        if(selectedPoster && [tran IMPLink]) 
    746751        { 
    747752                /* Lets move the selected poster to the corresponding Cover Art Directory */ 
    748                 NSFileManager *fileAgent=[NSFileManager defaultManager]; 
    749753                NSString *poster = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/Sapphire/Poster_Buffer"]; 
    750754                poster = [poster stringByAppendingPathComponent:[[selectedPoster link] lastPathComponent]]; 
    751                 NSString * coverart=[[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:@"@MOVIES"]; 
    752                 [fileAgent constructPath:coverart]; 
    753                 int imdbNumber = [SapphireMovie imdbNumberFromString:[tran IMDBLink]]; 
    754                 coverart=[coverart stringByAppendingPathComponent:[NSString stringWithFormat:@"%d", imdbNumber]]; 
    755755                coverart=[coverart stringByAppendingPathExtension:[poster pathExtension]]; 
    756756                if([fileAgent fileExistsAtPath:poster])/* See if we need to clean up */ 
     
    787787        { 
    788788                /* The poster chooser wasn't loaded - ATV 1.0 */ 
    789                 NSFileManager *fileAgent=[NSFileManager defaultManager]; 
    790                 NSString * coverart=[[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:@"@MOVIES"]; 
    791                 [fileAgent constructPath:coverart]; 
    792789                NSSet *posterList = [NSSet setWithObject:autoSelectPoster]; 
    793                 coverart = [coverart stringByAppendingPathComponent:[fileName stringByDeletingPathExtension]]; 
    794790                coverart = [coverart stringByAppendingPathExtension:[[autoSelectPoster link] pathExtension]]; 
    795791                SapphireMovieDataMenuDownloadDelegate *myDelegate = [[SapphireMovieDataMenuDownloadDelegate alloc] initWithRequest:posterList withDestination:coverart delegate:self]; 
     
    797793                [myDelegate autorelease];        
    798794        } 
     795         
     796        /* If we have JPEG art and content is a ripped DVD we provide Preview.jpg coverart in the film folder, 
     797         * To allow for updates the preview.jpg is not a copy, but instead a symbolic link to the cover 
     798         * art in the Collection Art/@MOVIES folder */ 
     799        if( ([[coverart pathExtension] caseInsensitiveCompare:@"jpg" ] == NSOrderedSame || 
     800             [[coverart pathExtension] caseInsensitiveCompare:@"jpeg"] == NSOrderedSame  ) && 
     801           [metaData fileContainerTypeValue] == FILE_CONTAINER_TYPE_VIDEO_TS ) 
     802        { 
     803                /* This is non-critical code, just adding fluff, ignore returned value */ 
     804                [fileAgent createSymbolicLinkAtPath:[[metaData path] stringByAppendingPathComponent:@"Preview.jpg"] pathContent:coverart]; 
     805        } 
     806         
    799807         
    800808        /*Import the info*/