Drop file extension before performing string match

- Fixes #107851156
This commit is contained in:
John Lewin 2015-11-10 13:00:54 -08:00
parent 9a77adc853
commit beffdda91e

View file

@ -249,8 +249,8 @@ namespace MatterHackers.MatterControl.PrintLibrary.Provider
var existingLibaryItems = this.GetLibraryItems().Select(i => i.Name);
// Build a list of files that need to be imported into the library
var missingFiles = filenamesToValidate.Where(fileName => !existingLibaryItems.Contains(fileName, StringComparer.OrdinalIgnoreCase));
// Drop extensions and build a list of files that need to be imported into the library
var missingFiles = filenamesToValidate.Select(f => Path.GetFileNameWithoutExtension(f)).Where(fileName => !existingLibaryItems.Contains(fileName, StringComparer.OrdinalIgnoreCase));
// Create temp files on disk that can be imported into the library
var tempFilesToImport = missingFiles.Select(fileName =>