Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat symlinks to directories like directories #443

Merged
merged 1 commit into from Jul 21, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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