From e3e3aaa47590115e4720dfd3479003ff6681d4d6 Mon Sep 17 00:00:00 2001 From: Ryan Date: Sat, 4 Oct 2025 03:35:39 -0400 Subject: [PATCH] chore(scanner): skip profile_pics subtree during scans --- CHANGELOG.md | 3 +++ scripts/scan_uploads.php | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b11fc..f78e789 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ fix(scanner): resolve dirs via CLI/env/constants; write per-item JSON; skip trash fix(scanner): rebuild per-folder metadata to match File/Folder models +chore(scanner): skip profile_pics subtree during scans - scan_uploads.php now falls back to UPLOAD_DIR/META_DIR from config.php - prevents double slashes in metadata paths; respects app timezone @@ -14,6 +15,8 @@ fix(scanner): rebuild per-folder metadata to match File/Folder models - Skips uploads/trash and symlinks - Resolves paths from CLI flags, env vars, or config constants (UPLOAD_DIR/META_DIR) - Idempotent; safe to run at startup via SCAN_ON_START +- Avoids indexing internal avatar images (folder already hidden in UI) +- Reduces scan noise and metadata churn; keeps firmware/other content indexed ## Changes 10/4/2025 v1.3.12 diff --git a/scripts/scan_uploads.php b/scripts/scan_uploads.php index 5e6ee85..45bdb36 100644 --- a/scripts/scan_uploads.php +++ b/scripts/scan_uploads.php @@ -58,8 +58,9 @@ function list_all_folders(string $root): array { // relative key like "foo/bar" $rel = ltrim(str_replace(['\\'], '/', substr($path, strlen($root) + 1)), '/'); if ($rel === '') continue; - // skip trash subtree - if (strpos($rel, 'trash/') === 0 || $rel === 'trash') continue; + // skip trash and profile_pics subtrees + if ($rel === 'trash' || strpos($rel, 'trash/') === 0) continue; + if ($rel === 'profile_pics' || strpos($rel, 'profile_pics/') === 0) continue; // obey the app’s folder-name regex to stay consistent if (preg_match(REGEX_FOLDER_NAME, basename($rel))) { $folders[] = $rel;