1
Fork 0

Merge pull request #443 from hupfdule/more-symlinks

Treat symlinks to directories like directories
This commit is contained in:
Viktor Strate Kløvedal 2021-07-21 15:13:17 +02:00 committed by GitHub
commit 8fd81288d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -256,7 +256,14 @@ func directoryContainsPhotos(rootPath string, cache *scanner_cache.AlbumScannerC
for _, fileInfo := range dirContent { for _, fileInfo := range dirContent {
filePath := path.Join(dirPath, fileInfo.Name()) filePath := path.Join(dirPath, fileInfo.Name())
if fileInfo.IsDir() {
isDirSymlink, err := utils.IsDirSymlink(filePath)
if err != nil {
log.Printf("Cannot detect whether %s is symlink to a directory. Pretending it is not", filePath)
isDirSymlink = false
}
if fileInfo.IsDir() || isDirSymlink {
scanQueue.PushBack(filePath) scanQueue.PushBack(filePath)
} else { } else {
if cache.IsPathMedia(filePath) { if cache.IsPathMedia(filePath) {