Remove tracks from DB that were deleted while Navidrome was not running. Fixes #151

This commit is contained in:
Deluan
2020-06-12 13:26:46 -04:00
committed by Deluan Quintão
parent 01919661e9
commit e73b71aaf7
5 changed files with 71 additions and 11 deletions
+18
View File
@@ -0,0 +1,18 @@
package utils
import (
"os"
"github.com/deluan/navidrome/log"
)
func IsDirReadable(path string) (bool, error) {
dir, err := os.Open(path)
if err != nil {
return false, err
}
if err := dir.Close(); err != nil {
log.Error("Error closing directory", "path", path, err)
}
return true, nil
}