From b04c2c831c743ad7c26fbd61a9cfeea83828af94 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 11 Oct 2026 12:04:23 +0000 Subject: [PATCH] LR-CLOUD-SMARTPREVIEW: the shard folder name is taken with get(), not a slice (follow-up to #834) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BKWB9TCnvzJHV6xMLAj2J4 --- crates/engine/src/smart.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/smart.rs b/crates/engine/src/smart.rs index 532454a1a..b607d84d8 100644 --- a/crates/engine/src/smart.rs +++ b/crates/engine/src/smart.rs @@ -25,7 +25,10 @@ pub fn file_name(p: &Photo) -> String { /// folder to about 1/256 of the library's smart previews. pub fn sharded_file_path(dir: &Path, p: &Photo) -> PathBuf { let name = file_name(p); - dir.join(&name[..2]).join(name) + match name.get(..2) { + Some(shard) => dir.join(shard).join(&name), + None => dir.join(&name), + } } /// Read an existing proxy in either layout. New proxies use the sharded location; previews