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 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BKWB9TCnvzJHV6xMLAj2J4
This commit is contained in:
Claude committed 2026-10-11 12:04:23 +00:00
1 parent 8c4898ec04
commit b04c2c831c
1 file changed
+4 -1
+4 -1
View File
@@ -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