Index: SapphireFrappliance/SapphireMovieImporter.m
===================================================================
--- SapphireFrappliance/SapphireMovieImporter.m	(Revision 490)
+++ SapphireFrappliance/SapphireMovieImporter.m	(Arbeitskopie)
@@ -26,6 +26,7 @@
 #import "SapphirePosterChooser.h"
 #import <SapphireCompatClasses/SapphireFrontRowCompat.h>
 #import "SapphireShowChooser.h"
+#import "SapphireSettings.h"
 
 #define VERSION_KEY					@"Version"
 #define CURRENT_VERSION				2
@@ -663,9 +664,14 @@
 	/*Get path*/
 	if(![self isMovieCandidate:metaData])
 		return IMPORT_STATE_NOT_UPDATED;
-	/*Get fineName*/
 	NSString *path = [metaData path];
 	NSString *fileName = [path lastPathComponent];
+	/*choose between file or directory name for lookup */
+	NSString *lookupName;
+	if([[SapphireSettings sharedSettings] dirLookup])
+		lookupName = [[path stringByDeletingLastPathComponent] lastPathComponent];
+	else
+		lookupName = fileName;
 	if([metaData fileClass]==FILE_CLASS_TV_SHOW) /* File is a TV Show - skip it */
 		return IMPORT_STATE_NOT_UPDATED;
 	
@@ -679,7 +685,7 @@
 		/*There is no data menu, background import. So we can't ask user, skip*/
 			return IMPORT_STATE_NOT_UPDATED;
 		/*Ask the user what movie this is*/
-		NSArray *movies = [self searchResultsForMovie:fileName];
+		NSArray *movies = [self searchResultsForMovie:lookupName];
 		/* No need to prompt the user for an empty set */
 		if(movies==nil)
 		{
Index: SapphireFrappliance/SapphireSettings.h
===================================================================
--- SapphireFrappliance/SapphireSettings.h	(Revision 490)
+++ SapphireFrappliance/SapphireSettings.h	(Arbeitskopie)
@@ -142,6 +142,13 @@
 - (BOOL)fastSwitching;
 
 /*!
+ * @brief Returns whether to use directory based lookup
+ *
+ * @return YES if set, NO otherwise
+ */
+- (BOOL)dirLookup;
+
+/*!
  * @brief Returns the index of the last predicate used
  *
  * @return The index of the last predicate used
Index: SapphireFrappliance/SapphireSettings.m
===================================================================
--- SapphireFrappliance/SapphireSettings.m	(Revision 490)
+++ SapphireFrappliance/SapphireSettings.m	(Arbeitskopie)
@@ -50,6 +50,7 @@
 #define HIDE_UI_QUIT_KEY			@"HideUIQuit"
 #define	ENABLE_FAST_SWITCHING_KEY	@"EnableFastSwitching"
 #define USE_AC3_PASSTHROUGH			@"EnableAC3Passthrough"
+#define ENABLE_DIR_LOOKUP			@"EnableDirLookup"
 #define	DISABLE_ANON_KEY			@"DisableAnonymousReporting"
 #define LAST_PREDICATE				@"LastPredicate"
 
@@ -89,6 +90,7 @@
 												BRLocalizedString(@"  Hide UI Quit", @"Hide the ui quitter menu item"),
 												BRLocalizedString(@"  Fast Directory Switching", @"Don't rescan directories upon entry and used cached data"),
 												BRLocalizedString(@"  Enable AC3 Passthrough", @"Enable AC3 Passthrough menu item"),
+												BRLocalizedString(@"  Use Directory Lookup", @"Use directory names instead of filename for movie lookup"),
 												BRLocalizedString(@"  Disable Anonymous Reporting", @"Disable the anonymous reporting for aid in future features"), nil];
 	
 	settingDescriptions=[[NSArray alloc] initWithObjects:
@@ -108,6 +110,7 @@
 												BRLocalizedString(@"Tells Sapphire to hide the main menu element forcing frontrow to quit.", @"Hide the ui quitter description"),
 												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"),
 												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"),
+												BRLocalizedString(@"Tells Sapphire that you want to use directory instead of filenames for movie lookup", @"Enable Directory lookup description"),
 												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];
 		
 	keys = [[NSArray alloc] initWithObjects:		@"",
@@ -126,6 +129,7 @@
 													HIDE_UI_QUIT_KEY,
 													ENABLE_FAST_SWITCHING_KEY,
 													USE_AC3_PASSTHROUGH,
+													ENABLE_DIR_LOOKUP,
 													DISABLE_ANON_KEY, nil];
 	SapphireTheme *theme = [SapphireTheme sharedTheme];
 	gems = [[NSArray alloc] initWithObjects:	[theme gem:IMPORT_GEM_KEY],
@@ -144,6 +148,7 @@
 												[theme gem:FRONTROW_GEM_KEY],
 												[theme gem:FAST_GEM_KEY],
 												[theme gem:AC3_GEM_KEY],
+												[theme gem:IMDB_GEM_KEY],
 												[theme gem:REPORT_GEM_KEY], nil];		
 	
 	path = [dictionaryPath retain];
@@ -160,6 +165,7 @@
 		[NSNumber numberWithBool:YES], HIDE_UI_QUIT_KEY,
 		[NSNumber numberWithBool:YES], ENABLE_FAST_SWITCHING_KEY,
 		[NSNumber numberWithBool:NO], USE_AC3_PASSTHROUGH,
+		[NSNumber numberWithBool:NO], ENABLE_DIR_LOOKUP,
 		[NSNumber numberWithBool:NO], DISABLE_ANON_KEY,
 		[NSNumber numberWithInt:NSNotFound], LAST_PREDICATE,
 		nil];
@@ -283,6 +289,12 @@
 
 }
 
+- (BOOL)dirLookup
+{
+	return [self boolForKey:ENABLE_DIR_LOOKUP];
+	
+}
+
 - (int)indexOfLastPredicate
 {
 	return [[self numberForKey:LAST_PREDICATE] intValue];

