- Timestamp:
- 02/25/10 17:31:35 (2 years ago)
- Location:
- trunk
- Files:
-
- 19 modified
- 57 copied
-
. (modified) (1 prop)
-
CommonMediaPlayer (copied) (copied from branches/PlayerFramework/CommonMediaPlayer)
-
CommonMediaPlayer/Classes (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes)
-
CommonMediaPlayer/Classes/AGProcess.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/AGProcess.h)
-
CommonMediaPlayer/Classes/AGProcess.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/AGProcess.m)
-
CommonMediaPlayer/Classes/CMPATVVersion.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPATVVersion.h)
-
CommonMediaPlayer/Classes/CMPATVVersion.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPATVVersion.m)
-
CommonMediaPlayer/Classes/CMPActionController.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPActionController.h)
-
CommonMediaPlayer/Classes/CMPBaseMediaAsset.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPBaseMediaAsset.h)
-
CommonMediaPlayer/Classes/CMPBaseMediaAsset.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPBaseMediaAsset.m)
-
CommonMediaPlayer/Classes/CMPDefines.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPDefines.h)
-
CommonMediaPlayer/Classes/CMPPlayer.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPPlayer.h)
-
CommonMediaPlayer/Classes/CMPPlayerController.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPPlayerController.h)
-
CommonMediaPlayer/Classes/CMPPlayerManager.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPPlayerManager.h)
-
CommonMediaPlayer/Classes/CMPPlayerManager.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPPlayerManager.m)
-
CommonMediaPlayer/Classes/CMPTypesDefines.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Classes/CMPTypesDefines.h)
-
CommonMediaPlayer/CommonMediaPlayer.xcodeproj (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/CommonMediaPlayer.xcodeproj)
-
CommonMediaPlayer/CommonMediaPlayer.xcodeproj/project.pbxproj (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/CommonMediaPlayer.xcodeproj/project.pbxproj)
-
CommonMediaPlayer/English.lproj (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/English.lproj)
-
CommonMediaPlayer/English.lproj/InfoPlist.strings (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/English.lproj/InfoPlist.strings)
-
CommonMediaPlayer/General Actions (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Actions)
-
CommonMediaPlayer/General Actions/CMPOverlayModeAction.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Actions/CMPOverlayModeAction.h)
-
CommonMediaPlayer/General Actions/CMPOverlayModeAction.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Actions/CMPOverlayModeAction.m)
-
CommonMediaPlayer/General Actions/CMPScreenReleaseAction.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Actions/CMPScreenReleaseAction.h)
-
CommonMediaPlayer/General Actions/CMPScreenReleaseAction.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Actions/CMPScreenReleaseAction.m)
-
CommonMediaPlayer/General Headers (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Headers)
-
CommonMediaPlayer/General Headers/BackRowUtils.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Headers/BackRowUtils.h)
-
CommonMediaPlayer/General Headers/CommonMediaPlayer_Prefix.pch (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Headers/CommonMediaPlayer_Prefix.pch)
-
CommonMediaPlayer/General Headers/CoreGraphicsServices.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/General Headers/CoreGraphicsServices.h)
-
CommonMediaPlayer/Info.plist (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Info.plist)
-
CommonMediaPlayer/Media Players (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players)
-
CommonMediaPlayer/Media Players/DVD Framework (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDFrameworkLoadAction.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDFrameworkLoadAction.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDFrameworkLoadAction.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDFrameworkLoadAction.m)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImageAction.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImageAction.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImageAction.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImageAction.m)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImporter.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImporter.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImporter.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDImporter.m)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayer.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayer.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayer.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayer.m)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayerController.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayerController.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayerController.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDPlayerController.m)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDWindowCreationAction.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDWindowCreationAction.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPDVDWindowCreationAction.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPDVDWindowCreationAction.m)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPISODVDPlayer.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPISODVDPlayer.h)
-
CommonMediaPlayer/Media Players/DVD Framework/CMPISODVDPlayer.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/DVD Framework/CMPISODVDPlayer.m)
-
CommonMediaPlayer/Media Players/Leopard DVD Framework (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/Leopard DVD Framework)
-
CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayer.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayer.h)
-
CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayer.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayer.m)
-
CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayerController.h (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayerController.h)
-
CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayerController.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/Media Players/Leopard DVD Framework/CMPLeopardDVDPlayerController.m)
-
CommonMediaPlayer/bin (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/bin)
-
CommonMediaPlayer/bin/dvdbackup (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/bin/dvdbackup)
-
CommonMediaPlayer/bin/kextstat (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/bin/kextstat)
-
CommonMediaPlayer/debug_main.m (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/debug_main.m)
-
CommonMediaPlayer/version.plist (copied) (copied from branches/PlayerFramework/CommonMediaPlayer/version.plist)
-
SapphireFrappliance/Browser/SapphireBrowser.m (modified) (2 diffs)
-
SapphireFrappliance/Browser/SapphireMarkMenu.m (modified) (3 diffs)
-
SapphireFrappliance/FRAppliance/SapphireAppliance.m (modified) (6 diffs)
-
SapphireFrappliance/FRAppliance/SapphireURLLoader.m (modified) (1 diff)
-
SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.h (modified) (1 diff)
-
SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m (modified) (14 diffs)
-
SapphireFrappliance/MetaData/SapphireMObjects/SapphireMovieTranslation.m (modified) (1 diff)
-
SapphireFrappliance/MetaData/Support/SapphireMetaDataSupport.m (modified) (2 diffs)
-
SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.m (modified) (25 diffs)
-
SapphireFrappliance/MetaDataImporting/SapphireNfoImporter.m (modified) (1 diff)
-
SapphireFrappliance/MetaDataImporting/SapphirePosterChooser.h (modified) (1 diff)
-
SapphireFrappliance/MetaDataImporting/SapphirePosterChooser.m (modified) (5 diffs)
-
SapphireFrappliance/MetaDataImporting/SapphireScraper.m (modified) (7 diffs)
-
SapphireFrappliance/MetaDataImporting/SapphireTVShowImporter.m (modified) (11 diffs)
-
SapphireFrappliance/MetaDataImporting/SapphireVideoTSParser.m (modified) (5 diffs)
-
SapphireFrappliance/MetaDataImporting/SapphireXMLFileDataImporter.m (modified) (1 diff)
-
SapphireFrappliance/Players/SapphireCMPWrapper.h (copied) (copied from branches/PlayerFramework/SapphireFrappliance/Players/SapphireCMPWrapper.h)
-
SapphireFrappliance/Players/SapphireCMPWrapper.m (copied) (copied from branches/PlayerFramework/SapphireFrappliance/Players/SapphireCMPWrapper.m)
-
SapphireFrappliance/Sapphire.xcodeproj/project.pbxproj (modified) (20 diffs)
-
SapphireFrappliance/main_debug.m (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property
svn:mergeinfo set
to
/branches/PlayerFramework merged eligible
-
Property
svn:mergeinfo set
to
-
trunk/SapphireFrappliance/Browser/SapphireBrowser.m
r1038 r1179 44 44 #import "SapphireErrorDisplayController.h" 45 45 #import "SapphireAudioNowPlayingController.h" 46 47 48 #import "SapphireCMPWrapper.h" 46 49 47 50 #import <objc/objc-class.h> … … 555 558 if([currentPlayFile fileContainerTypeValue] == FILE_CONTAINER_TYPE_VIDEO_TS && path != nil) 556 559 { 557 if([SapphireFrontRowCompat usingLeopard]) 558 { 559 BRDVDMediaAsset *asset = [[BRDVDMediaAsset alloc] initWithPath:path]; 560 SapphireDVDLoadingController *controller = [[SapphireDVDLoadingController alloc] initWithScene:[self scene] forAsset:asset]; 561 [asset release]; 562 [[self stack] pushController:controller]; 563 [controller release]; 564 } 565 else 566 { 567 SapphireErrorDisplayController *controller = [[SapphireErrorDisplayController alloc] initWithScene:[self scene] error:BRLocalizedString(@"Playback Error", @"Short error indicating an error while playing a file") longError:BRLocalizedString(@"DVD Playback is not supported on the AppleTV", @"Error message saying DVD on ATV not supported")]; 568 [[self stack] pushController:controller]; 569 [controller release]; 570 } 560 SapphireCMPWrapper *wrapper = [[SapphireCMPWrapper alloc] initWithFile:currentPlayFile scene:[self scene]]; 561 id controller = [wrapper controller]; 562 [wrapper release]; 563 // SapphireErrorDisplayController *controller = [[SapphireErrorDisplayController alloc] initWithScene:[self scene] error:BRLocalizedString(@"Playback Error", @"Short error indicating an error while playing a file") longError:BRLocalizedString(@"DVD Playback is not supported on the AppleTV", @"Error message saying DVD on ATV not supported")]; 564 [[self stack] pushController:controller]; 571 565 } 572 566 else if([[NSFileManager defaultManager] acceptFilePath:path] && [currentPlayFile hasVideoValue]) -
trunk/SapphireFrappliance/Browser/SapphireMarkMenu.m
r1092 r1179 289 289 290 290 NSString *prettyName = [fileMeta prettyName]; 291 if(prettyName != nil && [[ [[fileMeta path] lastPathComponent] stringByDeletingPathExtension] caseInsensitiveCompare:prettyName] != NSOrderedSame)291 if(prettyName != nil && [[fileMeta fileName] caseInsensitiveCompare:prettyName] != NSOrderedSame) 292 292 { 293 293 [marks insertObject: … … 469 469 NSString *savePath = [[joinList objectAtIndex:0] path]; 470 470 BOOL hasmovExt = [[savePath pathExtension] isEqualToString:@"mov"]; 471 NSString *base = [ savePath stringByDeletingPathExtension];471 NSString *base = [[joinList objectAtIndex:0] extensionlessPath]; 472 472 if([[base lowercaseString] hasSuffix:@" part 1"]) 473 473 base = [base substringToIndex:[base length] - 7]; … … 750 750 { 751 751 NSString *title = [NSString stringWithFormat:BRLocalizedString(@"Rename %@", @"Rename a file, directory, or collection, argument is path"), [fileMeta path]]; 752 NSString *oldName = [ [[fileMeta path] lastPathComponent] stringByDeletingPathExtension];752 NSString *oldName = [fileMeta fileName]; 753 753 754 754 NSInvocation *invoke = [NSInvocation invocationWithMethodSignature:[fileMeta methodSignatureForSelector:@selector(rename:)]]; -
trunk/SapphireFrappliance/FRAppliance/SapphireAppliance.m
r1038 r1179 29 29 30 30 #import <SapphireCompatClasses/BackRowUtils.h> 31 #ifdef DEBUG 32 //#define FrameworkLoadDebug 33 #define FrameworkAlwaysCopy 34 #endif 35 #import <CommonMediaPlayer/CMPPlayerManager.h> 31 36 32 37 #define TV_SHOW_IDENTIFIER @"tv-shows" … … 61 66 @end 62 67 68 static NSString *initialError = nil; 63 69 64 70 @implementation SapphireAppliance 71 72 BOOL usingCategories = NO; 65 73 66 74 + (void) initialize … … 69 77 NSString *frameworkPath = [myBundlePath stringByAppendingPathComponent:@"Contents/Frameworks"]; 70 78 SapphireLoadFramework(frameworkPath); 79 if(!loadCMPFramework(myBundlePath)) 80 initialError = BRLocalizedString(@"Error loading common player framework. Continuing is not recomended", @"Error string for loading common player framework"); 81 else if([CMPPlayerManager version] != CMPVersion) 82 initialError = BRLocalizedString(@"Common player framework is newer than expected. You may wish to check if a newer version of Sapphire is available. You may attempt to continue if you like.", @"Warning string for common player framework being newer than Sapphire"); 71 83 Class cls = NSClassFromString( @"BRFeatureManager" ); 72 84 if ( cls == Nil ) … … 156 168 - (id) applianceControllerWithScene: (id) scene 157 169 { 170 if(initialError && !usingCategories) 171 { 172 BRAlertController *controller = [SapphireFrontRowCompat alertOfType:0 titled:@"Error" primaryText:@"Framework Error" secondaryText:initialError withScene:nil]; 173 initialError = nil; 174 return controller; 175 } 158 176 // this function is called when your item is selected on the main menu 159 177 @try { … … 180 198 NSMutableArray *categories = [NSMutableArray array]; 181 199 200 usingCategories = YES; 182 201 if([SapphireApplianceController upgradeNeeded]) 183 202 { … … 229 248 -(id)controllerForIdentifier:(id)ident 230 249 { 250 if(initialError) 251 { 252 BRAlertController *controller = [SapphireFrontRowCompat alertOfType:0 titled:@"Error" primaryText:@"Framework Error" secondaryText:initialError withScene:nil]; 253 initialError = nil; 254 return controller; 255 } 231 256 NSString *identifier = (NSString *)ident; 232 257 if([identifier isEqualToString:UPGRADE_IDENTIFIER]) -
trunk/SapphireFrappliance/FRAppliance/SapphireURLLoader.m
r1038 r1179 132 132 - (int)cancelForTarget:(id)target 133 133 { 134 for(int i=0; i<[informers count]; i++) 134 int i; 135 for(i=0; i<[informers count]; i++) 135 136 { 136 137 NSInvocation *invoke = [informers objectAtIndex:i]; -
trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.h
r949 r1179 191 191 192 192 /*! 193 * @brief Return the filename, minus the path extension 194 */ 195 - (NSString *)fileName; 196 197 /*! 198 * @brief Return the path, minus the path extension 199 */ 200 - (NSString *)extensionlessPath; 201 202 /*! 193 203 * @brief Get the overridden show name 194 204 * -
trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireFileMetaData.m
r977 r1179 231 231 self.fileClassValue = FILE_CLASS_TV_SHOW; 232 232 NSString *epCoverPath = [[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:[ep path]]; 233 NSString *oldBasePath = [[epCoverPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[self .path lastPathComponent]];234 NSString *oldCoverPath = searchCoverArtExtForPath( [oldBasePath stringByDeletingPathExtension]);233 NSString *oldBasePath = [[epCoverPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:[self fileName]]; 234 NSString *oldCoverPath = searchCoverArtExtForPath(oldBasePath); 235 235 if(oldCoverPath != nil) 236 236 { … … 251 251 self.fileClassValue = FILE_CLASS_MOVIE; 252 252 NSString *movieCoverPath = [movie coverArtPath]; 253 NSString *oldBasePath = [[[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:@"@MOVIES"] stringByAppendingPathComponent:[self .path lastPathComponent]];254 NSString *oldCoverPath = searchCoverArtExtForPath( [oldBasePath stringByDeletingPathExtension]);253 NSString *oldBasePath = [[[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:@"@MOVIES"] stringByAppendingPathComponent:[self fileName]]; 254 NSString *oldCoverPath = searchCoverArtExtForPath(oldBasePath); 255 255 if(oldCoverPath != nil) 256 256 { … … 324 324 { 325 325 /*Check modified date*/ 326 NSDictionary *props = [[NSFileManager defaultManager] fileAttributesAtPath:self.path traverseLink:YES]; 326 NSString *path = nil; 327 NSFileManager *fm = [NSFileManager defaultManager]; 328 if([self fileContainerTypeValue] == FILE_CONTAINER_TYPE_VIDEO_TS) 329 { 330 NSString *vtsPath = [self.path stringByAppendingPathComponent:@"VIDEO_TS"]; 331 NSEnumerator *fileEnum = [[fm directoryContentsAtPath:vtsPath] objectEnumerator]; 332 NSString *file; 333 while((file = [fileEnum nextObject]) != nil) 334 { 335 NSString *lowerFile = [file lowercaseString]; 336 if([lowerFile hasSuffix:@".ifo"] && ![[lowerFile lastPathComponent] isEqualToString:@"video_ts.ifo"]) 337 { 338 path = [vtsPath stringByAppendingPathComponent:file]; 339 break; 340 } 341 } 342 } 343 else 344 path = self.path; 345 NSDictionary *props = [fm fileAttributesAtPath:path traverseLink:YES]; 327 346 int modTime = [[props objectForKey:NSFileModificationDate] timeIntervalSince1970]; 328 347 … … 352 371 353 372 //Check XML 354 NSString *xmlFilePath=[[self .path stringByDeletingPathExtension] stringByAppendingPathExtension:@"xml"];373 NSString *xmlFilePath=[[self extensionlessPath] stringByAppendingPathExtension:@"xml"]; 355 374 SapphireXMLData *xml = self.xmlData; 356 375 NSDictionary *xmlProps = [fm fileAttributesAtPath:xmlFilePath traverseLink:YES]; … … 410 429 NSMutableDictionary *fileMeta = [NSMutableDictionary dictionary]; 411 430 NSString *path = [file path]; 431 NSString *modifiedPath = path; 432 NSFileManager *fm = [NSFileManager defaultManager]; 412 433 413 NSDictionary *props = [[NSFileManager defaultManager] fileAttributesAtPath:path traverseLink:YES]; 434 if([file fileContainerTypeValue] == FILE_CONTAINER_TYPE_VIDEO_TS) 435 { 436 NSString *vtsPath = [[file path] stringByAppendingPathComponent:@"VIDEO_TS"]; 437 NSEnumerator *fileEnum = [[fm directoryContentsAtPath:vtsPath] objectEnumerator]; 438 NSString *file; 439 while((file = [fileEnum nextObject]) != nil) 440 { 441 NSString *lowerFile = [file lowercaseString]; 442 if([lowerFile hasSuffix:@".ifo"] && ![[lowerFile lastPathComponent] isEqualToString:@"video_ts.ifo"]) 443 { 444 modifiedPath = [vtsPath stringByAppendingPathComponent:file]; 445 break; 446 } 447 } 448 } 449 NSDictionary *props = [fm fileAttributesAtPath:modifiedPath traverseLink:YES]; 414 450 int modTime = [[props objectForKey:NSFileModificationDate] timeIntervalSince1970]; 415 451 /*Set modified, size, and version*/ … … 511 547 { 512 548 SapphireVideoTsParser *dvd = [[SapphireVideoTsParser alloc] initWithPath:path]; 513 514 [fileMeta setObject:[dvd videoFormatsString ] forKey:META_FILE_VIDEO_DESC_KEY]; 515 [fileMeta setObject:[dvd audioFormatsString ] forKey:META_FILE_AUDIO_DESC_KEY]; 516 [fileMeta setObject:[dvd subtitlesString ] forKey:META_FILE_SUBTITLES_KEY ]; 517 [fileMeta setObject:[dvd mainFeatureDuration] forKey:META_FILE_DURATION_KEY ]; 518 [fileMeta setObject:[dvd totalSize ] forKey:META_FILE_SIZE_KEY ]; 549 id description = [dvd videoFormatsString]; 550 if(description) 551 [fileMeta setObject:description forKey:META_FILE_VIDEO_DESC_KEY]; 552 description = [dvd audioFormatsString]; 553 if(description) 554 [fileMeta setObject:description forKey:META_FILE_AUDIO_DESC_KEY]; 555 description = [dvd mainFeatureDuration]; 556 if(description) 557 [fileMeta setObject:description forKey:META_FILE_DURATION_KEY]; 558 description = [dvd totalSize]; 559 if(description) 560 [fileMeta setObject:description forKey:META_FILE_SIZE_KEY]; 561 description = [dvd subtitlesString]; 562 if(description) 563 [fileMeta setObject:description forKey:META_FILE_SUBTITLES_KEY ]; 519 564 520 565 [dvd release]; … … 591 636 { 592 637 NSManagedObjectContext *moc = [self managedObjectContext]; 593 NSString *lowerFileName = [[self .path lastPathComponent] lowercaseString];638 NSString *lowerFileName = [[self fileName] lowercaseString]; 594 639 595 640 SapphireEpisode *ep = self.tvEpisode; … … 613 658 else 614 659 lookupName = lowerFileName; 615 SapphireMovieTranslation *movieTran = [SapphireMovieTranslation movieTranslationWithName: [lookupName stringByDeletingPathExtension]inContext:moc];660 SapphireMovieTranslation *movieTran = [SapphireMovieTranslation movieTranslationWithName:lookupName inContext:moc]; 616 661 if(movieTran != nil) 617 662 { … … 651 696 { 652 697 /*Find cover art for the current file in the "Cover Art" dir */ 653 NSString *subPath = [self path]; 654 if([self fileContainerTypeValue] != FILE_CONTAINER_TYPE_VIDEO_TS) 655 subPath = [subPath stringByDeletingPathExtension]; 698 NSString *subPath = [self extensionlessPath]; 656 699 657 700 NSString *fileName = [subPath lastPathComponent]; … … 737 780 [SapphireMetaDataSupport save:[self managedObjectContext]]; 738 781 NSLog(@"Save done"); 739 NSString *extLessPath = [ oldPath stringByDeletingPathExtension];782 NSString *extLessPath = [self extensionlessPath]; 740 783 NSEnumerator *secondaryExtEnum = [secondaryFiles objectEnumerator]; 741 784 NSString *extension; 785 NSString *newExtlessPath = newPath; 786 if(self.fileContainerTypeValue != FILE_CONTAINER_TYPE_VIDEO_TS) 787 newExtlessPath = [newExtlessPath stringByDeletingPathExtension]; 742 788 743 789 while((extension = [secondaryExtEnum nextObject]) != nil) … … 746 792 if([fm fileExistsAtPath:secondaryPath]) 747 793 { 748 NSString *newSecondaryPath = [ [newPath stringByDeletingPathExtension]stringByAppendingPathExtension:extension];794 NSString *newSecondaryPath = [newExtlessPath stringByAppendingPathExtension:extension]; 749 795 if(newParent != nil) 750 796 { … … 767 813 if(coverArtPath != nil) 768 814 { 769 NSString *newCoverArtPath = [ [newPath stringByDeletingPathExtension]stringByAppendingPathExtension:[coverArtPath pathExtension]];815 NSString *newCoverArtPath = [newExtlessPath stringByAppendingPathExtension:[coverArtPath pathExtension]]; 770 816 if(newParent != nil) 771 817 { … … 800 846 return BRLocalizedString(@"A File name should not contain any '/' characters", @"Error indicating that filenames cannot contain / characters"); 801 847 NSString *oldPath = [self path]; 802 newFilename = [newFilename stringByAppendingPathExtension:[oldPath pathExtension]]; 848 if(self.fileContainerTypeValue != FILE_CONTAINER_TYPE_VIDEO_TS) 849 newFilename = [newFilename stringByAppendingPathExtension:[oldPath pathExtension]]; 803 850 NSString *newPath = [[oldPath stringByDeletingLastPathComponent] stringByAppendingPathComponent:newFilename]; 804 851 if([oldPath isEqualToString:newPath]) … … 858 905 } 859 906 907 - (NSString *)fileName 908 { 909 NSString *ret = [self.path lastPathComponent]; 910 if(self.fileContainerTypeValue != FILE_CONTAINER_TYPE_VIDEO_TS) 911 ret = [ret stringByDeletingPathExtension]; 912 913 return ret; 914 } 915 916 - (NSString *)extensionlessPath 917 { 918 NSString *ret = self.path; 919 if(self.fileContainerTypeValue != FILE_CONTAINER_TYPE_VIDEO_TS) 920 ret = [ret stringByDeletingPathExtension]; 921 922 return ret; 923 } 924 860 925 - (NSMutableDictionary *)getDisplayedMetaDataInOrder:(NSArray * *)order; 861 926 { -
trunk/SapphireFrappliance/MetaData/SapphireMObjects/SapphireMovieTranslation.m
r734 r1179 45 45 - (SapphireMoviePoster *)selectedPoster 46 46 { 47 NSNumber *index = self.selectedPosterIndex; 48 if(index == nil) 49 return nil; 50 47 51 NSArray *allPosters = [self.postersSet allObjects]; 48 NSPredicate *indexSearch = [NSPredicate predicateWithFormat:@"index = %d", self.selectedPosterIndexValue];52 NSPredicate *indexSearch = [NSPredicate predicateWithFormat:@"index = %d", [index intValue]]; 49 53 allPosters = [allPosters filteredArrayUsingPredicate:indexSearch]; 50 54 if(![allPosters count]) -
trunk/SapphireFrappliance/MetaData/Support/SapphireMetaDataSupport.m
r977 r1179 324 324 if(error != nil) 325 325 { 326 SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_ DETAIL, @"Save error \"%@\"", error);326 SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_ERROR, @"Save error \"%@\"", error); 327 327 NSArray *details = [[error userInfo] objectForKey:@"NSDetailedErrors"]; 328 328 if(details != nil) … … 331 331 NSError *aError; 332 332 while((aError = [errorEnum nextObject]) != nil) 333 SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_ DETAIL, @"One error is %@: %@", aError, [aError userInfo]);333 SapphireLog(SAPPHIRE_LOG_METADATA_STORE, SAPPHIRE_LOG_LEVEL_ERROR, @"One error is %@: %@", aError, [aError userInfo]); 334 334 } 335 335 NSException *underlying = [[error userInfo] objectForKey:@"NSUnderlyingException"]; -
trunk/SapphireFrappliance/MetaDataImporting/SapphireMovieImporter.m
r1139 r1179 32 32 #import "SapphireURLLoader.h" 33 33 #import "SapphireScraper.h" 34 #import "NSString-Extensions.h" 34 35 35 36 @interface SapphireMovieImportStateData : SapphireImportStateData … … 37 38 @public 38 39 SapphireSiteMovieScraper *siteScraper; 40 SapphireMovieTranslation *translation; 39 41 } 40 42 - (id)initWithFile:(SapphireFileMetaData *)aFile atPath:(NSString *)aPath scraper:(SapphireSiteMovieScraper *)siteScaper; 43 - (void)setTranslation:(SapphireMovieTranslation *)aTranslation; 44 - (SapphireMovieTranslation *)createTranslationInContext:(NSManagedObjectContext *)moc; 41 45 @end 42 46 … … 57 61 { 58 62 [siteScraper release]; 63 [translation release]; 59 64 [super dealloc]; 60 65 } 61 66 67 - (void)setTranslation:(SapphireMovieTranslation *)aTranslation 68 { 69 [translation autorelease]; 70 translation = [aTranslation retain]; 71 } 72 73 - (SapphireMovieTranslation *)createTranslationInContext:(NSManagedObjectContext *)moc 74 { 75 SapphireMovieTranslation *tran = [SapphireMovieTranslation createMovieTranslationWithName:lookupName inContext:moc]; 76 [self setTranslation:tran]; 77 return tran; 78 } 79 62 80 @end 63 81 … … 65 83 66 84 @interface SapphireMovieImporter () 67 - (void)getMovieResultsForState:(SapphireMovieImportStateData *)state translation:(SapphireMovieTranslation *)tran;68 - (void)getMoviePostersForState:(SapphireMovieImportStateData *)state t ranslation:(SapphireMovieTranslation *)tran thumbElements:(NSArray *)thumbElements;85 - (void)getMovieResultsForState:(SapphireMovieImportStateData *)state; 86 - (void)getMoviePostersForState:(SapphireMovieImportStateData *)state thumbElements:(NSArray *)thumbElements; 69 87 - (void)saveMoviePosterAtURL:(NSString *)url forTranslation:(SapphireMovieTranslation *)tran; 70 88 - (void)completeWithState:(SapphireMovieImportStateData *)state withStatus:(ImportState)status importComplete:(BOOL)importComplete; … … 79 97 return self; 80 98 81 NSError *error = nil;82 99 scraper = [[SapphireScraper scrapperWithName:@"IMDb.com"] retain]; 83 100 … … 102 119 } 103 120 104 - (void)retrievedSearchResuls:(NSXMLDocument *)results forObject:(SapphireMovieImportStateData *)state 105 { 121 - (void)retrievedSearchResuls:(NSXMLDocument *)results forObject:(id)stateObj 122 { 123 SapphireMovieImportStateData *state = (SapphireMovieImportStateData *)stateObj; 106 124 [state->siteScraper setObject:nil]; //Avoid retain loop 107 125 if(cancelled) … … 157 175 SapphireFileMetaData *metaData = state->file; 158 176 NSManagedObjectContext *moc = [metaData managedObjectContext]; 159 NSString *lookupName = [[state->lookupName lowercaseString] stringByDeletingPathExtension]; 160 SapphireMovieTranslation *tran = [SapphireMovieTranslation createMovieTranslationWithName:lookupName inContext:moc]; 177 SapphireMovieTranslation *tran = [state createTranslationInContext:moc]; 161 178 [tran setIMDBLink:[[movies objectAtIndex:0] objectForKey:movieTranslationLinkKey]]; 162 [self getMovieResultsForState:state translation:tran];179 [self getMovieResultsForState:state]; 163 180 } 164 181 else … … 167 184 SapphireMovieChooser *chooser = [[SapphireMovieChooser alloc] initWithScene:[delegate chooserScene]]; 168 185 [chooser setMovies:movies]; 169 [chooser setFileName: state->lookupName];186 [chooser setFileName:[NSString stringByCroppingDirectoryPath:state->path toLength:3]]; 170 187 [chooser setListTitle:BRLocalizedString(@"Select Movie Title", @"Prompt the user for title of movie")]; 171 188 /*And display prompt*/ … … 176 193 } 177 194 178 - (void)getMovieResultsForState:(SapphireMovieImportStateData *)state translation:(SapphireMovieTranslation *)tran 179 { 195 - (void)getMovieResultsForState:(SapphireMovieImportStateData *)state 196 { 197 SapphireMovieTranslation *tran = state->translation; 180 198 NSString *link = [tran IMDBLink]; 181 199 SapphireSiteMovieScraper *siteScraper = state->siteScraper; … … 188 206 } 189 207 190 - (void)retrievedMovieDetails:(NSXMLDocument *)details forObject:(SapphireMovieImportStateData *)state 191 { 208 - (void)retrievedMovieDetails:(NSXMLDocument *)details forObject:(id)stateObj 209 { 210 SapphireMovieImportStateData *state = (SapphireMovieImportStateData *)stateObj; 192 211 [state->siteScraper setObject:nil]; //Avoid retain loop 193 212 … … 265 284 [infoIMDB setObject:movieTitle forKey:META_MOVIE_TITLE_KEY]; 266 285 267 NSString *movieTranslationString = [[state->lookupName lowercaseString] stringByDeletingPathExtension];268 286 SapphireFileMetaData *metaData = state->file; 269 287 NSManagedObjectContext *moc = [metaData managedObjectContext]; 270 SapphireMovieTranslation *tran = [SapphireMovieTranslation movieTranslationWithName:movieTranslationString inContext:moc];271 288 SapphireMovie *movie = [SapphireMovie movieWithDictionary:infoIMDB inContext:moc]; 272 289 if(movie == nil) … … 276 293 return; 277 294 } 278 [ tran setMovie:movie];295 [state->translation setMovie:movie]; 279 296 [metaData setMovie:movie]; 280 297 … … 286 303 BOOL canDisplay = [delegate canDisplayChooser]; 287 304 if(canDisplay && [thumbs count]) 288 [self getMoviePostersForState:state t ranslation:tran thumbElements:thumbs];305 [self getMoviePostersForState:state thumbElements:thumbs]; 289 306 else 290 307 [self completeWithState:state withStatus:ImportStateUpdated importComplete:canDisplay]; 291 308 } 292 309 293 - (void)getMoviePostersForState:(SapphireMovieImportStateData *)state t ranslation:(SapphireMovieTranslation *)tran thumbElements:(NSArray *)thumbElements;310 - (void)getMoviePostersForState:(SapphireMovieImportStateData *)state thumbElements:(NSArray *)thumbElements; 294 311 { 295 312 NSMutableArray *previews = [NSMutableArray arrayWithCapacity:[thumbElements count]]; 313 SapphireMovieTranslation *tran = state->translation; 296 314 if([thumbElements count]) 297 315 { 298 316 int index = 0; 299 317 NSManagedObjectContext *moc = [tran managedObjectContext]; 318 //Redoing posters, get rid of old ones 319 [tran setSelectedPosterIndex:nil]; 320 NSEnumerator *posterEnum = [[tran postersSet] objectEnumerator]; 321 SapphireMoviePoster *poster; 322 while((poster = [posterEnum nextObject]) != nil) 323 [moc deleteObject:poster]; 324 300 325 NSEnumerator *thumbEnum = [thumbElements objectEnumerator]; 301 326 NSXMLElement *thumb; … … 330 355 } 331 356 } 332 if([previews count]) 357 if([tran selectedPoster]) 358 { 359 [self saveMoviePosterAtURL:[[tran selectedPoster] link] forTranslation:tran]; 360 [self completeWithState:state withStatus:ImportStateUpdated importComplete:YES]; 361 } 362 else if([previews count]) 333 363 { 334 364 SapphirePosterChooser *posterChooser = [[SapphirePosterChooser alloc] initWithScene:[delegate chooserScene]]; … … 342 372 { 343 373 [posterChooser setPosters:previews]; 344 [posterChooser setFileName: state->lookupName];374 [posterChooser setFileName:[NSString stringByCroppingDirectoryPath:state->path toLength:3]]; 345 375 [posterChooser setFile:state->file]; 346 376 [posterChooser setListTitle:BRLocalizedString(@"Select Movie Poster", @"Prompt the user for poster selection")]; … … 430 460 return ImportStateNotUpdated; 431 461 SapphireLog(SAPPHIRE_LOG_IMPORT, SAPPHIRE_LOG_LEVEL_DEBUG, @"Going to movie import %@", path); 432 NSString *fileName = [path lastPathComponent]; 462 NSString *extLessPath = path; 463 if([metaData fileContainerTypeValue] != FILE_CONTAINER_TYPE_VIDEO_TS) 464 extLessPath = [extLessPath stringByDeletingPathExtension]; 465 433 466 /*choose between file or directory name for lookup */ 434 467 NSString *lookupName; 435 468 if([[SapphireSettings sharedSettings] dirLookup]) 436 lookupName = [[ path stringByDeletingLastPathComponent] lastPathComponent];437 else 438 lookupName = fileName;469 lookupName = [[[path stringByDeletingLastPathComponent] lastPathComponent] lowercaseString]; 470 else 471 lookupName = [[extLessPath lastPathComponent] lowercaseString]; 439 472 440 473 SapphireSiteMovieScraper *siteScraper = [[[SapphireSiteMovieScraper alloc] initWithMovieScraper:scraper delegate:self loader:[SapphireApplianceController urlLoader]] autorelease]; 441 474 SapphireMovieImportStateData *state = [[[SapphireMovieImportStateData alloc] initWithFile:metaData atPath:path scraper:siteScraper] autorelease]; 442 475 [state setLookupName:lookupName]; 443 /*Get the movie title*/444 NSString *movieDataLink = nil ;445 476 /*Check to see if we know this movie*/ 446 NSString *movieTranslationString = [[lookupName lowercaseString] stringByDeletingPathExtension]; 447 SapphireLog(SAPPHIRE_LOG_IMPORT, SAPPHIRE_LOG_LEVEL_DETAIL, @"Searching for movie %@", movieTranslationString); 477 478 /*Look for a year in the title*/ 479 NSScanner *titleYearScanner = [NSScanner scannerWithString:state->lookupName]; 480 NSString *normalTitle = nil; 481 int year = 0; 482 BOOL success = YES; 483 success &= [titleYearScanner scanUpToString:@"(" intoString:&normalTitle]; 484 success &= [titleYearScanner scanString:@"(" intoString:nil]; 485 success &= [titleYearScanner scanInt:&year]; 486 success &= [titleYearScanner scanString:@")" intoString:nil]; 487 488 NSString *yearStr = nil; 489 if(success) 490 { 491 yearStr = [NSString stringWithFormat:@"%d", year]; 492 if([normalTitle hasSuffix:@" "]) 493 normalTitle = [normalTitle substringToIndex:[normalTitle length]-1]; 494 [state setLookupName:normalTitle]; 495 } 496 497 SapphireLog(SAPPHIRE_LOG_IMPORT, SAPPHIRE_LOG_LEVEL_DETAIL, @"Searching for movie \"%@\"", state->lookupName); 448 498 NSManagedObjectContext *moc = [metaData managedObjectContext]; 449 SapphireMovieTranslation *tran = [SapphireMovieTranslation movieTranslationWithName:movieTranslationString inContext:moc]; 499 SapphireMovieTranslation *tran = [SapphireMovieTranslation movieTranslationWithName:state->lookupName inContext:moc]; 500 [state setTranslation:tran]; 450 501 int searchIMDBNumber = [metaData searchIMDBNumber]; 451 502 if(searchIMDBNumber > 0) 452 503 { 453 504 if(!tran) 454 tran = [ SapphireMovieTranslation createMovieTranslationWithName:movieTranslationString inContext:moc];505 tran = [state createTranslationInContext:moc]; 455 506 [tran setIMDBLink:[NSString stringWithFormat:@"/title/tt%08d", searchIMDBNumber]]; 456 507 } … … 458 509 { 459 510 BOOL nfoPathIsDir = NO; 460 NSString *nfoFilePath=[ [path stringByDeletingPathExtension]stringByAppendingPathExtension:@"nfo"];511 NSString *nfoFilePath=[extLessPath stringByAppendingPathExtension:@"nfo"]; 461 512 NSString *moviePath = nil; 462 513 if([[NSFileManager defaultManager] fileExistsAtPath:nfoFilePath isDirectory:&nfoPathIsDir] && !nfoPathIsDir) … … 464 515 465 516 if([moviePath length]) 517 { 518 if(tran == nil) 519 tran = [state createTranslationInContext:moc]; 466 520 [tran setIMDBLink:moviePath]; 521 } 467 522 else 468 523 { … … 471 526 return ImportStateNotUpdated; 472 527 473 /*Look for a year in the title*/ 474 NSString *searchStr = [lookupName stringByDeletingPathExtension]; 475 NSScanner *titleYearScanner = [NSScanner scannerWithString:searchStr]; 476 NSString *normalTitle = nil; 477 int year = 0; 478 BOOL success = YES; 479 success &= [titleYearScanner scanUpToString:@"(" intoString:&normalTitle]; 480 NSString *junk = nil; 481 success &= [titleYearScanner scanString:@"(" intoString:nil]; 482 success &= [titleYearScanner scanInt:&year]; 483 success &= [titleYearScanner scanString:@")" intoString:nil]; 484 485 NSString *yearStr = nil; 486 if(!success) 487 { 488 normalTitle = searchStr; 489 } 490 else 491 yearStr = [NSString stringWithFormat:@"%d", year]; 492 493 SapphireLog(SAPPHIRE_LOG_IMPORT, SAPPHIRE_LOG_LEVEL_DEBUG, @"Searching for %@ with year %@", normalTitle, yearStr); 528 SapphireLog(SAPPHIRE_LOG_IMPORT, SAPPHIRE_LOG_LEVEL_DEBUG, @"Searching for %@ with year %@", state->lookupName, yearStr); 494 529 495 530 /*Ask the user what movie this is*/ 496 531 [siteScraper setObject:state]; 497 [siteScraper searchForMovieName: normalTitle year:yearStr];532 [siteScraper searchForMovieName:state->lookupName year:yearStr]; 498 533 return ImportStateBackground; 499 534 } … … 504 539 { 505 540 [metaData setMovie:movie]; 506 return ImportStateUpdated; 507 } 508 [self getMovieResultsForState:state translation:tran]; 541 if([tran selectedPoster] != nil) 542 return ImportStateUpdated; 543 [self getMoviePostersForState:state thumbElements:[NSArray array]]; 544 return ImportStateBackground; 545 } 546 [self getMovieResultsForState:state]; 509 547 return ImportStateBackground; 510 548 } … … 531 569 } 532 570 533 - (BOOL)stillNeedsDisplayOfChooser:(BRLayerController <SapphireChooser> *)chooser withContext:(SapphireMovieImportStateData *)state 534 { 571 - (BOOL)stillNeedsDisplayOfChooser:(BRLayerController <SapphireChooser> *)chooser withContext:(id)context 572 { 573 SapphireMovieImportStateData *state = (SapphireMovieImportStateData *)context; 535 574 if([chooser isKindOfClass:[SapphireMovieChooser class]]) 536 575 { 537 SapphireMovieChooser *movieChooser = (SapphireMovieChooser *)chooser;538 576 NSManagedObjectContext *moc = [state->file managedObjectContext]; 539 NSString *filename = [[[movieChooser fileName] lowercaseString] stringByDeletingPathExtension]; 540 SapphireMovieTranslation *tran = [SapphireMovieTranslation movieTranslationWithName:filename inContext:moc]; 577 SapphireMovieTranslation *tran = [SapphireMovieTranslation movieTranslationWithName:state->lookupName inContext:moc]; 578 if(tran) 579 [state setTranslation:tran]; 541 580 if([tran IMDBLink]) 542 581 { 543 [self getMovieResultsForState:state translation:tran];582 [self getMovieResultsForState:state]; 544 583 return NO; 545 584 } … … 547 586 else if([chooser isKindOfClass:[SapphirePosterChooser class]]) 548 587 { 549 SapphirePosterChooser *posterChooser = (SapphirePosterChooser *)chooser; 550 NSString *filename = [[[posterChooser fileName] lowercaseString] stringByDeletingPathExtension]; 551 NSManagedObjectContext *moc = [state->file managedObjectContext]; 552 SapphireMovieTranslation *tran = [SapphireMovieTranslation movieTranslationWithName:filename inContext:moc]; 588 SapphireMovieTranslation *tran = state->translation; 553 589 if([[tran selectedPoster] link]) 554 590 { … … 561 597 } 562 598 563 - (void)exhumedChooser:(BRLayerController <SapphireChooser> *)chooser withContext:(SapphireMovieImportStateData *)state 564 { 599 - (void)exhumedChooser:(BRLayerController <SapphireChooser> *)chooser withContext:(id)context 600 { 601 SapphireMovieImportStateData *state = (SapphireMovieImportStateData *)context; 565 602 /*See if it was a movie chooser*/ 566 603 if([chooser isKindOfClass:[SapphireMovieChooser class]]) … … 585 622 /*They selected a movie title, save the translation and write it*/ 586 623 NSDictionary *movie = [[movieChooser movies] objectAtIndex:selection]; 587 NSString *filename = [[[movieChooser fileName] lowercaseString] stringByDeletingPathExtension]; 588 SapphireMovieTranslation *tran = [SapphireMovieTranslation createMovieTranslationWithName:filename inContext:moc]; 624 SapphireMovieTranslation *tran = [state createTranslationInContext:moc]; 589 625 /* Add IMDB Key */ 590 626 [tran setIMDBLink:[movie objectForKey:movieTranslationLinkKey]]; 591 627 /*We can resume now*/ 592 [self getMovieResultsForState:state translation:tran];628 [self getMovieResultsForState:state]; 593 629 } 594 630 [SapphireMetaDataSupport save:moc]; … … 605 641 else 606 642 { 607 NSString *filename = [[[posterChooser fileName] lowercaseString] stringByDeletingPathExtension]; 608 SapphireMovieTranslation *tran = [SapphireMovieTranslation createMovieTranslationWithName:filename inContext:moc]; 643 SapphireMovieTranslation *tran = state->translation; 609 644 [tran setSelectedPosterIndexValue:selectedPoster]; 610 [self saveMoviePosterAtURL:[[tran posterAtIndex:selectedPoster] link] forTranslation:tran];645 [self saveMoviePosterAtURL:[[tran selectedPoster] link] forTranslation:tran]; 611 646 [self completeWithState:state withStatus:ImportStateUpdated importComplete:YES]; 612 647 } 613 posterChooser = nil;614 648 [SapphireMetaDataSupport save:moc]; 615 649 } -
trunk/SapphireFrappliance/MetaDataImporting/SapphireNfoImporter.m
r1044 r1179 48 48 /*Check for NFO file*/ 49 49 BOOL nfoPathIsDir = NO; 50 NSString *nfoFilePath=[[path stringByDeletingPathExtension] stringByAppendingPathExtension:@"nfo"]; 50 NSString *extLessPath = path; 51 if([metaData fileContainerTypeValue] != FILE_CONTAINER_TYPE_VIDEO_TS) 52 extLessPath = [extLessPath stringByDeletingPathExtension]; 53 54 NSString *nfoFilePath=[extLessPath stringByAppendingPathExtension:@"nfo"]; 51 55 if(![fm fileExistsAtPath:nfoFilePath isDirectory:&nfoPathIsDir] || nfoPathIsDir) 52 56 return ImportStateNotUpdated; -
trunk/SapphireFrappliance/MetaDataImporting/SapphirePosterChooser.h
r1017 r1179 31 31 */ 32 32 @interface SapphirePosterChooser : SapphireMediaMenuController <BRIconSourceProtocol, BRMenuListItemProvider, SapphireLayoutDelegate, SapphireChooser> { 33 BOOL displayed; /*!< @brief YES if currently displayed, NO otherwise*/ 33 34 NSMutableArray *posters; /*!< @brief The array of poster urls and after loaded, the NSImages*/ 34 35 NSMutableArray *posterLayers; /*!< @brief The image layers of posters*/ 36 NSMutableArray *posterData; /*!< @brief The data for the poster images*/ 35 37 NSString *fileName; /*!< @brief The movie filename*/ 36 38 NSString *movieTitle; /*!< @brief The title of the movie*/ -
trunk/SapphireFrappliance/MetaDataImporting/SapphirePosterChooser.m
r1038 r1179 42 42 - (BRBlurryImageLayer *)getPosterLayerForData:(NSData *)thePosterData; 43 43 - (void)loadPoster:(int)index; 44 - (void)reloadPosterWithData:(NSData *)data atIndex:(int)intIndex; 44 45 @end 45 46 … … 93 94 [posters release]; 94 95 [posterLayers release]; 96 [posterData release]; 95 97 [fileName release]; 96 98 [movieTitle release]; … … 187 189 int i, count = [posters count]; 188 190 posterLayers = [posters mutableCopy]; 191 posterData = [[NSMutableArray alloc] initWithCapacity:[posters count]]; 192 NSNull *nsnull = [NSNull null]; 193 for(i=0; i<count; i++) 194 [posterData addObject:nsnull]; 189 195 for(i=0; i<count; i++) 190 196 [self loadPoster:i]; … … 202 208 NSString *posterURL = [posters objectAtIndex:index]; 203 209 [posterLayers replaceObjectAtIndex:index withObject:[self getPosterLayerForData:nil]]; 204 [[SapphireApplianceController urlLoader] loadDataURL:posterURL withTarget:self selector:@selector(reloadPosterWithData:atIndex:) object:[NSNumber numberWithInt:index] withPriority:YES]; 205 } 206 207 - (void)reloadPosterWithData:(NSData *)data atIndex:(NSNumber *)index; 208 { 209 int intIndex = [index intValue]; 210 [[SapphireApplianceController urlLoader] loadDataURL:posterURL withTarget:self selector:@selector(gotPosterData:atIndex:) object:[NSNumber numberWithInt:index] withPriority:YES]; 211 } 212 213 - (void)gotPosterData:(NSData *)data atIndex:(NSNumber *)index; 214 { 215 if(displayed) 216 [self reloadPosterWithData:data atIndex:[index intValue]]; 217 else 218 [posterData replaceObjectAtIndex:[index intValue] withObject:data]; 219 } 220 221 - (void)reloadPosterWithData:(NSData *)data atIndex:(int)intIndex; 222 { 210 223 [posterLayers replaceObjectAtIndex:intIndex withObject:[self getPosterLayerForData:data]]; 211 224 NSImage *image = [[NSImage alloc] initWithData:data]; … … 539 552 [[self list] reload]; 540 553 [super wasPushed]; 554 displayed = YES; 555 int i, count = [posterData count]; 556 for(i=0; i<count; i++) 557 { 558 id obj = [posterData objectAtIndex:i]; 559 if([obj isKindOfClass:[NSData class]]) 560 [self reloadPosterWithData:obj atIndex:i]; 561 } 541 562 } 542 563 -
trunk/SapphireFrappliance/MetaDataImporting/SapphireScraper.m
r1141 r1179 228 228 - (void)clearBuffers 229 229 { 230 for(int i=0; i<SCRAPER_BUFFER_COUNT; i++) 230 int i; 231 for(i=0; i<SCRAPER_BUFFER_COUNT; i++) 231 232 { 232 233 [scraperBuffers[i] release]; … … 243 244 - (void)clearStorchMatches 244 245 { 245 for(int i=0; i<SCRAPER_MATCH_COUNT; i++) 246 int i; 247 for(i=0; i<SCRAPER_MATCH_COUNT; i++) 246 248 { 247 249 [storedMatches[i] release]; … … 286 288 NSArray *settingDescs = [rootSetting elementsForName:@"setting"]; 287 289 288 int count = [settingDescs count] ;289 for(i nt i=0; i<count; i++)290 int count = [settingDescs count], i; 291 for(i=0; i<count; i++) 290 292 { 291 293 [self parseSetting:[settingDescs objectAtIndex:i]]; … … 341 343 void bufferBooleanAttributeWithDefault(NSXMLElement *element, NSString *attributeName, BOOL defaultValue, BOOL *values) 342 344 { 345 int i; 343 346 if(defaultValue) 344 for(i nt i=0; i<SCRAPER_MATCH_COUNT; i++)347 for(i=0; i<SCRAPER_MATCH_COUNT; i++) 345 348 values[i] = YES; 346 349 else … … 352 355 NSArray *valueStrings = [attr componentsSeparatedByString:@","]; 353 356 int count = [valueStrings count]; 354 for(i nt i=0; i<count; i++)357 for(i=0; i<count; i++) 355 358 { 356 359 int index = [[valueStrings objectAtIndex:i] intValue]; … … 575 578 if(count) 576 579 { 577 for(int i=0; i<count; i++) 580 int i; 581 for(i=0; i<count; i++) 578 582 [self parseElement:[regexChildren objectAtIndex:i]]; 579 583 } … … 610 614 NSXMLElement *functionElement = [elements objectAtIndex:0]; 611 615 elements = [functionElement elementsForName:@"RegExp"]; 612 int count = [elements count] ;613 for(i nt i=0; i<count; i++)616 int count = [elements count], i; 617 for(i=0; i<count; i++) 614 618 { 615 619 [self parseElement:[elements objectAtIndex:i]]; -
trunk/SapphireFrappliance/MetaDataImporting/SapphireTVShowImporter.m
r1134 r1179 231 231 } 232 232 233 - (void)retrievedSearchResuls:(NSXMLDocument *)results forObject:(SapphireTVShowImportStateData *)state 234 { 233 - (void)retrievedSearchResuls:(NSXMLDocument *)results forObject:(id)stateObj 234 { 235 SapphireTVShowImportStateData *state = (SapphireTVShowImportStateData *)stateObj; 235 236 [state->siteScraper setObject:nil]; //Avoid retain loop 236 237 if(cancelled) … … 286 287 SapphireShowChooser *chooser = [[SapphireShowChooser alloc] initWithScene:[delegate chooserScene]]; 287 288 [chooser setShows:shows]; 288 [chooser setFileName:[NSString stringByCroppingDirectoryPath:state->path toLength:3]]; 289 [chooser setFileName:[NSString stringByCroppingDirectoryPath:state->path toLength:3]]; 289 290 [chooser setListTitle:BRLocalizedString(@"Select Show Title", @"Prompt the user for showname with a file")]; 290 291 /*And display prompt*/ … … 307 308 { 308 309 NSString *coverArtPath = [[SapphireMetaDataSupport collectionArtPath] stringByAppendingPathComponent:[NSString stringWithFormat:@"@TV/%@/cover.jpg", [show name]]]; 309 BOOL isDir = NO;310 310 if(![[NSFileManager defaultManager] fileExistsAtPath:coverArtPath]) 311 311 fetchShowData = YES; … … 325 325 } 326 326 327 - (void)retrievedShowDetails:(NSXMLDocument *)details forObject:(SapphireTVShowImportStateData *)state 328 { 327 - (void)retrievedShowDetails:(NSXMLDocument *)details forObject:(id)stateObj 328 { 329 SapphireTVShowImportStateData *state = (SapphireTVShowImportStateData *)stateObj; 329 330 [state->siteScraper setObject:nil]; //Avoid retain loop 330 331 if(cancelled) … … 408 409 } 409 410 410 - (void)retrievedEpisodeList:(NSXMLDocument *)episodeList forObject:(SapphireTVShowImportStateData *)state 411 { 411 - (void)retrievedEpisodeList:(NSXMLDocument *)episodeList forObject:(id)stateObj 412 { 413 SapphireTVShowImportStateData *state = (SapphireTVShowImportStateData *)stateObj; 412 414 [state->siteScraper setObject:nil]; //Avoid retain loop 413 415 if(cancelled) … … 441 443 } 442 444 443 - (void)retrievedEpisodeDetails:(NSXMLDocument *)details forObject:(SapphireSingleTVShowEpisodeImportStateData *)state 444 { 445 - (void)retrievedEpisodeDetails:(NSXMLDocument *)details forObject:(id)stateObj 446 { 447 SapphireSingleTVShowEpisodeImportStateData *state = (SapphireSingleTVShowEpisodeImportStateData *)stateObj; 445 448 SapphireTVShowImportStateData *tvState = state->state; 446 449 [state->siteScraper setObject:nil]; //Avoid retain loop … … 525 528 if(state->episodesCompleted == [infoArray count]) 526 529 { 527 for(int i=0; i<[infoArray count]; i++) 530 int i; 531 for(i=0; i<[infoArray count]; i++) 528 532 { 529 533 if(![[infoArray objectAtIndex:i] count]) … … 593 597 return ImportStateNotUpdated; 594 598 // NSArray *pathComponents = [path pathComponents]; 599 NSString *extLessPath = path; 600 if([metaData fileContainerTypeValue] != FILE_CONTAINER_TYPE_VIDEO_TS) 601 extLessPath = [extLessPath stringByDeletingPathExtension]; 602 595 603 NSString *fileName = [path lastPathComponent]; 596 604 … … 704 712 { 705 713 BOOL nfoPathIsDir = NO; 706 NSString *nfoFilePath=[ [path stringByDeletingPathExtension]stringByAppendingPathExtension:@"nfo"];714 NSString *nfoFilePath=[extLessPath stringByAppendingPathExtension:@"nfo"]; 707 715 NSString *showPath = nil; 708 716 if([[NSFileManager defaultManager] fileExistsAtPath:nfoFilePath isDirectory:&nfoPathIsDir] && !nfoPathIsDir) … … 768 776 } 769 777 770 - (BOOL)stillNeedsDisplayOfChooser:(BRLayerController <SapphireChooser> *)chooser withContext:(SapphireTVShowImportStateData *)state 771 { 778 - (BOOL)stillNeedsDisplayOfChooser:(BRLayerController <SapphireChooser> *)chooser withContext:(id)context 779 { 780 SapphireTVShowImportStateData *state = (SapphireTVShowImportStateData *)context; 772 781 /*Check for a match done earlier*/ 773 782 NSManagedObjectContext *moc = [state->file managedObjectContext]; … … 782 791 } 783 792 784 - (void)exhumedChooser:(BRLayerController <SapphireChooser> *)aChooser withContext:(SapphireTVShowImportStateData *)state; 785 { 793 - (void)exhumedChooser:(BRLayerController <SapphireChooser> *)aChooser withContext:(id)context 794 { 795 SapphireTVShowImportStateData *state = (SapphireTVShowImportStateData *)context; 786 796 if(![aChooser isKindOfClass:[SapphireShowChooser class]]) 787 797 return; -
trunk/SapphireFrappliance/MetaDataImporting/SapphireVideoTSParser.m
r913 r1179 24 24 // Instead of declaring them in the header, we declare them here in a category that extends the class. 25 25 26 @interface SapphireVideoTsParser ( InternalMethods)26 @interface SapphireVideoTsParser () 27 27 28 28 /*! … … 76 76 #define vts_VideoIsWidescreen(attrs) ( attrs[0] & 0x0c) 77 77 78 #define vts_AudioIsDTS(attrs) ((attrs[0] & 0xe0) == 0x 0c)78 #define vts_AudioIsDTS(attrs) ((attrs[0] & 0xe0) == 0xc0) 79 79 #define vts_AudioIsSurround(attrs) ( attrs[0] & 0x02) 80 80 #define vts_AudioIsCommentary(attrs) ( attrs[5] > 1) … … 100 100 static NSString *languageFromEncodedChars( const char firstChar, const char secondChar ) 101 101 { 102 static NSLocale *currentLocale = nil;102 NSLocale *currentLocale = [NSLocale currentLocale]; 103 103 const char langCode[] = { firstChar, secondChar, 0 }; 104 104 105 if( currentLocale == nil )106 currentLocale = [NSLocale currentLocale];107 108 105 return [currentLocale displayNameForKey:NSLocaleLanguageCode 109 106 value:[NSString stringWithCString:langCode encoding:NSASCIIStringEncoding]]; … … 319 316 audio = commaSeparatedStringFromCollection( audioList ); 320 317 } 321 322 if( audio == nil )323 audio = BRLocalizedString( @"Not specified", @"No Audio information available for a DVD" );;324 318 } 325 319 … … 355 349 subtitles = commaSeparatedStringFromCollection( subtitleList ); 356 350 } 357 358 if( subtitles == nil )359 subtitles = BRLocalizedString( @"None", @"No Subtitle information available for a DVD" );360 351 } 361 352 -
trunk/SapphireFrappliance/MetaDataImporting/SapphireXMLFileDataImporter.m
r1019 r1179 99 99 /*Check for XML file*/ 100 100 BOOL xmlPathIsDir = NO; 101 NSString *xmlFilePath=[[path stringByDeletingPathExtension] stringByAppendingPathExtension:@"xml"]; 101 NSString *extLessPath = path; 102 if([metaData fileContainerTypeValue] != FILE_CONTAINER_TYPE_VIDEO_TS) 103 extLessPath = [extLessPath stringByDeletingPathExtension]; 104 105 NSString *xmlFilePath=[extLessPath stringByAppendingPathExtension:@"xml"]; 102 106 SapphireXMLData *xml = [metaData xmlData]; 103 107 if(![fm fileExistsAtPath:xmlFilePath isDirectory:&xmlPathIsDir] || xmlPathIsDir) -
trunk/SapphireFrappliance/Sapphire.xcodeproj/project.pbxproj
r1043 r1179 64 64 F50044160D19A268003FEA08 /* LeopardOnly.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F5003FF90D19980B003FEA08 /* LeopardOnly.framework */; }; 65 65 F506593110B22EC800D0F1FE /* SapphireTVDirectory.m in Sources */ = {isa = PBXBuildFile; fileRef = F506593010B22EC800D0F1FE /* SapphireTVDirectory.m */; }; 66 F50CCEEE1119E3E300213966 /* CommonMediaPlayer.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = F50CCEEC1119E3BD00213966 /* CommonMediaPlayer.framework */; }; 66 67 F51BFC1B0D26ACAD00E22363 /* AppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F56A19480C3170870022918E /* AppKit.framework */; }; 67 68 F51BFC1C0D26ACAD00E22363 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 089C1672FE841209C02AAC07 /* Foundation.framework */; }; … … 103 104 F58AAF7A0ECFB04F0071CF4B /* SapphireLogging.m in Sources */ = {isa = PBXBuildFile; fileRef = F58AAF790ECFB04F0071CF4B /* SapphireLogging.m */; }; 104 105 F58C52230F13B18F00DE7A65 /* SapphireTextEntryController.m in Sources */ = {isa = PBXBuildFile; fileRef = F58C52220F13B18F00DE7A65 /* SapphireTextEntryController.m */; }; 106 F595C614111A679D00C6C322 /* SapphireCMPWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = F595C613111A679D00C6C322 /* SapphireCMPWrapper.m */; }; 105 107 F59B29D10D9E8C6E002D5DBD /* NSArray-Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = F5FB82E30D18065F0018E4C9 /* NSArray-Extensions.m */; }; 106 108 F59BB9180DF43C3E00EC11A2 /* SapphireMetaDataUpgrading.m in Sources */ = {isa = PBXBuildFile; fileRef = F59BB9170DF43C3E00EC11A2 /* SapphireMetaDataUpgrading.m */; }; … … 219 221 220 222 /* Begin PBXContainerItemProxy section */ 223 F500272411235751001B52FE /* PBXContainerItemProxy */ = { 224 isa = PBXContainerItemProxy; 225 containerPortal = F50CCEE71119E3BD00213966 /* CommonMediaPlayer.xcodeproj */; 226 proxyType = 2; 227 remoteGlobalIDString = F500271A11235732001B52FE; 228 remoteInfo = UIDebug; 229 }; 221 230 F50044110D19A242003FEA08 /* PBXContainerItemProxy */ = { 222 231 isa = PBXContainerItemProxy; … … 232 241 remoteGlobalIDString = F5B4186D0D0B29D800BDD361; 233 242 remoteInfo = "Complete Sapphire"; 243 }; 244 F50CCEEB1119E3BD00213966 /* PBXContainerItemProxy */ = { 245 isa = PBXContainerItemProxy; 246 containerPortal = F50CCEE71119E3BD00213966 /* CommonMediaPlayer.xcodeproj */; 247 proxyType = 2; 248 remoteGlobalIDString = 8DC2EF5B0486A6940098B216; 249 remoteInfo = CommonMediaPlayer; 250 }; 251 F50CCEF11119E3EE00213966 /* PBXContainerItemProxy */ = { 252 isa = PBXContainerItemProxy; 253 containerPortal = F50CCEE71119E3BD00213966 /* CommonMediaPlayer.xcodeproj */; 254 proxyType = 1; 255 remoteGlobalIDString = 8DC2EF4F0486A6940098B216; 256 remoteInfo = CommonMediaPlayer; 234 257 }; 235 258 F532EC470E44FBC900DBEE13 /* PBXContainerItemProxy */ = { … … 405 428 F59FEEFD0ED85FEF0052012E /* SapphireTakeTwoPointTwoCompatClasses.framework in CopyFiles */, 406 429 F54A38ED109F43C600DCC808 /* SapphireTakeThreeCompatClasses.framework in CopyFiles */, 430 F50CCEEE1119E3E300213966 /* CommonMediaPlayer.framework in CopyFiles */, 407 431 ); 408 432 runOnlyForDeploymentPostprocessing = 0; … … 433 457 F506592F10B22EC800D0F1FE /* SapphireTVDirectory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SapphireTVDirectory.h; sourceTree = "<group>"; }; 434 458 F506593010B22EC800D0F1FE /* SapphireTVDirectory.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SapphireTVDirectory.m; sourceTree = "<group>"; }; 459 F50CCEE71119E3BD00213966 /* CommonMediaPlayer.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CommonMediaPlayer.xcodeproj; path = ../CommonMediaPlayer/CommonMediaPlayer.xcodeproj; sourceTree = SOURCE_ROOT; }; 435 460 F5185B400D1344D700712020 /* ExceptionHandling.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ExceptionHandling.framework; path = /System/Library/Frameworks/ExceptionHandling.framework; sourceTree = "<absolute>"; }; 436 461 F51BFD2D0D26BDF300E22363 /* SapphireCompatibilityClasses.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SapphireCompatibilityClasses.xcodeproj; path = ../SapphireCompatibilityClasses/SapphireCompatibilityClasses.xcodeproj; sourceTree = "<group>"; }; … … 494 519 F58C52210F13B18F00DE7A65 /* SapphireTextEntryController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SapphireTextEntryController.h; sourceTree = "<group>"; }; 495 520 F58C52220F13B18F00DE7A65 /* SapphireTextEntryController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SapphireTextEntryController.m; sourceTree = "<group>"; }; 521 F595C612111A679D00C6C322 /* SapphireCMPWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SapphireCMPWrapper.h; sourceTree = "<group>"; }; 522 F595C613111A679D00C6C322 /* SapphireCMPWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SapphireCMPWrapper.m; sourceTree = "<group>"; }; 496 523 F59BB9160DF43C3E00EC11A2 /* SapphireMetaDataUpgrading.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SapphireMetaDataUpgrading.h; sourceTree = "<group>"; }; 497 524 F59BB9170DF43C3E00EC11A2 /* SapphireMetaDataUpgrading.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SapphireMetaDataUpgrading.m; sourceTree = "<group>"; }; … … 747 774 19C28FB8FE9D52D311CA2CBB /* Products */, 748 775 F51BFD2D0D26BDF300E22363 /* SapphireCompatibilityClasses.xcodeproj */, 776 F50CCEE71119E3BD00213966 /* CommonMediaPlayer.xcodeproj */, 749 777 F532EC3B0E44FB8100DBEE13 /* main_debug.m */, 750 778 F5BA7E6E0EE336A900A5C679 /* main_rescanDir.m */, … … 843 871 sourceTree = "<group>"; 844 872 }; 873 F50CCEE81119E3BD00213966 /* Products */ = { 874 isa = PBXGroup; 875 children = ( 876 F50CCEEC1119E3BD00213966 /* CommonMediaPlayer.framework */, 877 F500272511235751001B52FE /* UIDebug */, 878 ); 879 name = Products; 880 sourceTree = "<group>"; 881 }; 845 882 F56B6D8F0C34713400E934AA /* Browser */ = { 846 883 isa = PBXGroup; … … 947 984 F5505DC51040864D0064D392 /* SapphireAudioNowPlayingController.h */, 948 985 F5505DC61040864D0064D392 /* SapphireAudioNowPlayingController.m */, 986 F595C612111A679D00C6C322 /* SapphireCMPWrapper.h */, 987 F595C613111A679D00C6C322 /* SapphireCMPWrapper.m */, 949 988 ); 950 989 path = Players; … … 1202 1241 F59FEEFC0ED85FE50052012E /* PBXTargetDependency */, 1203 1242 F54A38EC109F43B900DCC808 /* PBXTargetDependency */, 1243 F50CCEF21119E3EE00213966 /* PBXTargetDependency */, 1204 1244 ); 1205 1245 name = Sapphire; … … 1297 1337 projectReferences = ( 1298 1338 { 1339 ProductGroup = F50CCEE81119E3BD00213966 /* Products */; 1340 ProjectRef = F50CCEE71119E3BD00213966 /* CommonMediaPlayer.xcodeproj */; 1341 }, 1342 { 1299 1343 ProductGroup = F5EBE6D80D4A775400042BA0 /* Products */; 1300 1344 ProjectRef = F51BFD2D0D26BDF300E22363 /* SapphireCompatibilityClasses.xcodeproj */; … … 1316 1360 1317 1361 /* Begin PBXReferenceProxy section */ 1362 F500272511235751001B52FE /* UIDebug */ = { 1363 isa = PBXReferenceProxy; 1364 fileType = "compiled.mach-o.executable"; 1365 path = UIDebug; 1366 remoteRef = F500272411235751001B52FE /* PBXContainerItemProxy */; 1367 sourceTree = BUILT_PRODUCTS_DIR; 1368 }; 1369 F50CCEEC1119E3BD00213966 /* CommonMediaPlayer.framework */ = { 1370 isa = PBXReferenceProxy; 1371 fileType = wrapper.framework; 1372 path = CommonMediaPlayer.framework; 1373 remoteRef = F50CCEEB1119E3BD00213966 /* PBXContainerItemProxy */; 1374 sourceTree = BUILT_PRODUCTS_DIR; 1375 }; 1318 1376 F54A38E8109F43A600DCC808 /* SapphireTakeThreeCompatClasses.framework */ = { 1319 1377 isa = PBXReferenceProxy; … … 1535 1593 F5F515EA10DD8B21006B9DED /* SapphireSiteScraper.m in Sources */, 1536 1594 F542052810E6D1FE007B0D3A /* SapphireNfoImporter.m in Sources */, 1595 F595C614111A679D00C6C322 /* SapphireCMPWrapper.m in Sources */, 1537 1596 ); 1538 1597 runOnlyForDeploymentPostprocessing = 0; … … 1583 1642 target = F5B4186D0D0B29D800BDD361 /* Complete Sapphire */; 1584 1643 targetProxy = F5038FA60DE7AB600046C674 /* PBXContainerItemProxy */; 1644 }; 1645 F50CCEF21119E3EE00213966 /* PBXTargetDependency */ = { 1646 isa = PBXTargetDependency; 1647 name = CommonMediaPlayer; 1648 targetProxy = F50CCEF11119E3EE00213966 /* PBXContainerItemProxy */; 1585 1649 }; 1586 1650 F532EC480E44FBC900DBEE13 /* PBXTargetDependency */ = { … … 1732 1796 GCC_WARN_ABOUT_RETURN_TYPE = YES; 1733 1797 GCC_WARN_UNUSED_VARIABLE = YES; 1798 OTHER_CFLAGS = "-DDEBUG"; 1734 1799 PREBINDING = NO; 1735 1800 SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.4u.sdk"; … … 1835 1900 FRAMEWORK_SEARCH_PATHS = ( 1836 1901 "$(inherited)", 1837 "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\"", 1838 ); 1902 "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 1903 ); 1904 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\""; 1839 1905 GCC_DYNAMIC_NO_PIC = NO; 1840 1906 GCC_ENABLE_FIX_AND_CONTINUE = YES; … … 1842 1908 GCC_OPTIMIZATION_LEVEL = 0; 1843 1909 GCC_PRECOMPILE_PREFIX_HEADER = YES; 1844 GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";1910 GCC_PREFIX_HEADER = FRAppliance/Sapphire_Prefix.pch; 1845 1911 INSTALL_PATH = /usr/local/bin; 1912 LIBRARY_SEARCH_PATHS = ( 1913 "$(inherited)", 1914 "\"$(SRCROOT)/pcre\"", 1915 ); 1846 1916 OTHER_LDFLAGS = ( 1847 1917 "-undefined", … … 1884 1954 buildSettings = { 1885 1955 COPY_PHASE_STRIP = NO; 1956 FRAMEWORK_SEARCH_PATHS = ( 1957 "$(inherited)", 1958 "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 1959 ); 1960 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\""; 1886 1961 GCC_PRECOMPILE_PREFIX_HEADER = YES; 1887 GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";1962 GCC_PREFIX_HEADER = FRAppliance/Sapphire_Prefix.pch; 1888 1963 INSTALL_PATH = /usr/local/bin; 1964 LIBRARY_SEARCH_PATHS = ( 1965 "$(inherited)", 1966 "\"$(SRCROOT)/pcre\"", 1967 ); 1889 1968 OTHER_LDFLAGS = ( 1890 1969 "-framework", … … 1903 1982 buildSettings = { 1904 1983 COPY_PHASE_STRIP = YES; 1984 FRAMEWORK_SEARCH_PATHS = ( 1985 "$(inherited)", 1986 "$(FRAMEWORK_SEARCH_PATHS_QUOTED_1)", 1987 ); 1988 FRAMEWORK_SEARCH_PATHS_QUOTED_1 = "\"$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks\""; 1905 1989 GCC_PRECOMPILE_PREFIX_HEADER = YES; 1906 GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h";1990 GCC_PREFIX_HEADER = FRAppliance/Sapphire_Prefix.pch; 1907 1991 INSTALL_PATH = /usr/local/bin; 1992 LIBRARY_SEARCH_PATHS = ( 1993 "$(inherited)", 1994 "\"$(SRCROOT)/pcre\"", 1995 ); 1908 1996 OTHER_LDFLAGS = ( 1909 1997 "-framework", -
trunk/SapphireFrappliance/main_debug.m
r1049 r1179 43 43 #import "SapphireMovieDirectory.h" 44 44 45 //#define TESTING_UPGRADE 46 //#define LISTING_MOVIES 47 //#define TESTING_XML_IMPORT 48 //#define TESTING_FILE_SCANNING 49 //#define TESTING_UPDATED_VALUES 50 //#define TESTING_DIRECTORY_RESCAN 51 //#define TESTING_AUTO_PRUNING 52 #define TESTING_MOVIE_IMPORT 53 //#define TESTING_TV_SHOW_IMPORT 54 //#define TESTING_MULTIPLE_AND_SINGLE_TV_SHOW_IMPORT 55 //#define TESTING_MOVIE_VIRTUAL_DIRS_IN_XML 56 //#define TESTING_TV_IMPORT_THROUGH_XML 57 45 58 void overrideApplicationSupportdir(NSString *override); 46 59 … … 151 164 - (BOOL)canDisplayChooser 152 165 { 153 return NO;166 return YES; 154 167 } 155 168 … … 161 174 - (void)displayChooser:(BRLayerController <SapphireChooser> *)chooser forImporter:(id <SapphireImporter>)importer withContext:(id)context 162 175 { 176 [chooser itemSelected:1]; 177 [importer exhumedChooser:chooser withContext:context]; 163 178 } 164 179 … … 181 196 182 197 // overrideApplicationSupportdir([NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Frontrow"]); 183 //#define TESTING_UPGRADE184 198 #ifdef TESTING_UPGRADE 185 199 { … … 202 216 203 217 //Debug code goes here: 204 //#define LISTING_MOVIES205 218 #ifdef LISTING_MOVIES 206 219 { … … 218 231 } 219 232 #endif 220 //#define TESTING_XML_IMPORT221 233 #ifdef TESTING_XML_IMPORT 222 234 { … … 230 242 } 231 243 #endif 232 //#define TESTING_FILE_SCANNING233 244 #ifdef TESTING_FILE_SCANNING 234 245 { … … 246 257 } 247 258 #endif 248 //#define TESTING_UPDATED_VALUES249 259 #ifdef TESTING_UPDATED_VALUES 250 260 { … … 260 270 } 261 271 #endif 262 //#define TESTING_DIRECTORY_RESCAN263 272 #ifdef TESTING_DIRECTORY_RESCAN 264 273 { … … 271 280 } 272 281 #endif 273 //#define TESTING_AUTO_PRUNING274 282 #ifdef TESTING_AUTO_PRUNING 275 283 { … … 293 301 } 294 302 #endif 295 #define TESTING_MOVIE_IMPORT296 303 #ifdef TESTING_MOVIE_IMPORT 297 304 { 298 SapphireFileMetaData *file = [SapphireFileMetaData fileWithPath:@"/Users/gbooker/Movies/MovieTests/FIFTH_ELEMENT.mov" inContext:moc];305 SapphireFileMetaData *file = [SapphireFileMetaData createFileWithPath:@"/Users/gbooker/Movies/MovieTests/FIFTH_ELEMENT.mov" inContext:moc]; 299 306 SapphireMovieImporter *import = [[SapphireMovieImporter alloc] init]; 300 307 [file setToReimportFromMaskValue:IMPORT_TYPE_MOVIE_MASK]; 308 [file setToResetImportDecisions]; 301 309 [importManager importer:import importMetaData:file path:[file path]]; 302 310 [import release]; 303 311 } 304 312 #endif 305 //#define TESTING_TV_SHOW_IMPORT306 313 #ifdef TESTING_TV_SHOW_IMPORT 307 314 { 308 SapphireFileMetaData *file = [SapphireFileMetaData fileWithPath:@"/Users/gbooker/Movies/TVShowsTests/Doctor Who (2005) S03ES1 Voyage of the Damned.avi" inContext:moc];315 SapphireFileMetaData *file = [SapphireFileMetaData createFileWithPath:@"/Users/gbooker/Movies/TVShowsTests/Doctor Who (2005) S03ES1 Voyage of the Damned.avi" inContext:moc]; 309 316 SapphireTVShowImporter *import = [[SapphireTVShowImporter alloc] init]; 310 317 [file setToReimportFromMaskValue:IMPORT_TYPE_TVSHOW_MASK]; … … 313 320 } 314 321 #endif 315 //#define TESTING_MULTIPLE_AND_SINGLE_TV_SHOW_IMPORT316 322 #ifdef TESTING_MULTIPLE_AND_SINGLE_TV_SHOW_IMPORT 317 323 { … … 328 334 } 329 335 #endif 330 //#define TESTING_MOVIE_VIRTUAL_DIRS_IN_XML331 336 #ifdef TESTING_MOVIE_VIRTUAL_DIRS_IN_XML 332 337 { … … 337 342 } 338 343 #endif 339 //#define TESTING_TV_IMPORT_THROUGH_XML340 344 #ifdef TESTING_TV_IMPORT_THROUGH_XML 341 345 {
