Ticket #196: video_ts_preview_jpg.diff
| File video_ts_preview_jpg.diff, 2.9 kB (added by wazza, 5 months ago) |
|---|
-
SapphireFrappliance/SapphireMovieImporter.m
old new 773 773 [dataMenu resume]; 774 774 } 775 775 } 776 777 NSFileManager *fileAgent=[NSFileManager defaultManager]; 778 NSString * coverart=[[SapphireMetaData collectionArtPath]stringByAppendingPathComponent:@"@MOVIES"]; 779 [fileAgent constructPath:coverart]; 780 coverart=[coverart stringByAppendingPathComponent:[fileName stringByDeletingPathExtension]]; 781 776 782 if(selectedPoster && [dict objectForKey:IMP_POSTERS_KEY]) 777 783 { 778 784 /* Lets move the selected poster to the corresponding Cover Art Directory */ 779 NSFileManager *fileAgent=[NSFileManager defaultManager];780 785 NSString * poster=[NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/Sapphire/Poster_Buffer"]; 781 786 poster=[poster stringByAppendingPathComponent:[selectedPoster lastPathComponent]]; 782 NSString * coverart=[[SapphireMetaData collectionArtPath]stringByAppendingPathComponent:@"@MOVIES"];783 [fileAgent constructPath:coverart];784 coverart=[coverart stringByAppendingPathComponent:[fileName stringByDeletingPathExtension]];785 787 coverart=[coverart stringByAppendingPathExtension:[poster pathExtension]]; 786 788 if([fileAgent fileExistsAtPath:poster])/* See if we need to clean up */ 787 789 { … … 816 818 else if(autoSelectPoster) 817 819 { 818 820 /* The poster chooser wasn't loaded - ATV 1.0 */ 819 NSFileManager *fileAgent=[NSFileManager defaultManager];820 NSString * coverart=[[SapphireMetaData collectionArtPath]stringByAppendingPathComponent:@"@MOVIES"];821 [fileAgent constructPath:coverart];822 821 NSArray * posterList=[NSArray arrayWithObject:autoSelectPoster]; 823 coverart=[coverart stringByAppendingPathComponent:[fileName stringByDeletingPathExtension]];824 822 coverart=[coverart stringByAppendingPathExtension:[autoSelectPoster pathExtension]]; 825 823 SapphireMovieDataMenuDownloadDelegate *myDelegate = [[SapphireMovieDataMenuDownloadDelegate alloc] initWithRequest:posterList withDestination:coverart delegate:self]; 826 824 [myDelegate downloadSingleMoviePoster] ; 827 825 [myDelegate autorelease]; 828 826 } 829 827 828 /* If we have JPEG art and content is a ripped DVD we provide Preview.jpg coverart in the film folder, 829 * To allow for updates the preview.jpg is not a copy, but instead a symbolic link to the cover 830 * art in the Collection Art/@MOVIES folder */ 831 if( ([[coverart pathExtension] caseInsensitiveCompare:@"jpg" ] == NSOrderedSame || 832 [[coverart pathExtension] caseInsensitiveCompare:@"jpeg"] == NSOrderedSame ) && 833 [metaData fileContainerType] == FILE_CONTAINER_TYPE_VIDEO_TS ) 834 { 835 /* This is non-critical code, just adding fluff, ignore returned value */ 836 [fileAgent createSymbolicLinkAtPath:[[metaData path] stringByAppendingPathComponent:@"Preview.jpg"] pathContent:coverart]; 837 } 838 830 839 /*Import the info*/ 831 840 /*IMDB Data */ 832 841 NSMutableDictionary *infoIMDB = nil;
