From 9387ed13f8860e5d4192028590baa420fea97d92 Mon Sep 17 00:00:00 2001 From: Guillaume Date: Sun, 27 Jan 2019 16:07:20 +0100 Subject: [PATCH] [Scan] Skip directories prefixed with a dot (close #353). --- app/Lib/AudioFileScanner/AudioFileScanner.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Lib/AudioFileScanner/AudioFileScanner.php b/app/Lib/AudioFileScanner/AudioFileScanner.php index ffb99d5..dcdbe7d 100644 --- a/app/Lib/AudioFileScanner/AudioFileScanner.php +++ b/app/Lib/AudioFileScanner/AudioFileScanner.php @@ -56,7 +56,8 @@ public function scan($new = true, $orphans = false, $outdated = false, $batch = $directory = new Folder($directory); // Skip symlinks to avoid infinite loops - if (is_link($directory->path)) { + // Skip dotfiles to avoid scanning "hidden" directories + if (is_link($directory->path) || preg_match('/^.*\/\..*$/', $directory->path) === 1) { continue; }