Changeset 491
- Timestamp:
- 02/14/2008 08:51:37 PM (4 years ago)
- Location:
- trunk/SapphireFrappliance
- Files:
-
- 3 modified
-
SapphireMovieImporter.m (modified) (6 diffs)
-
SapphireSettings.h (modified) (1 diff)
-
SapphireSettings.m (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/SapphireFrappliance/SapphireMovieImporter.m
r488 r491 27 27 #import <SapphireCompatClasses/SapphireFrontRowCompat.h> 28 28 #import "SapphireShowChooser.h" 29 #import "SapphireSettings.h" 29 30 30 31 #define VERSION_KEY @"Version" … … 664 665 if(![self isMovieCandidate:metaData]) 665 666 return IMPORT_STATE_NOT_UPDATED; 666 /*Get fineName*/667 667 NSString *path = [metaData path]; 668 668 NSString *fileName = [path lastPathComponent]; 669 /*choose between file or directory name for lookup */ 670 NSString *lookupName; 671 if([[SapphireSettings sharedSettings] dirLookup]) 672 lookupName = [[path stringByDeletingLastPathComponent] lastPathComponent]; 673 else 674 lookupName = fileName; 669 675 if([metaData fileClass]==FILE_CLASS_TV_SHOW) /* File is a TV Show - skip it */ 670 676 return IMPORT_STATE_NOT_UPDATED; … … 673 679 NSString *movieDataLink = nil ; 674 680 /*Check to see if we know this movie*/ 675 NSMutableDictionary *dict=[movieTranslations objectForKey:[[ fileName lowercaseString] stringByDeletingPathExtension]];681 NSMutableDictionary *dict=[movieTranslations objectForKey:[[lookupName lowercaseString] stringByDeletingPathExtension]]; 676 682 if(dict == nil) 677 683 { … … 680 686 return IMPORT_STATE_NOT_UPDATED; 681 687 /*Ask the user what movie this is*/ 682 NSArray *movies = [self searchResultsForMovie: fileName];688 NSArray *movies = [self searchResultsForMovie:lookupName]; 683 689 /* No need to prompt the user for an empty set */ 684 690 if(movies==nil) … … 692 698 SapphireMovieChooser *chooser = [[SapphireMovieChooser alloc] initWithScene:[dataMenu scene]]; 693 699 [chooser setMovies:movies]; 694 [chooser setFileName: fileName];700 [chooser setFileName:lookupName]; 695 701 [chooser setListTitle:BRLocalizedString(@"Select Movie Title", @"Prompt the user for title of movie")]; 696 702 /*And display prompt*/ … … 751 757 [self downloadPosterCandidates:posters]; 752 758 [posterChooser setPosters:posters] ; 753 [posterChooser setFileName: fileName];759 [posterChooser setFileName:lookupName]; 754 760 [posterChooser setListTitle:BRLocalizedString(@"Select Movie Poster", @"Prompt the user for poster selection")]; 755 761 [[dataMenu stack] pushController:posterChooser]; -
trunk/SapphireFrappliance/SapphireSettings.h
r470 r491 143 143 144 144 /*! 145 * @brief Returns whether to use directory based lookup 146 * 147 * @return YES if set, NO otherwise 148 */ 149 - (BOOL)dirLookup; 150 151 /*! 145 152 * @brief Returns the index of the last predicate used 146 153 * -
trunk/SapphireFrappliance/SapphireSettings.m
r482 r491 51 51 #define ENABLE_FAST_SWITCHING_KEY @"EnableFastSwitching" 52 52 #define USE_AC3_PASSTHROUGH @"EnableAC3Passthrough" 53 #define ENABLE_DIR_LOOKUP @"EnableDirLookup" 53 54 #define DISABLE_ANON_KEY @"DisableAnonymousReporting" 54 55 #define LAST_PREDICATE @"LastPredicate" … … 90 91 BRLocalizedString(@" Fast Directory Switching", @"Don't rescan directories upon entry and used cached data"), 91 92 BRLocalizedString(@" Enable AC3 Passthrough", @"Enable AC3 Passthrough menu item"), 93 BRLocalizedString(@" Use Directory Lookup", @"Use directory names instead of filename for movie lookup"), 92 94 BRLocalizedString(@" Disable Anonymous Reporting", @"Disable the anonymous reporting for aid in future features"), nil]; 93 95 … … 109 111 BRLocalizedString(@"Tells Sapphire that when using a filter, use the cached data to setup directories rather than scanning the directories themselves for new files.", @"Fast Directory Switching description"), 110 112 BRLocalizedString(@"Tells Sapphire that you have an AC3 decoder and to enable passthrough of the full audio information to the decoder. This is how you get 5.1 output.", @"Enable AC3 Passthrough description"), 113 BRLocalizedString(@"Tells Sapphire that you want to use directory instead of filenames for movie lookup", @"Enable Directory lookup description"), 111 114 BRLocalizedString(@"Tells Sapphire to not report any anonymous information on how you use Sapphire. Anonymous reporting enables us to improve the plugin for future use.", @"Disable the anonymous reporting description"), nil]; 112 115 … … 127 130 ENABLE_FAST_SWITCHING_KEY, 128 131 USE_AC3_PASSTHROUGH, 132 ENABLE_DIR_LOOKUP, 129 133 DISABLE_ANON_KEY, nil]; 130 134 SapphireTheme *theme = [SapphireTheme sharedTheme]; … … 145 149 [theme gem:FAST_GEM_KEY], 146 150 [theme gem:AC3_GEM_KEY], 151 [theme gem:IMDB_GEM_KEY], 147 152 [theme gem:REPORT_GEM_KEY], nil]; 148 153 … … 161 166 [NSNumber numberWithBool:YES], ENABLE_FAST_SWITCHING_KEY, 162 167 [NSNumber numberWithBool:NO], USE_AC3_PASSTHROUGH, 168 [NSNumber numberWithBool:NO], ENABLE_DIR_LOOKUP, 163 169 [NSNumber numberWithBool:NO], DISABLE_ANON_KEY, 164 170 [NSNumber numberWithInt:NSNotFound], LAST_PREDICATE, … … 282 288 return [self boolForKey:ENABLE_FAST_SWITCHING_KEY]; 283 289 290 } 291 292 - (BOOL)dirLookup 293 { 294 return [self boolForKey:ENABLE_DIR_LOOKUP]; 295 284 296 } 285 297
