From 791cb8a7d1055423b4418f0912964db49d2d69f9 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 18 Apr 2026 09:53:51 -0400 Subject: [PATCH] fix: normalize rel_path separators in non-recursive /photos listing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, strip_prefix preserves backslashes, so the non-recursive branch was looking up tags for 'Melissa\img1.jpg' while tagged_photo stores 'Melissa/img1.jpg' — every file was filtered out. Normalize to '/' to match the watcher and populate_knowledge. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/files.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/files.rs b/src/files.rs index 11ad898..50d5c93 100644 --- a/src/files.rs +++ b/src/files.rs @@ -568,7 +568,14 @@ pub async fn list_photos( path.display() ) }); - let relative_str = relative.to_str().unwrap().to_string(); + // Normalize separators to '/' so downstream + // lookups (tags, EXIF, insights) that store + // rel_paths with forward slashes still match + // on Windows. + let relative_str = relative + .to_str() + .unwrap() + .replace('\\', "/"); if md.is_file() { files.push(relative_str); @@ -589,7 +596,7 @@ pub async fn list_photos( path.display() ) }); - files.push(relative.to_str().unwrap().to_string()); + files.push(relative.to_str().unwrap().replace('\\', "/")); } } }