Fix clean and scan bugs (#846)

This commit is contained in:
InfiniteTF
2020-10-14 01:51:36 +02:00
committed by GitHub
parent 12cba97192
commit 482f8cbd92
2 changed files with 7 additions and 1 deletions

View File

@@ -45,10 +45,11 @@ func CalculateMD5(path string) (string, error) {
} }
func FileExists(path string) bool { func FileExists(path string) bool {
_, err := openSourceImage(path) f, err := openSourceImage(path)
if err != nil { if err != nil {
return false return false
} }
defer f.Close()
return true return true
} }

View File

@@ -656,6 +656,11 @@ func walkFilesToScan(s *models.StashConfig, f filepath.WalkFunc) error {
excludeImg := config.GetImageExcludes() excludeImg := config.GetImageExcludes()
return symwalk.Walk(s.Path, func(path string, info os.FileInfo, err error) error { return symwalk.Walk(s.Path, func(path string, info os.FileInfo, err error) error {
if err != nil {
logger.Warnf("error scanning %s: %s", path, err.Error())
return nil
}
if info.IsDir() { if info.IsDir() {
return nil return nil
} }