fixes name of the filesystem entry

This commit is contained in:
Philipp Häfelfinger 2020-04-16 00:18:56 +02:00
parent a01acf20eb
commit 7c2d6f302b
2 changed files with 3 additions and 3 deletions

View File

@ -46,7 +46,7 @@ func Test_ScanLocalFileStructure_should_find_testfile_with_trimmed_folder(t *tes
} }
containsTestImage := false containsTestImage := false
containsFolder := true containsFolder := false
for _, img := range images { for _, img := range images {
if img.Name == "testimage.jpg" && img.Key == "root/testimage.jpg" && !img.IsDir { if img.Name == "testimage.jpg" && img.Key == "root/testimage.jpg" && !img.IsDir {
containsTestImage = true containsTestImage = true
@ -61,7 +61,7 @@ func Test_ScanLocalFileStructure_should_find_testfile_with_trimmed_folder(t *tes
t.Errorf("Did not find the expected testimage.") t.Errorf("Did not find the expected testimage.")
} }
if !containsFolder { if !containsFolder {
t.Errorf("Did not find the expected test folder.") t.Errorf("There should be a virtual 'root' folder present.")
} }
} }

View File

@ -82,7 +82,7 @@ func ScanLocalFileStructure(path string, extensions []string, ignoreDirs []strin
fileMap[path] = &FilesystemNode{ fileMap[path] = &FilesystemNode{
Key: key, Key: key,
Path: path, Path: path,
Name: info.Name(), Name: filepath.Base(key),
IsDir: info.IsDir(), IsDir: info.IsDir(),
ModTime: info.ModTime(), ModTime: info.ModTime(),
} }