Skip to content

Commit

Permalink
Treat symlinks to directories like directories
Browse files Browse the repository at this point in the history
 It seems that the first try was not enough. Now symlinks should be
 detected in all cases.
  • Loading branch information
hupfdule committed Jul 20, 2021
1 parent 0587a7b commit fe9e275
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion api/scanner/scanner_user.go
Expand Up @@ -256,7 +256,14 @@ func directoryContainsPhotos(rootPath string, cache *scanner_cache.AlbumScannerC

for _, fileInfo := range dirContent {
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)
} else {
if cache.IsPathMedia(filePath) {
Expand Down

0 comments on commit fe9e275

Please sign in to comment.