Changeset 643
- Timestamp:
- 07/27/08 17:12:30 (4 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/CoreData/SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.m
r624 r643 743 743 } 744 744 } 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]]; 745 750 if(selectedPoster && [tran IMPLink]) 746 751 { 747 752 /* Lets move the selected poster to the corresponding Cover Art Directory */ 748 NSFileManager *fileAgent=[NSFileManager defaultManager];749 753 NSString *poster = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/Sapphire/Poster_Buffer"]; 750 754 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]];755 755 coverart=[coverart stringByAppendingPathExtension:[poster pathExtension]]; 756 756 if([fileAgent fileExistsAtPath:poster])/* See if we need to clean up */ … … 787 787 { 788 788 /* 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];792 789 NSSet *posterList = [NSSet setWithObject:autoSelectPoster]; 793 coverart = [coverart stringByAppendingPathComponent:[fileName stringByDeletingPathExtension]];794 790 coverart = [coverart stringByAppendingPathExtension:[[autoSelectPoster link] pathExtension]]; 795 791 SapphireMovieDataMenuDownloadDelegate *myDelegate = [[SapphireMovieDataMenuDownloadDelegate alloc] initWithRequest:posterList withDestination:coverart delegate:self]; … … 797 793 [myDelegate autorelease]; 798 794 } 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 799 807 800 808 /*Import the info*/
