mirror of
https://github.com/storytold/lightcraft.git
synced 2026-10-30 04:57:22 -06:00
Windows: treat separator-only path differences as the same file
Catalog paths may mix `/` and `\` on Windows, so raw string comparison saw `N:/photos/IMG.jpg` and `N:/photos\IMG.jpg` as different files: - Rename: planning, the move list, move_file_with and file_moves now compare as paths. A separator-only "rename" is a no-op: no file move, no catalog change and no undo entry, alone or batched with a genuine rename. Previously it attempted a plain rename onto the existing file, failed, and rolled back the rest of the batch. Case-only renames still work (#95). - Import: the already-in-library index is keyed by PathBuf. - Tests build expected paths with Path::join, and the CLI test escapes the device path with serde_json instead of string formatting. Split from a327b98 (T0 thumbnail work), with the follow-up rename fix that the committed version needed. Co-authored-by: Codex <noreply@openai.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Codex
Claude Opus 5.5
parent
ee9a989834
commit
928c2c974f
@@ -292,7 +292,7 @@ fn devices_are_listed_and_imported_from() {
|
||||
assert_eq!(dev["name"], "CARD", "{line}");
|
||||
// the import review of its DCIM folder finds the photo
|
||||
let dcim = dev["path"].as_str().unwrap().to_string();
|
||||
let o = Command::new(BIN).args(["run", "library.importPreview", &format!("paths=[\"{dcim}\"]")]).output().unwrap();
|
||||
let o = Command::new(BIN).args(["run", "library.importPreview", &format!("paths={}", serde_json::json!([dcim]))]).output().unwrap();
|
||||
let line: Value = serde_json::from_slice(o.stdout.split(|b| *b == b'\n').next().unwrap()).unwrap();
|
||||
assert_eq!(line["result"]["candidates"].as_array().map(Vec::len), Some(1), "{line}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user