Index: Check if the originals folder is empty before indexing #2299

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2022-08-01 17:08:46 +02:00
parent 197acbc802
commit eba9fd701b
9 changed files with 145 additions and 112 deletions

View File

@@ -84,7 +84,7 @@ func StartImport(router *gin.RouterGroup) {
imp.Start(opt)
if subPath != "" && path != conf.ImportPath() && fs.IsEmpty(path) {
if subPath != "" && path != conf.ImportPath() && fs.DirIsEmpty(path) {
if err := os.Remove(path); err != nil {
log.Errorf("import: failed deleting empty folder %s: %s", clean.Log(path), err)
} else {