mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-14 19:27:01 -04:00
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:
1 file changed
+4
-1
@@ -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
|
||||
|
||||
Reference in new issue
Block a user