From b6b4662dc854b9c15d885e0412b1a46f921fd97b Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Fri, 30 Oct 2026 23:10:29 -0500 Subject: [PATCH 01/22] fix(lightroom): a content duplicate keeps what its XMP sidecar says (#2589) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A content duplicate's new record took its file's metadata and capture time but not its XMP sidecar: a file import merges the sidecar (caption, copyright, rating, develop…), so a field only the sidecar states was lost whenever the catalog's XMP didn't restate it. The import never read a duplicate's sidecar: the batch's sidecar lookup (#2954) passed over every file whose content the library has, the planning loop skipped the read when the file has a capture time, and revalidate_add dropped the parsed sidecar. A duplicate's sidecar is now looked up and read as any file's (in the same batched lookup), FileFacts carries it, and one function (`start_from_file`: the file's metadata and capture time, the import defaults, then the sidecar) starts both a file import's record and the Lightroom duplicate's; the catalog's metadata and settings still apply on top. FileFacts also carries the file's own orientation, so #2674's rule (the file's orientation, when it states one, turns the sidecar's stored-frame regions upright) holds for both, after the empty-sidecar check: an orientation alone is not a sidecar that said something. Test: a content duplicate whose file has a capture time and whose sidecar states a caption and copyright keeps both through the Lightroom job. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/import.rs | 1 + crates/engine/src/import/commit.rs | 31 ++++++++++----- crates/engine/src/import/job.rs | 27 ++++--------- crates/engine/src/import/types.rs | 5 +++ crates/engine/src/lightroom_catalog.rs | 36 +++++++++-------- crates/engine/src/lightroom_catalog/tests.rs | 42 ++++++++++++++++++++ 6 files changed, 96 insertions(+), 46 deletions(-) diff --git a/crates/engine/src/import.rs b/crates/engine/src/import.rs index 96ce93d0c17..fda577f0c06 100644 --- a/crates/engine/src/import.rs +++ b/crates/engine/src/import.rs @@ -42,6 +42,7 @@ mod job; mod scan; mod types; +pub(crate) use commit::start_from_file; #[cfg(not(target_arch = "wasm32"))] pub(crate) use commit::workers; pub use commit::{batch_size, civil, commit_prepared, system_clock}; diff --git a/crates/engine/src/import/commit.rs b/crates/engine/src/import/commit.rs index 016ce013932..1a142972497 100644 --- a/crates/engine/src/import/commit.rs +++ b/crates/engine/src/import/commit.rs @@ -1,7 +1,7 @@ use super::defaults::apply_import_defaults; use super::files::copy_into; use super::job::{Prepared, PreparedItem, ReadyFile}; -use super::types::{Duplicate, ImportOptions, ImportReport, Kept, Moved, OnDeleted}; +use super::types::{Duplicate, FileFacts, ImportOptions, ImportReport, Kept, Moved, OnDeleted}; use super::{HashMap, Op, Path, PathBuf, Photo, PhotoId, ProbeInfo, Session, Source}; /// A batch's items in file order while its transfers are pending ([`ImportJob::run_plan`]). @@ -181,6 +181,22 @@ fn trashed_file_is_gone(cat: &lightcraft_catalog::Catalog, id: PhotoId) -> bool } } +/// What a new record takes from its file, as a file import gives it: the file's metadata and +/// capture time, the import defaults, then its XMP sidecar. Returns the sidecar when it said +/// anything (labels read through the library's label names). +pub(crate) fn start_from_file(s: &Session, p: &mut Photo, file: FileFacts, now: &str) -> Option { + let FileFacts { meta, captured, orientation, sidecar } = file; + p.meta = meta; + p.captured = captured; + apply_import_defaults(s, p); + let sc = sidecar.map(|sc| sc.resolve_label(&s.catalog)).filter(|sc| *sc != crate::sidecar::SidecarData::default())?; + // the photo is upright as the file's own orientation turns it, when the file states one + // (after the check above: an orientation alone isn't a sidecar that said something) + let sc = crate::sidecar::SidecarData { orientation: orientation.or(sc.orientation), ..sc }; + crate::sidecar::merge_into(p, &sc, now); + Some(sc) +} + /// The catalog half of an import: add the photos [`ImportJob::prepare`] readied (one undoable op; /// a Move's sources are removed once it is saved). On a failed commit a Move's placed files are /// taken back. @@ -252,25 +268,20 @@ pub fn commit_prepared(s: &mut Session, opts: &ImportOptions, now: &str, prepare purge.push(*old); } } - let sidecar = sidecar.map(|sc| sc.resolve_label(&s.catalog)).filter(|sc| *sc != crate::sidecar::SidecarData::default()); - // the photo is upright as the file's own orientation turns it, when the file states one - let sidecar = sidecar.map(|sc| crate::sidecar::SidecarData { orientation: info.orientation.or(sc.orientation), ..sc }); // a copy is catalogued under its new name let name = Path::new(&stored).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| path.clone()); let mut p = Photo::new(id, Source::File { path: stored }, &name, &info.format, info.width, info.height, &now); p.kind = info.kind; p.file_size = info.file_size; - p.captured = info.captured; - p.meta = info.meta; p.as_shot_wb = info.as_shot_wb; p.content_hash = info.content_hash; p.embedded_lens = info.embedded_lens; p.set_preview_only(info.preview_only.clone()); - apply_import_defaults(s, &mut p); - if let Some(sc) = &sidecar { - crate::sidecar::merge_into(&mut p, sc, &now); + if let Some(sc) = + start_from_file(s, &mut p, FileFacts { meta: info.meta, captured: info.captured, orientation: info.orientation, sidecar }, &now) + { report.sidecars += 1; - report.warnings.extend(sc.warnings.iter().cloned().map(|mut warning| { + report.warnings.extend(sc.warnings.into_iter().map(|mut warning| { warning.path = path.clone(); warning })); diff --git a/crates/engine/src/import/job.rs b/crates/engine/src/import/job.rs index ca906c61922..4c120acc19a 100644 --- a/crates/engine/src/import/job.rs +++ b/crates/engine/src/import/job.rs @@ -144,7 +144,7 @@ impl Prepared { existing: Some(existing), reason: if existing_path.is_some() { "path" } else { "content" }, hash: info.content_hash, - file: Some(Box::new(FileFacts { meta: info.meta, captured: info.captured })), + file: Some(Box::new(FileFacts { meta: info.meta, captured: info.captured, orientation: info.orientation, sidecar })), }); } else { items.push(PreparedItem::Ready(Box::new(ReadyFile { path, stored, info, sidecar, placed }))); @@ -298,17 +298,10 @@ impl ImportJob { // The sidecar of every file that was probed, looked up for the batch at once: each is a few // names asked of the disk, which on a network share made a folder of thousands of photos wait // a round trip per name, one name after another. + // (a file whose content the library has is read too: a Lightroom import makes it a new record + // from its file and sidecar, #2589) let asked: Vec<&str> = todo.iter().zip(&probed).filter(|(_, p)| p.is_ok()).map(|(f, _)| f.as_str()).collect(); - // (a file whose content the library has is skipped below as a duplicate: it asks the disk nothing) - let known: std::collections::HashSet<&str> = todo - .iter() - .zip(&probed) - .filter(|(_, p)| !opts.local && p.as_ref().is_ok_and(|i| i.content_hash.as_ref().is_some_and(|h| self.by_hash.contains_key(h)))) - .map(|(f, _)| f.as_str()) - .collect(); - let mut found = - sidecars_of(&asked, cancel, |f| if known.contains(f) { None } else { crate::sidecar::find_sidecar_for_import(&stems, self.naming, f) }) - .into_iter(); + let mut found = sidecars_of(&asked, cancel, |f| crate::sidecar::find_sidecar_for_import(&stems, self.naming, f)).into_iter(); // Files are planned one by one, in order (duplicates, sidecars, names, folders); their // copies or moves — the slow part, reading and writing every byte and verifying it — are // collected and run on several threads (issue #367), then their outcomes take their places. @@ -338,17 +331,13 @@ impl ImportJob { break; } } - // same bytes as a library photo: skipped below, once its capture time is known + // same bytes as a library photo: skipped below, once it is read as a file import reads it let duplicate_of = info.content_hash.as_ref().filter(|_| !opts.local).and_then(|h| self.by_hash.get(h).map(|existing| (h.clone(), *existing))); // the XMP sidecar (or a raw's embedded XMP), read before copying: its capture time files - // and names the copy when the file itself has none (a duplicate needs only that time) + // and names the copy when the file itself has none let raw = info.kind == MediaKind::Raw; - let packet = if duplicate_of.is_some() && info.captured.is_some() { - None - } else { - found_sidecar.and_then(|f| std::fs::read_to_string(f).ok()).or_else(|| info.xmp.clone().filter(|_| raw)) - }; + let packet = found_sidecar.and_then(|f| std::fs::read_to_string(f).ok()).or_else(|| info.xmp.clone().filter(|_| raw)); let target = crate::crs::Target::for_file(info.kind, &info.format, info.preview_only.is_some(), &info.meta.camera); let sidecar = packet.and_then(|x| match crate::sidecar::parse_sidecar(&x, target) { Ok(sc) => Some(sc), @@ -371,7 +360,7 @@ impl ImportJob { existing, reason: "content", hash: Some(hash), - file: Some(Box::new(FileFacts { meta: info.meta, captured: info.captured })), + file: Some(Box::new(FileFacts { meta: info.meta, captured: info.captured, orientation: info.orientation, sidecar })), })); continue; } diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index aab839931bc..29641105840 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -171,6 +171,11 @@ pub struct FileFacts { /// The capture time a file import gives it: the file's, else its XMP sidecar's, else the /// file's modification time. pub captured: Option, + /// The file's own orientation, when it states one ([`crate::media::ProbeInfo::orientation`]): it turns what its + /// sidecar's regions were drawn on, the photo as stored, upright (#2674). + pub orientation: Option, + /// Its XMP sidecar (or a raw's embedded XMP), which a file import merges into the record. + pub sidecar: Option, } #[derive(Clone, Debug, Default, Serialize)] diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 9a84b37ddbe..bd8057cf3f7 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -1302,8 +1302,8 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // The new record takes only what the bytes determine from the photo with the same // bytes, never that photo's own state: not its Recently Deleted (#2589), virtual copy, // edits, history, versions, ratings, capture time or the metadata a person writes. Its - // metadata and capture time are what its own file gives it, as a file import reads them - // (copyright, creator…); the catalog's capture time, when it has one, applies on top. + // metadata and capture time are what its own file and XMP sidecar give it, as a file + // import reads them (copyright, caption, creator…); the catalog's apply on top. let name = Path::new(&src.path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| src.path.clone()); let mut p = Photo::new( s.catalog.alloc_photo_id(), @@ -1322,25 +1322,27 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co p.embedded_lens = duplicate.embedded_lens; p.preview_only = duplicate.preview_only.clone(); p.preview_checked = duplicate.preview_checked.clone(); - if let Some(file) = file { - p.meta = file.meta.clone(); - p.captured = file.captured.clone(); - } else { + let file = file.cloned().unwrap_or_else(|| { // (the file wasn't read: only the exposure description, which no command edits; // not GPS, which placing a photo on the map does, nor the capture time, which // Edit Capture Time does) let m = &duplicate.meta; - p.meta.camera = m.camera.clone(); - p.meta.lens = m.lens.clone(); - p.meta.focal_mm = m.focal_mm; - p.meta.aperture = m.aperture; - p.meta.shutter = m.shutter.clone(); - p.meta.iso = m.iso; - p.meta.focus = m.focus.clone(); - } - // the settings a file import gives it (as-shot white balance, embedded lens - // corrections, the default preset); the catalog's settings apply on top - crate::import::apply_import_defaults(s, &mut p); + let meta = lightcraft_catalog::Meta { + camera: m.camera.clone(), + lens: m.lens.clone(), + focal_mm: m.focal_mm, + aperture: m.aperture, + shutter: m.shutter.clone(), + iso: m.iso, + focus: m.focus.clone(), + ..Default::default() + }; + crate::import::FileFacts { meta, ..Default::default() } + }); + // as a file import of it: its file's metadata and capture time, the import defaults + // (as-shot white balance, embedded lens corrections, the default preset), its XMP + // sidecar; the catalog's settings and metadata apply on top + crate::import::start_from_file(s, &mut p, file, &now); p } else { let id = s.catalog.alloc_photo_id(); diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index 837db27c906..cf0b2ab6798 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -214,6 +214,8 @@ fn a_content_duplicate_of_a_trashed_photo_or_virtual_copy_is_a_new_live_photo() file: Some(Box::new(crate::import::FileFacts { meta: lightcraft_catalog::Meta { camera: "Same Camera".into(), ..Default::default() }, captured: None, + orientation: None, + sidecar: None, })), }], ..Default::default() @@ -356,6 +358,46 @@ fn a_content_duplicate_keeps_the_rights_metadata_and_capture_time_in_its_file() assert_eq!(new.captured.as_deref(), Some("2024-05-06T07:08:09"), "{r}"); std::fs::remove_dir_all(dir).unwrap(); } +/// A content duplicate's XMP sidecar goes into its new record as it does for a file import of it +/// (caption, copyright…) when the catalog doesn't restate them, also when its file has a capture +/// time of its own (#2589). +#[test] +fn a_content_duplicate_keeps_what_its_sidecar_says() { + let dir = std::env::temp_dir().join(format!("lightcraft-lrcat-duplicate-sidecar-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(dir.join("Photos")).unwrap(); + let source = dir.join("source.lrcat"); + std::fs::write(dir.join("Photos/test.ARW"), b"same bytes").unwrap(); + std::fs::write( + dir.join("Photos/test.xmp"), + r#" + +Harbour at dawn +© Sidecar Author +"#, + ) + .unwrap(); + std::fs::write(&source, native_catalog(&photo_tables((dir.to_str().unwrap(), "")))).unwrap(); + let mut s = crate::Session::new(); + let other = library_photo(&mut s, "/elsewhere/a.ARW", |p| p.meta.caption = "Other photo's caption".into()); + s.media.file_probe = Some(Arc::new(|_| { + Ok(crate::media::ProbeInfo { + format: "ARW".into(), + width: 20, + height: 10, + content_hash: Some("same-bytes".into()), + captured: Some("2024-05-06T07:08:09".into()), + ..Default::default() + }) + })); + let mut job = crate::lightroom_job::LightroomJob::new(&mut s, source, false).unwrap(); + let prepared = job.prepare(&AtomicBool::new(false)).unwrap(); + let r = crate::lightroom_job::commit_prepared(&mut s, prepared).unwrap().report; + let new = s.catalog.photos().find(|p| p.id != other).unwrap_or_else(|| panic!("no new record: {r}")); + assert_eq!((new.meta.caption.as_str(), new.meta.copyright.as_str()), ("Harbour at dawn", "© Sidecar Author"), "{r}"); + assert_eq!(new.captured.as_deref(), Some("2024-05-06T07:08:09"), "the file's own capture time: {r}"); + std::fs::remove_dir_all(dir).unwrap(); +} /// A catalog photo matched (by path) to a library photo in Recently Deleted leaves it there, as /// the import was set up to do (a Lightroom import doesn't restore, see `OnDeleted`), and the report /// counts it so the photos don't go missing unexplained (#2589). A new virtual copy of it is From 752065dd92e5f70addaead3576b60ad0db88ea6b Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Mon, 2 Nov 2026 09:32:57 -0600 Subject: [PATCH 02/22] fix(lightroom): only the Lightroom import reads a content duplicate's sidecar (#2589) The previous commit gave every import's content duplicates a sidecar lookup, so that the Lightroom import could start the duplicate's new record from its sidecar. Only the Lightroom import makes such a record; any other import skips the duplicate, and #2954 had it ask the disk nothing for it (each sidecar lookup is a few names, a round trip apiece on a network share). ImportOptions::read_duplicates says the import makes a record of its duplicates; only LightroomJob sets it. Without it, a duplicate's sidecar is not looked up and, when the file has its own capture time, its embedded XMP is not parsed, as before the previous commit. Test: the same duplicate beside the same sidecar reaches the report without its sidecar from a plain import and with it when read_duplicates is set. With the skip removed, the plain import's duplicate carries the sidecar's caption and the test fails. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/library/import.rs | 2 ++ crates/engine/src/import/job.rs | 26 ++++++++++---- crates/engine/src/import/types.rs | 4 +++ crates/engine/src/lightroom_catalog/tests.rs | 38 ++++++++++++++++++++ crates/engine/src/lightroom_job.rs | 6 ++-- 5 files changed, 68 insertions(+), 8 deletions(-) diff --git a/crates/engine/src/cmd/library/import.rs b/crates/engine/src/cmd/library/import.rs index 188dc6ae995..61a7ccefdaa 100644 --- a/crates/engine/src/cmd/library/import.rs +++ b/crates/engine/src/cmd/library/import.rs @@ -82,6 +82,8 @@ pub fn import_params(s: &Session, p: &Value) -> Result { metadata_preset, convert_dng: bool_or(p, "dng", false), local: bool_or(p, "local", false), + // (only the Lightroom import makes records of duplicates) + read_duplicates: false, recipe: crate::cmd::recipe_param(p, "library.import")?, }; let album_name = str_param(p, "albumName").map(str::trim).filter(|n| !n.is_empty()).map(str::to_string); diff --git a/crates/engine/src/import/job.rs b/crates/engine/src/import/job.rs index 4c120acc19a..847942b3cc5 100644 --- a/crates/engine/src/import/job.rs +++ b/crates/engine/src/import/job.rs @@ -298,10 +298,19 @@ impl ImportJob { // The sidecar of every file that was probed, looked up for the batch at once: each is a few // names asked of the disk, which on a network share made a folder of thousands of photos wait // a round trip per name, one name after another. - // (a file whose content the library has is read too: a Lightroom import makes it a new record - // from its file and sidecar, #2589) let asked: Vec<&str> = todo.iter().zip(&probed).filter(|(_, p)| p.is_ok()).map(|(f, _)| f.as_str()).collect(); - let mut found = sidecars_of(&asked, cancel, |f| crate::sidecar::find_sidecar_for_import(&stems, self.naming, f)).into_iter(); + // (a file whose content the library has is skipped below as a duplicate: it asks the disk + // nothing, unless the import makes a record of it from its file and sidecar, #2589) + let skipped = !opts.local && !opts.read_duplicates; + let known: std::collections::HashSet<&str> = todo + .iter() + .zip(&probed) + .filter(|(_, p)| skipped && p.as_ref().is_ok_and(|i| i.content_hash.as_ref().is_some_and(|h| self.by_hash.contains_key(h)))) + .map(|(f, _)| f.as_str()) + .collect(); + let mut found = + sidecars_of(&asked, cancel, |f| if known.contains(f) { None } else { crate::sidecar::find_sidecar_for_import(&stems, self.naming, f) }) + .into_iter(); // Files are planned one by one, in order (duplicates, sidecars, names, folders); their // copies or moves — the slow part, reading and writing every byte and verifying it — are // collected and run on several threads (issue #367), then their outcomes take their places. @@ -331,13 +340,18 @@ impl ImportJob { break; } } - // same bytes as a library photo: skipped below, once it is read as a file import reads it + // same bytes as a library photo: skipped below, once its capture time is known (and, + // when the import makes a record of it, once it is read as a file import reads it) let duplicate_of = info.content_hash.as_ref().filter(|_| !opts.local).and_then(|h| self.by_hash.get(h).map(|existing| (h.clone(), *existing))); // the XMP sidecar (or a raw's embedded XMP), read before copying: its capture time files - // and names the copy when the file itself has none + // and names the copy when the file itself has none (a skipped duplicate needs only that time) let raw = info.kind == MediaKind::Raw; - let packet = found_sidecar.and_then(|f| std::fs::read_to_string(f).ok()).or_else(|| info.xmp.clone().filter(|_| raw)); + let packet = if duplicate_of.is_some() && info.captured.is_some() && !opts.read_duplicates { + None + } else { + found_sidecar.and_then(|f| std::fs::read_to_string(f).ok()).or_else(|| info.xmp.clone().filter(|_| raw)) + }; let target = crate::crs::Target::for_file(info.kind, &info.format, info.preview_only.is_some(), &info.meta.camera); let sidecar = packet.and_then(|x| match crate::sidecar::parse_sidecar(&x, target) { Ok(sc) => Some(sc), diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index 29641105840..298ff987464 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -67,6 +67,10 @@ pub struct ImportOptions { pub metadata_preset: Option, /// Copy: raws are copied as DNG (Copy as DNG). pub convert_dng: bool, + /// A duplicate by content is read as a new file is, its XMP sidecar included: the Lightroom + /// import makes a record of its own from it ([`Duplicate::file`], #2589). Any other import + /// skips it without looking up its sidecar (a round trip per name on a network share, #2954). + pub read_duplicates: bool, /// A batch-edit recipe: develop control id / value pairs (e.g. `light.exposure` → 0.5), /// applied to every imported photo *after* its XMP sidecar, camera default and import preset, /// as one more History step (`Import adjustments`). Only the named controls change; the recipe diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index cf0b2ab6798..c5621821beb 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -398,6 +398,44 @@ fn a_content_duplicate_keeps_what_its_sidecar_says() { assert_eq!(new.captured.as_deref(), Some("2024-05-06T07:08:09"), "the file's own capture time: {r}"); std::fs::remove_dir_all(dir).unwrap(); } +/// Only the Lightroom import reads a content duplicate's XMP sidecar: any other import skips the +/// duplicate without looking its sidecar up (#2954), so the same file beside the same sidecar +/// reaches the report with no sidecar unless the import makes a record of it (#2589). +#[test] +fn only_an_import_that_makes_a_record_of_a_content_duplicate_reads_its_sidecar() { + let dir = std::env::temp_dir().join(format!("lightcraft-lrcat-duplicate-skip-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let file = dir.join("test.ARW"); + std::fs::write(&file, b"same bytes").unwrap(); + std::fs::write( + dir.join("test.xmp"), + r#" + +Harbour at dawn +"#, + ) + .unwrap(); + let paths = [file.to_string_lossy().into_owned()]; + for read_duplicates in [false, true] { + let mut s = crate::Session::new(); + let other = library_photo(&mut s, "/elsewhere/a.ARW", |p| p.meta.caption = "Other photo's caption".into()); + s.media.file_probe = + Some(Arc::new(|_| Ok(crate::media::ProbeInfo { format: "ARW".into(), content_hash: Some("same-bytes".into()), ..Default::default() }))); + let opts = crate::import::ImportOptions { read_duplicates, ..Default::default() }; + let r = crate::import::import_with(&mut s, &paths, &opts).unwrap(); + assert!(r.imported.is_empty() && s.catalog.photos().count() == 1, "{read_duplicates}: {r:?}"); + let [d] = r.duplicates.as_slice() else { panic!("{read_duplicates}: {r:?}") }; + assert_eq!((d.reason, d.existing), ("content", Some(other.0)), "{read_duplicates}"); + let caption = d.file.as_ref().and_then(|f| f.sidecar.as_ref()).and_then(|sc| sc.caption.clone()); + if read_duplicates { + assert_eq!(caption.as_deref(), Some("Harbour at dawn"), "the Lightroom import reads it: {r:?}"); + } else { + assert_eq!(caption, None, "a skipped duplicate's sidecar isn't looked up: {r:?}"); + } + } + std::fs::remove_dir_all(dir).unwrap(); +} /// A catalog photo matched (by path) to a library photo in Recently Deleted leaves it there, as /// the import was set up to do (a Lightroom import doesn't restore, see `OnDeleted`), and the report /// counts it so the photos don't go missing unexplained (#2589). A new virtual copy of it is diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index defdb850f0e..7a039fe0f1e 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -207,8 +207,10 @@ pub struct LightroomJob { impl LightroomJob { /// Snapshot session state only. This constructor performs no filesystem work. pub fn new(s: &mut crate::Session, path: PathBuf, update_existing: bool) -> crate::Result { - // a photo deleted here stays deleted: the catalog's record is matched, not restored - let opts = ImportOptions { mode: ImportMode::Add, on_deleted: crate::import::OnDeleted::Skip, ..ImportOptions::default() }; + // a photo deleted here stays deleted: the catalog's record is matched, not restored; a + // duplicate by content becomes a record of its own, so its file and sidecar are read (#2589) + let opts = + ImportOptions { mode: ImportMode::Add, on_deleted: crate::import::OnDeleted::Skip, read_duplicates: true, ..ImportOptions::default() }; let import = ImportJob::new(s, opts)?; let archive_dir = s.library.as_ref().filter(|library| library.on_disk).map(|library| library.dir.join("Interop")); let progress = LightroomProgress { From f840d2d7e2328aed6a4b8861ca0ea5ee7abe5408 Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Thu, 5 Nov 2026 04:52:07 -0600 Subject: [PATCH 03/22] test(lightroom): a content duplicate's sidecar regions turn by its file's orientation (#2589) Pins how #2674's rule (#2857) reads through start_from_file, which the file import and a Lightroom content duplicate share: the file's own orientation turns sidecar regions drawn on the photo as stored onto the upright record, also for the duplicate (its size is its file's upright one; the catalog's orientation is a develop rotation on top). And an empty sidecar beside a turned photo stays uncounted: the orientation is given to a sidecar that said something, never makes one. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog/tests.rs | 53 ++++++++++++++++++++ crates/engine/src/tests/xmp.rs | 19 +++++++ 2 files changed, 72 insertions(+) diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index c5621821beb..ecb6b11481c 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -398,6 +398,59 @@ fn a_content_duplicate_keeps_what_its_sidecar_says() { assert_eq!(new.captured.as_deref(), Some("2024-05-06T07:08:09"), "the file's own capture time: {r}"); std::fs::remove_dir_all(dir).unwrap(); } +/// A content duplicate's sidecar regions drawn on its photo as stored (its stored size as +/// `AppliedToDimensions`, no `mwg-rs:Rotation`) land on the upright photo, turned by its file's own +/// orientation as a file import of it turns them (#2674): the record's size is its file's upright one, +/// and the catalog's orientation is a develop rotation on top of it (#2589). +#[test] +fn a_content_duplicates_sidecar_regions_are_turned_by_its_files_orientation() { + let dir = std::env::temp_dir().join(format!("lightcraft-lrcat-duplicate-regions-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(dir.join("Photos")).unwrap(); + let source = dir.join("source.lrcat"); + std::fs::write(dir.join("Photos/test.ARW"), b"same bytes").unwrap(); + std::fs::write( + dir.join("Photos/test.xmp"), + r#" + + + + + + + +"#, + ) + .unwrap(); + std::fs::write(&source, native_catalog(&photo_tables((dir.to_str().unwrap(), "")))).unwrap(); + let mut s = crate::Session::new(); + // stored 32 × 24, a quarter turn clockwise upright: 24 × 32 (the size the new record takes) + let other = library_photo(&mut s, "/elsewhere/a.ARW", |p| (p.width, p.height) = (24, 32)); + s.media.file_probe = Some(Arc::new(|_| { + Ok(crate::media::ProbeInfo { + format: "ARW".into(), + width: 24, + height: 32, + content_hash: Some("same-bytes".into()), + captured: Some("2024-05-06T07:08:09".into()), + orientation: Some(lightcraft_geom::Orientation::Rotate90), + ..Default::default() + }) + })); + let mut job = crate::lightroom_job::LightroomJob::new(&mut s, source, false).unwrap(); + let prepared = job.prepare(&AtomicBool::new(false)).unwrap(); + let r = crate::lightroom_job::commit_prepared(&mut s, prepared).unwrap().report; + let new = s.catalog.photos().find(|p| p.id != other).unwrap_or_else(|| panic!("no new record: {r}")); + assert_eq!(new.meta.regions.len(), 1, "{r}"); + let b = new.meta.regions[0].rect; + let got = [b.x0, b.y0, b.x1, b.y1]; + assert!( + got.iter().zip([0.525, 0.2, 0.675, 0.3]).all(|(g, w)| (g - w).abs() < 1e-9), + "the box is where the photo as stored had the face: {got:?}" + ); + std::fs::remove_dir_all(dir).unwrap(); +} /// Only the Lightroom import reads a content duplicate's XMP sidecar: any other import skips the /// duplicate without looking its sidecar up (#2954), so the same file beside the same sidecar /// reaches the report with no sidecar unless the import makes a record of it (#2589). diff --git a/crates/engine/src/tests/xmp.rs b/crates/engine/src/tests/xmp.rs index 006a0a488a1..44aefb16992 100644 --- a/crates/engine/src/tests/xmp.rs +++ b/crates/engine/src/tests/xmp.rs @@ -627,6 +627,25 @@ fn regions_drawn_on_the_photo_as_stored_land_on_the_upright_photo() { let _ = std::fs::remove_dir_all(&src); } +/// A sidecar that says nothing beside a photo whose file states an orientation isn't one the import counts: the +/// file's orientation goes to a sidecar that said something, not into an empty one (#2674, #2589). +#[test] +fn an_empty_sidecar_beside_a_turned_photo_is_not_counted() { + let src = temp_dir("regions-empty-sidecar"); + let file = src.join("p.jpg"); + write_turned_jpeg(&file, None); + std::fs::write( + src.join("p.xmp"), + r#""#, + ) + .unwrap(); + let mut s = Session::new().with_fs(); + let r = s.execute("library.import", &json!({"paths": [file.to_string_lossy()]})).unwrap(); + assert_eq!(r["imported"].as_array().map(Vec::len), Some(1), "{r}"); + assert_eq!(r["sidecars"], 0, "{r}"); + let _ = std::fs::remove_dir_all(&src); +} + /// Review of #2857: a photo whose Exif states no orientation, but whose XMP says `tiff:Orientation=6`, is shown as /// stored (LightCraft turns by the Exif alone), so boxes drawn on its stored frame are right as written: at import /// and when the file's metadata is read again, which must agree. From b5127e5c0f758a2bba96473f2bfc37e6b502054a Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Mon, 9 Nov 2026 10:50:33 -0600 Subject: [PATCH 04/22] test(lightroom): a file that turns out to be a content duplicate at commit keeps its sidecar (#2589) revalidate_add turns a file prepared as ready into a content duplicate when a photo with its bytes arrives before the commit; the duplicate keeps the sidecar it was prepared with, so its new record has the sidecar's caption and copyright. --- crates/engine/src/lightroom_catalog/tests.rs | 44 ++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index ecb6b11481c..1f558ecf5bb 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -398,6 +398,50 @@ fn a_content_duplicate_keeps_what_its_sidecar_says() { assert_eq!(new.captured.as_deref(), Some("2024-05-06T07:08:09"), "the file's own capture time: {r}"); std::fs::remove_dir_all(dir).unwrap(); } +/// A file that becomes a content duplicate only after it was prepared (another import added a photo +/// with its bytes while the catalog was read) is turned into one just before the commit +/// (`revalidate_add`); its new record keeps what its sidecar says all the same (#2589). +#[test] +fn a_file_that_turns_out_to_be_a_content_duplicate_at_commit_keeps_what_its_sidecar_says() { + let dir = std::env::temp_dir().join(format!("lightcraft-lrcat-late-duplicate-sidecar-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(dir.join("Photos")).unwrap(); + let source = dir.join("source.lrcat"); + std::fs::write(dir.join("Photos/test.ARW"), b"same bytes").unwrap(); + std::fs::write( + dir.join("Photos/test.xmp"), + r#" + +Harbour at dawn +© Sidecar Author +"#, + ) + .unwrap(); + std::fs::write(&source, native_catalog(&photo_tables((dir.to_str().unwrap(), "")))).unwrap(); + let mut s = crate::Session::new(); + s.media.file_probe = Some(Arc::new(|_| { + Ok(crate::media::ProbeInfo { + format: "ARW".into(), + width: 20, + height: 10, + content_hash: Some("same-bytes".into()), + captured: Some("2024-05-06T07:08:09".into()), + ..Default::default() + }) + })); + // prepared while the library has no photo with the file's bytes: the file is ready to add + let mut job = crate::lightroom_job::LightroomJob::new(&mut s, source, false).unwrap(); + let prepared = job.prepare(&AtomicBool::new(false)).unwrap(); + // then a photo with the same bytes arrives before the commit (the library is still the one + // the job was prepared for: the commit checks its identity, not its photos) + let other = library_photo(&mut s, "/elsewhere/a.ARW", |p| p.meta.caption = "Other photo's caption".into()); + let r = crate::lightroom_job::commit_prepared(&mut s, prepared).unwrap().report; + assert_eq!(s.catalog.photos().count(), 2, "{r}"); + let new = s.catalog.photos().find(|p| p.id != other).unwrap_or_else(|| panic!("no new record: {r}")); + assert_eq!((new.meta.caption.as_str(), new.meta.copyright.as_str()), ("Harbour at dawn", "© Sidecar Author"), "{r}"); + assert_eq!(s.catalog.photo(other).unwrap().meta.caption, "Other photo's caption", "{r}"); + std::fs::remove_dir_all(dir).unwrap(); +} /// A content duplicate's sidecar regions drawn on its photo as stored (its stored size as /// `AppliedToDimensions`, no `mwg-rs:Rotation`) land on the upright photo, turned by its file's own /// orientation as a file import of it turns them (#2674): the record's size is its file's upright one, From f41b4519c71355a6d4c6222504f711c5bb1f9e13 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Tue, 27 Oct 2026 03:00:38 -0500 Subject: [PATCH 05/22] Issue #2589: a Lightroom import says where each catalog photo went The import report accounts for every image of the catalog (`inCatalog`: its Adobe_images rows, masters and virtual copies, as Lightroom counts them): `added`, `alreadyInLibrary`, `inRecentlyDeleted`, `notSupported` (by extension in `notSupportedTypes`), `pathRefused` and `incomplete` add up to it; when they don't, a warning says by how much. The reader records the image count and the file types it refuses. An original on another computer or a device gets no record (so the app never looks at it), but was listed in `missing`, and the result window told the user to relink it with Find Missing Photos. It is now counted as `pathRefused` instead. The toast says how many photos the catalog has and names each outcome some photo had ("45091 photos in the catalog: 16521 added, 812 already in the library"); the result window has one line per outcome. Refs #1584. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_archive.rs | 4 + crates/engine/src/lightroom_catalog.rs | 94 ++++++--- crates/engine/src/lightroom_catalog/tests.rs | 81 +++++++- crates/engine/src/lightroom_job.rs | 4 + crates/ui-egui/locales/cs-formats.json | 19 +- crates/ui-egui/locales/de-formats.json | 19 +- crates/ui-egui/locales/es-formats.json | 19 +- crates/ui-egui/locales/fi-formats.json | 19 +- crates/ui-egui/locales/fr-formats.json | 19 +- crates/ui-egui/locales/id-formats.json | 19 +- crates/ui-egui/locales/it-formats.json | 19 +- crates/ui-egui/locales/ja-formats.json | 19 +- crates/ui-egui/locales/ka-formats.json | 19 +- crates/ui-egui/locales/pl-formats.json | 19 +- crates/ui-egui/locales/pt-br-formats.json | 19 +- crates/ui-egui/locales/ru-formats.json | 19 +- crates/ui-egui/locales/sv-formats.json | 19 +- crates/ui-egui/locales/uk-formats.json | 19 +- crates/ui-egui/locales/vi-formats.json | 19 +- crates/ui-egui/locales/zh-hans-formats.json | 19 +- crates/ui-egui/locales/zh-hant-formats.json | 19 +- crates/ui-egui/src/lightroom_import.rs | 189 +++++++++++++++---- docs/lightroom-catalog-import.md | 25 ++- docs/whats-new.md | 9 + 24 files changed, 594 insertions(+), 135 deletions(-) diff --git a/crates/engine/src/lightroom_archive.rs b/crates/engine/src/lightroom_archive.rs index 511f81f308b..d99cfc012e3 100644 --- a/crates/engine/src/lightroom_archive.rs +++ b/crates/engine/src/lightroom_archive.rs @@ -527,6 +527,8 @@ mod tests { collection_content: Vec::new(), warnings: Vec::new(), skipped: Vec::new(), + images: 0, + not_supported: Default::default(), } } @@ -553,6 +555,8 @@ mod tests { collection_content: vec![BTreeMap::from([("rule".into(), serde_json::json!("rating > 3"))])], warnings: vec!["one warning".into()], skipped: Vec::new(), + images: 1, + not_supported: Default::default(), } } diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index bd8057cf3f7..0c04f1206b0 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -204,6 +204,15 @@ pub struct CatalogImport { /// so each front end can say so in its own language. #[serde(default)] pub skipped: Vec, + /// How many images the catalog has: its `Adobe_images` rows, masters and virtual copies (as + /// Lightroom's All Photographs counts them). The import report accounts for each one. + #[serde(default)] + pub images: usize, + /// Catalog images left out because their original isn't a file type LightCraft reads (videos, + /// for one), counted by the original's extension in lower case ("" for none); a virtual copy + /// counts under its master's. Their ids are in [`CatalogImport::warnings`]. + #[serde(default)] + pub not_supported: BTreeMap, } /// A catalog image that was not imported, and why. @@ -622,12 +631,16 @@ fn read_file(path: &Path, document: &Path, source: &Path, cancel: &AtomicBool, d collection_content: optional_table("AgLibraryCollectionContent", &mut warnings)?, warnings, skipped: Vec::new(), + images: 0, + not_supported: BTreeMap::new(), }; // images whose file, folder or root record is gone, or whose path is empty (Lightroom leaves // these behind and ignores them); they and their virtual copies are skipped and reported // instead of failing the import let mut orphans = HashSet::new(); - for image in table("Adobe_images", true)? { + let images = table("Adobe_images", true)?; + out.images = images.len(); + for image in images { ensure_read_active(cancel)?; let id = number(&image, "id_local"); let record = files.get(&number(&image, "rootFile")).ok_or(SkipReason::MissingFile).and_then(|file| { @@ -717,7 +730,7 @@ fn is_catalog_video(p: &CatalogPhoto) -> bool { } /// Drop the catalog's images whose original is not a file type LightCraft reads, saying so in the -/// import's warnings. +/// import's warnings and counting them in [`CatalogImport::not_supported`]. /// /// The catalog decides these paths, and a record it leaves behind is one click from the system /// opener (Photo ▸ Edit In ▸ Open Original in Other Editor). A record for `payload.exe`, @@ -729,34 +742,38 @@ fn is_catalog_video(p: &CatalogPhoto) -> bool { /// can keep one; the second pass finds nothing left to say. pub(crate) fn refuse_non_media(data: &mut CatalogImport) { // masters first: a virtual copy may come before its master in the table - let refused: HashSet = data + // each refused master's extension, which its virtual copies count under + let refused: HashMap = data .photos .iter() .filter(|p| number(&p.image, "masterImage") == 0 && !crate::open_path::is_media(Path::new(&p.path)) && !is_catalog_video(p)) - .map(|p| p.source_id) + .map(|p| (p.source_id, Path::new(&p.path).extension().map(|e| e.to_string_lossy().to_lowercase()).unwrap_or_default())) .collect(); if refused.is_empty() { return; } let mut warnings = Vec::new(); + let mut counted = Vec::new(); data.photos.retain(|p| { let master = number(&p.image, "masterImage"); // `masterImage` is 0 for a master, so a refused id of 0 (a malformed catalog) must not // take every master of the catalog with it if master != 0 { - if !refused.contains(&master) { - return true; - } + let Some(extension) = refused.get(&master) else { return true }; warnings.push(format!("image {}: not imported; its original was not imported", p.source_id)); + counted.push(extension.clone()); return false; } - if !refused.contains(&p.source_id) { - return true; - } + let Some(extension) = refused.get(&p.source_id) else { return true }; warnings.push(format!("image {}: not imported; {} isn't one of the file types LightCraft reads", p.source_id, p.path)); + counted.push(extension.clone()); false }); data.warnings.extend(warnings); + for extension in counted { + let count = data.not_supported.entry(extension).or_default(); + *count = count.saturating_add(1); + } } fn ensure_read_active(cancel: &AtomicBool) -> Result<(), String> { @@ -1231,6 +1248,14 @@ fn stage_collections( /// Turn the read catalog into library records in one undo step and return the import report /// (added, missing, failed, warnings and skipped images). +/// +/// The report accounts for every image of the catalog (`inCatalog`, masters and virtual copies): +/// each one is `added` (a new record, or a record this import's file import made or a browsed +/// Local photo that joins the library), `alreadyInLibrary` (an existing record, updated in place), +/// `inRecentlyDeleted` (an existing record in Recently Deleted, left there), `notSupported` (not a +/// file type LightCraft reads, by type in `notSupportedTypes`), `pathRefused` (an original the +/// import doesn't look at, see [`Original::Refused`]: no record) or `incomplete` (`skipped`). +/// Should they not add up, a warning says by how much. pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, context: ApplyPrepared<'_>) -> crate::Result { let ApplyPrepared { update_existing, files, index, archive_path, missing_sources, undo0 } = context; // nothing but a file type LightCraft reads becomes a record, whichever route got here (#2135) @@ -1248,12 +1273,16 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // Normal import counts probed originals; catalog import also adds offline records, // distinct originals with identical bytes, and virtual copies. let mut imported = files.imported.len(); + // The records the file import just made: the catalog photo that finds one was added, not + // already in the library. + let mut fresh: HashSet = files.imported.iter().copied().collect(); let mut promoted = HashSet::new(); let mut unmapped = BTreeMap::new(); let mut preserved = 0; - // Library photos in Recently Deleted that a catalog photo matched: they stay there (only an - // import of the files themselves brings a photo back, see `OnDeleted`), and the report says so. - let mut in_trash = HashSet::new(); + // Where each catalog photo went (the report's breakdown, see above). A library photo in Recently + // Deleted that a catalog photo matched stays there (only an import of the files themselves + // brings a photo back, see `OnDeleted`), and the report says so. + let (mut added, mut already, mut in_trash, mut path_refused) = (0usize, 0usize, 0usize, 0usize); // Masters precede their virtual copies. let mut photos: Vec<_> = data.photos.iter().collect(); photos.sort_by_key(|p| number(&p.image, "masterImage") != 0); @@ -1262,14 +1291,16 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co let mut planned: HashMap = HashMap::new(); for src in photos { let master = number(&src.image, "masterImage"); - if master == 0 && missing_sources.contains(&key(&src.path)) { - missing.push(src.path.clone()); - } // A refused path must not become a library record the app would look at later; its - // virtual copies go with it. + // virtual copies go with it. Having no record, it isn't missing (Find Missing Photos has + // nothing to relink): it is counted on its own. if refused.contains(&src.source_id) || refused.contains(&master) { + path_refused += 1; continue; } + if master == 0 && missing_sources.contains(&key(&src.path)) { + missing.push(src.path.clone()); + } let indexed = index .photos .get(&identity(&data, src)) @@ -1277,10 +1308,9 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co .map(PhotoId) .filter(|id| s.catalog.photo(*id).is_some_and(|p| source_path(p).is_some_and(|path| key(path) == key(&src.path)))); let existing_id = indexed.or_else(|| if master == 0 { by_path.get(&key(&src.path)).copied() } else { None }); + let mut trashed = false; let mut p = if let Some(id) = existing_id.and_then(|id| s.catalog.photo(id)) { - if id.deleted { - in_trash.insert(id.id); - } + trashed = id.deleted; (**id).clone() } else if master != 0 { let master_id = ids.get(&master).copied().ok_or_else(|| error(format!("virtual copy {}: missing master", src.source_id)))?; @@ -1439,10 +1469,18 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co repaired.kind = p.kind; ops.extend([Op::RemovePhoto { id: p.id }, Op::AddPhoto { photo: Box::new(repaired) }]); } - if was_local && promoted.insert(p.id) { + let promote = was_local && promoted.insert(p.id); + if promote { imported += 1; ops.push(Op::SetLocal { id: p.id, local: false }); } + if trashed { + in_trash += 1; + } else if promote || fresh.remove(&p.id.0) { + added += 1; + } else { + already += 1; + } ops.extend([ Op::SetRating { id: p.id, rating: p.rating }, Op::SetFlag { id: p.id, flag: p.flag }, @@ -1453,6 +1491,7 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co ops.push(Op::SetDevelop { id: p.id, settings: p.develop.clone(), label: "Lightroom catalog".into(), edited: p.edited.clone() }); } else { imported += 1; + added += 1; ops.push(Op::AddPhoto { photo: Box::new(p) }); } by_path.entry(key(&src.path)).or_insert(photo_id); @@ -1462,8 +1501,19 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co s.commit("Import Lightroom Catalog", Op::Batch { ops })?; } s.merge_undo(s.undo.len().saturating_sub(undo0), "Import Lightroom Catalog"); + let not_supported = data.not_supported.values().fold(0usize, |sum, n| sum.saturating_add(*n)); + let accounted = [added, already, in_trash, not_supported, path_refused, data.skipped.len()].into_iter().fold(0usize, usize::saturating_add); + if accounted != data.images { + warnings.push(format!( + "the catalog has {} images, but this report accounts for {accounted} (a difference of {})", + data.images, + data.images.abs_diff(accounted) + )); + } Ok(AppliedImport { - report: json!({"source":data.source,"photos":ids.len(),"imported":imported,"library":s.library.as_ref().filter(|l| l.on_disk).map(|l| l.dir.to_string_lossy()),"collections":album_count,"preservedExistingEdits":preserved,"inRecentlyDeleted":in_trash.len(),"missing":missing,"failed":files.failed,"warnings":warnings,"skipped":data.skipped,"unmapped":unmapped,"archive":archive_path,"mapping":ids}), + report: json!({"source":data.source,"photos":ids.len(),"imported":imported,"library":s.library.as_ref().filter(|l| l.on_disk).map(|l| l.dir.to_string_lossy()),"collections":album_count,"preservedExistingEdits":preserved, + "inCatalog":data.images,"added":added,"alreadyInLibrary":already,"inRecentlyDeleted":in_trash,"notSupported":not_supported,"notSupportedTypes":data.not_supported,"pathRefused":path_refused,"incomplete":data.skipped.len(), + "missing":missing,"failed":files.failed,"warnings":warnings,"skipped":data.skipped,"unmapped":unmapped,"archive":archive_path,"mapping":ids}), index: index.clone(), }) } diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index 1f558ecf5bb..5c1af5dbf7e 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -38,6 +38,8 @@ fn sample() -> CatalogImport { collection_content: Vec::new(), warnings: Vec::new(), skipped: Vec::new(), + images: 2, + not_supported: BTreeMap::new(), } } /// A crafted `.lrcat` that names a program as a photo's original gets no record for it, so @@ -584,6 +586,78 @@ fn a_reimport_counts_each_trashed_match_once() { assert_eq!(r["imported"], 0, "{r}"); assert!(ids.iter().all(|id| s.catalog.photo(*id).unwrap().deleted)); } + +/// The report says where each of the catalog's images went, one count per outcome, and the counts +/// add up to the catalog's images (virtual copies included), so a large import that adds fewer +/// photos than the catalog has explains the rest (#2589, #1584). +#[test] +fn the_report_accounts_for_every_catalog_image_once() { + let mut s = crate::Session::new(); + library_photo(&mut s, "/library/kept.ARW", |_| {}); + library_photo(&mut s, "/library/trashed.ARW", |p| p.deleted = true); + let mut data = sample(); + let master = data.photos[1].clone(); + let photo = |id: i64, path: &str, master_image: i64| { + let mut p = master.clone(); + p.source_id = id; + p.uuid = format!("image-{id}"); + p.path = path.into(); + p.image = row(json!({"id_local": id, "masterImage": master_image, "fileFormat": "ARW"})); + p + }; + let mut far = photo(7, "//server/share/far.ARW", 0); + far.original = Original::Refused("it is on another computer".into()); + data.photos.extend([ + photo(3, "/library/kept.ARW", 0), + photo(4, "/library/trashed.ARW", 0), + // a video and its virtual copy + photo(5, "/Videos/clip.MP4", 0), + photo(6, "/Videos/clip.MP4", 5), + far, + ]); + data.skipped.push(SkippedImage { image: 8, reason: SkipReason::MissingFile }); + data.images = 8; + // one index across both imports, as a library on disk keeps it + let mut index = ImportIndex::default(); + let missing_sources: HashSet<_> = data.photos.iter().filter(|p| !p.original_is_file()).map(|p| key(&p.path)).collect(); + let mut import = |s: &mut crate::Session| { + let undo0 = s.undo.len(); + let context = ApplyPrepared { + update_existing: false, + files: Default::default(), + index: &mut index, + archive_path: None, + missing_sources: &missing_sources, + undo0, + }; + apply_prepared(s, data.clone(), context).unwrap().report + }; + let r = import(&mut s); + let counts = ["added", "alreadyInLibrary", "inRecentlyDeleted", "notSupported", "pathRefused", "incomplete"].map(|k| r[k].as_u64().unwrap()); + assert_eq!(counts, [2, 1, 1, 2, 1, 1], "the offline master and its copy are added: {r}"); + assert_eq!(r["inCatalog"], 8, "{r}"); + assert_eq!(counts.iter().sum::(), 8, "{r}"); + assert_eq!(r["notSupportedTypes"], json!({"mp4": 2}), "{r}"); + assert_eq!(r["imported"], r["added"], "{r}"); + let missing = r["missing"].to_string(); + assert!(!missing.contains("far.ARW"), "a refused path has no record to relink, so it isn't missing: {missing}"); + assert!(!r["warnings"].to_string().contains("accounts for"), "{r}"); + // Imported again, the photos it added are already in the library. + let again = import(&mut s); + let counts = ["added", "alreadyInLibrary", "inRecentlyDeleted"].map(|k| again[k].as_u64().unwrap()); + assert_eq!(counts, [0, 3, 1], "{again}"); +} + +/// Counts that don't add up to the catalog's images say so instead of passing silently. +#[test] +fn a_report_that_does_not_add_up_says_by_how_much() { + let mut data = sample(); + data.images = 5; + let r = apply(&mut crate::Session::new(), data, false).unwrap(); + let warnings = r["warnings"].to_string(); + assert!(warnings.contains("the catalog has 5 images, but this report accounts for 2 (a difference of 3)"), "{warnings}"); +} + /// The import report's warnings about `album`. fn warnings_naming(r: &Value, album: &str) -> Vec { r["warnings"].as_array().unwrap().iter().filter_map(Value::as_str).filter(|w| w.starts_with(&format!("{album}:"))).map(String::from).collect() @@ -1806,6 +1880,9 @@ fn probed_original_is_counted_once_and_reimport_adds_nothing() { let prepared = job.prepare(&AtomicBool::new(false)).unwrap(); let completion = crate::lightroom_job::commit_prepared(&mut s, prepared).unwrap(); assert_eq!(completion.report["imported"], expected); + // the record the file import made is added; the second time it is already in the library + let outcome = (completion.report["added"].as_u64(), completion.report["alreadyInLibrary"].as_u64()); + assert_eq!(outcome, (Some(expected), Some(1 - expected)), "{}", completion.report); assert_eq!(completion.report["missing"], json!([])); assert_eq!(completion.report["failed"], json!([])); assert_eq!(s.catalog.len(), 1); @@ -1859,7 +1936,9 @@ fn originals_on_other_computers_are_never_looked_at_or_added() { })); let report = import(&mut s, &source, false).unwrap(); assert_eq!(probes.load(Ordering::Relaxed), 0, "{root}"); - assert_eq!(report["missing"].as_array().map(Vec::len), Some(1), "{root}: {report}"); + // no record, so nothing for Find Missing Photos: counted on its own + assert_eq!(report["missing"], json!([]), "{root}: {report}"); + assert_eq!((report["pathRefused"].as_u64(), report["inCatalog"].as_u64()), (Some(1), Some(1)), "{root}: {report}"); assert!(s.catalog.is_empty(), "{root}"); } // An absolute folder path would replace the root. diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index 7a039fe0f1e..abd73200d0a 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -366,6 +366,8 @@ mod tests { collection_content: Vec::new(), warnings: Vec::new(), skipped: Vec::new(), + images: 0, + not_supported: Default::default(), } } @@ -413,6 +415,8 @@ mod tests { collection_content: Vec::new(), warnings: Vec::new(), skipped: Vec::new(), + images: 1, + not_supported: Default::default(), }, normal: Prepared::default(), index: ImportIndex::default(), diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index 77c37c84fc2..0c061be22e3 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -98,9 +98,6 @@ "Lightroom geometry for {path} was not preserved; saved Upright transform is unsupported.": "Geometrie Lightroom pro {path} se nezachovala; uložená transformace narovnání perspektivy není podporována.", "Lightroom geometry for {path} was not preserved; saved transform is ignored because Upright is Off.": "Geometrie Lightroom pro {path} se nezachovala; uložená transformace se ignoruje, protože narovnání perspektivy je vypnuté.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Geometrie Lightroom pro {path} se nezachovala; {mode} se přepočítá.", - "Lightroom import complete: {imported} photos added": "Import z Lightroom byl dokončen: přidaných fotografií: {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Import z Lightroom byl dokončen: přidaných fotografií: {imported}, neúspěšných: {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Import z Lightroom byl dokončen: přidaných fotografií: {imported}; varování indexu: {warning}", "Lightroom import failed: {e}{warning}": "Import z Lightroom selhal: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Prohlížení katalogu Lightroom selhalo: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT NEBO Apache-2.0. Písma: {} (OFL). Ikony: původní tvorba.", @@ -274,8 +271,22 @@ "{n} preset{}": "Přednastavení: {n}{:.0}", "{count} more warnings.": "Další varování: {count}.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "Fotografie katalogu v nedávno odstraněných této knihovny: {in_trash}. Zůstávají tam; chcete-li je vidět, obnovte je z nedávno odstraněných.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Import z Lightroom byl dokončen. Fotografií v katalogu: {in_catalog} – {parts}", + "{added} added": "přidáno: {added}", + "{already} already in the library": "již v knihovně: {already}", + "{in_trash} in Recently Deleted": "v nedávno odstraněných: {in_trash}", + "{not_supported} not supported": "nepodporováno: {not_supported}", + "{path_refused} on refused paths": "s odmítnutou cestou: {path_refused}", + "{incomplete} incomplete": "neúplné: {incomplete}", + "{failed} failed": "neúspěšné: {failed}", + "{message}; index warning: {warning}": "{message}; varování indexu: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Fotografií v katalogu včetně virtuálních kopií: {in_catalog}; kolekcí: {collections}.", + "{added} added to the library.": "Přidáno do knihovny: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "Fotografie katalogu, které už v této knihovně byly a byly aktualizovány z katalogu: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Neimportované fotografie katalogu, jejichž typy souborů LightCraft nečte: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Neimportované fotografie katalogu, jejichž typy souborů LightCraft nečte ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Neimportované fotografie katalogu, jejichž originály jsou na jiném počítači nebo zařízení nebo jejichž cesty v katalogu nejsou platné: {path_refused}. Varování je vypisují.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Neimportované obrázky katalogu: {skipped}. Jejich záznamy v katalogu jsou neúplné.", - "{photos} catalog records processed; {collections} collections.": "Zpracováno záznamů katalogu: {photos}; kolekcí: {collections}.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Chybějící originály: {missing}. Jejich záznamy jsou v katalogu dostupné; použijte Najít chybějící fotografie a znovu je propojte.", "Applied {name}": "Použito: {name}", "Delete “{name}”?": "Odstranit „{name}“?", diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index 7e78396a1ca..8c572860442 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -83,9 +83,6 @@ "LightCraft could not open its window: {e}": "LightCraft konnte sein Fenster nicht öffnen: {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft konnte sein Fenster nicht öffnen: {e}\n\nEinzelheiten stehen in der Protokolldatei: {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Lightroom-Katalog geprüft: {photos} Fotos, {collections} Sammlungen, {missing} fehlen", - "Lightroom import complete: {imported} photos added": "Lightroom-Import abgeschlossen: {imported} Fotos hinzugefügt", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom-Import abgeschlossen: {imported} Fotos hinzugefügt, {failed} fehlgeschlagen", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom-Import abgeschlossen: {imported} Fotos hinzugefügt; Index-Warnung: {warning}", "Lightroom import failed: {e}{warning}": "Lightroom-Import fehlgeschlagen: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Lightroom-Prüfung fehlgeschlagen: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT ODER Apache-2.0. Schriften: {} (OFL). Symbole: eigene Gestaltung.", @@ -278,8 +275,22 @@ "· {in_source} identical copies": "· {in_source} identische Kopien", "{count} more warnings.": "{count} weitere Warnungen.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} Katalogfotos liegen in dieser Bibliothek unter „Zuletzt gelöscht“ und bleiben dort; stelle sie dort wieder her, um sie zu sehen.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom-Import abgeschlossen. {in_catalog} Fotos im Katalog: {parts}", + "{added} added": "{added} hinzugefügt", + "{already} already in the library": "{already} schon in der Bibliothek", + "{in_trash} in Recently Deleted": "{in_trash} in „Zuletzt gelöscht“", + "{not_supported} not supported": "{not_supported} nicht unterstützt", + "{path_refused} on refused paths": "{path_refused} mit abgelehnten Pfaden", + "{incomplete} incomplete": "{incomplete} unvollständig", + "{failed} failed": "{failed} fehlgeschlagen", + "{message}; index warning: {warning}": "{message}; Index-Warnung: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} Fotos im Katalog, virtuelle Kopien eingeschlossen; {collections} Sammlungen.", + "{added} added to the library.": "{added} zur Bibliothek hinzugefügt.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} Katalogfotos waren schon in dieser Bibliothek und wurden aus dem Katalog aktualisiert.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} Katalogfotos wurden nicht importiert: LightCraft liest ihre Dateitypen nicht.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} Katalogfotos wurden nicht importiert: LightCraft liest ihre Dateitypen nicht ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} Katalogfotos wurden nicht importiert: Ihre Originale liegen auf einem anderen Computer oder einem Gerät, oder ihre Pfade im Katalog sind ungültig. Die Warnungen führen sie auf.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} Katalogbilder wurden nicht importiert, weil ihre Einträge im Katalog unvollständig sind.", - "{photos} catalog records processed; {collections} collections.": "{photos} Katalogeinträge verarbeitet; {collections} Sammlungen.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} Originale fehlen. Ihre Katalogeinträge sind verfügbar; verwende „Fehlende Fotos suchen“, um sie neu zu verknüpfen.", "Applied {name}": "{name} angewendet", "Delete “{name}”?": "„{name}“ löschen?", diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index eb5edf4866f..d08320002c8 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -83,9 +83,6 @@ "LightCraft could not open its window: {e}": "LightCraft no pudo abrir su ventana: {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft no pudo abrir su ventana: {e}\n\nLos detalles están en el archivo de registro: {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Catálogo de Lightroom inspeccionado: {photos} fotos, {collections} colecciones, {missing} no encontradas", - "Lightroom import complete: {imported} photos added": "Importación de Lightroom completada: {imported} fotos añadidas", - "Lightroom import complete: {imported} photos added, {failed} failed": "Importación de Lightroom completada: {imported} fotos añadidas, {failed} con errores", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Importación de Lightroom completada: {imported} fotos añadidas; aviso del índice: {warning}", "Lightroom import failed: {e}{warning}": "Error al importar de Lightroom: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Error al inspeccionar Lightroom: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Fuentes: {} (OFL). Iconos: originales.", @@ -279,8 +276,22 @@ "· {in_source} identical copies": "· {in_source} copias idénticas", "{count} more warnings.": "{count} advertencias más.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} fotos del catálogo están en Eliminadas recientemente de esta biblioteca y permanecen allí; restáuralas desde Eliminadas recientemente para verlas.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Importación de Lightroom completada. {in_catalog} fotos en el catálogo: {parts}", + "{added} added": "{added} añadidas", + "{already} already in the library": "{already} ya en la biblioteca", + "{in_trash} in Recently Deleted": "{in_trash} en Eliminadas recientemente", + "{not_supported} not supported": "{not_supported} no compatibles", + "{path_refused} on refused paths": "{path_refused} con rutas rechazadas", + "{incomplete} incomplete": "{incomplete} incompletas", + "{failed} failed": "{failed} con errores", + "{message}; index warning: {warning}": "{message}; aviso del índice: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} fotos en el catálogo, copias virtuales incluidas; {collections} colecciones.", + "{added} added to the library.": "{added} añadidas a la biblioteca.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} fotos del catálogo ya estaban en esta biblioteca y se actualizaron desde el catálogo.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "No se importaron {not_supported} fotos del catálogo: LightCraft no lee sus tipos de archivo.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "No se importaron {not_supported} fotos del catálogo: LightCraft no lee sus tipos de archivo ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "No se importaron {path_refused} fotos del catálogo: sus originales están en otro ordenador o en un dispositivo, o sus rutas en el catálogo no son válidas. Los avisos las enumeran.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "No se importaron {skipped} imágenes del catálogo porque sus registros en el catálogo están incompletos.", - "{photos} catalog records processed; {collections} collections.": "{photos} registros del catálogo procesados; {collections} colecciones.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Faltan {missing} originales. Sus registros del catálogo están disponibles; usa Buscar fotos que faltan para volver a vincularlos.", "Applied {name}": "Se aplicó {name}", "Delete “{name}”?": "¿Eliminar «{name}»?", diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index 31f6c32b5d4..a7570e772b8 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -120,9 +120,6 @@ "Lightroom geometry for {path} was not preserved; saved Upright transform is unsupported.": "Lightroomin geometriaa ei säilytetty kohteelle {path}; tallennettua Upright-muunnosta ei tueta.", "Lightroom geometry for {path} was not preserved; saved transform is ignored because Upright is Off.": "Lightroomin geometriaa ei säilytetty kohteelle {path}; tallennettu muunnos ohitetaan, koska Upright on pois päältä.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Lightroomin geometriaa ei säilytetty kohteelle {path}; {mode} lasketaan uudelleen.", - "Lightroom import complete: {imported} photos added": "Lightroom-tuonti valmis: lisättyjä kuvia {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom-tuonti valmis: lisättyjä kuvia {imported}, epäonnistuneita {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom-tuonti valmis: lisättyjä kuvia {imported}; hakemistovaroitus: {warning}", "Lightroom import failed: {e}{warning}": "Lightroom-tuonti epäonnistui: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Lightroom-tarkastelu epäonnistui: {e}{warning}", "Listing folders — folders: {folders}, files: {files}": "Listataan kansioita — kansiot: {folders}, tiedostot: {files}", @@ -259,11 +256,25 @@ "{n} tasks are still running: {names}. Quitting stops them.": "Käynnissä olevia tehtäviä: {n}: {names}. Lopettaminen pysäyttää ne.", "{n} {noun}": "{n} {noun}", "{pct} %": "{pct} %", - "{photos} catalog records processed; {collections} collections.": "Käsiteltyjä katalogitietueita: {photos}; kokoelmia: {collections}.", "{pid} (missing)": "{pid} (puuttuu)", "{sel_n} selected · {counted}": "Valittu: {sel_n} · {counted}", "{size} GB": "{size} Gt", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "Katalogin kuvia tämän kirjaston Äskettäin poistetuissa: {in_trash}. Ne jäävät sinne; palauta ne Äskettäin poistetuista nähdäksesi ne.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom-tuonti valmis. Kuvia katalogissa {in_catalog}: {parts}", + "{added} added": "lisätty {added}", + "{already} already in the library": "jo kirjastossa {already}", + "{in_trash} in Recently Deleted": "Äskettäin poistetuissa {in_trash}", + "{not_supported} not supported": "ei tuettu {not_supported}", + "{path_refused} on refused paths": "torjutuissa poluissa {path_refused}", + "{incomplete} incomplete": "puutteellisia {incomplete}", + "{failed} failed": "epäonnistuneita {failed}", + "{message}; index warning: {warning}": "{message}; hakemistovaroitus: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Kuvia katalogissa virtuaalikopiot mukaan lukien: {in_catalog}; kokoelmia: {collections}.", + "{added} added to the library.": "Lisätty kirjastoon: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "Katalogin kuvia, jotka olivat jo tässä kirjastossa ja päivitettiin katalogista: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Katalogin kuvia ei tuotu, koska LightCraft ei lue niiden tiedostotyyppejä: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Katalogin kuvia ei tuotu, koska LightCraft ei lue niiden tiedostotyyppejä ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Katalogin kuvia ei tuotu, koska niiden alkuperäiset ovat toisella tietokoneella tai laitteella tai niiden polut katalogissa eivät kelpaa: {path_refused}. Varoitukset luettelevat ne.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "{stage}… {:.0}%": "{stage}… {:.0}%", "{s} s of AV1 video": "{s} s AV1-videota", diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index ba6bcc7b0f9..97b8c494120 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -83,9 +83,6 @@ "LightCraft could not open its window: {e}": "LightCraft n’a pas pu ouvrir sa fenêtre : {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft n’a pas pu ouvrir sa fenêtre : {e}\n\nConsultez le fichier journal pour plus de détails : {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Catalogue Lightroom analysé : {photos} photos, {collections} collections, {missing} manquante(s)", - "Lightroom import complete: {imported} photos added": "Importation Lightroom terminée : {imported} photos ajoutées", - "Lightroom import complete: {imported} photos added, {failed} failed": "Importation Lightroom terminée : {imported} photos ajoutées, {failed} échec(s)", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Importation Lightroom terminée : {imported} photos ajoutées ; avertissement d’index : {warning}", "Lightroom import failed: {e}{warning}": "Échec de l’importation Lightroom : {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Échec de l’analyse Lightroom : {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT ou Apache-2.0. Polices : {} (OFL). Icônes : originales.", @@ -279,8 +276,22 @@ "· {in_source} identical copies": "· {in_source} copies identiques", "{count} more warnings.": "{count} avertissements supplémentaires.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} photos du catalogue sont dans « Supprimés récemment » de cette photothèque et y restent ; restaurez-les depuis « Supprimés récemment » pour les voir.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Importation Lightroom terminée. {in_catalog} photos dans le catalogue : {parts}", + "{added} added": "{added} ajoutées", + "{already} already in the library": "{already} déjà dans la photothèque", + "{in_trash} in Recently Deleted": "{in_trash} dans « Supprimés récemment »", + "{not_supported} not supported": "{not_supported} non prises en charge", + "{path_refused} on refused paths": "{path_refused} aux chemins refusés", + "{incomplete} incomplete": "{incomplete} incomplètes", + "{failed} failed": "{failed} échec(s)", + "{message}; index warning: {warning}": "{message} ; avertissement d’index : {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} photos dans le catalogue, copies virtuelles comprises ; {collections} collections.", + "{added} added to the library.": "{added} ajoutées à la photothèque.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} photos du catalogue étaient déjà dans cette photothèque et ont été mises à jour depuis le catalogue.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} photos du catalogue n’ont pas été importées : LightCraft ne lit pas leurs types de fichiers.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} photos du catalogue n’ont pas été importées : LightCraft ne lit pas leurs types de fichiers ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} photos du catalogue n’ont pas été importées : leurs originaux sont sur un autre ordinateur ou un périphérique, ou leurs chemins dans le catalogue ne sont pas valides. Les avertissements les listent.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} images du catalogue n’ont pas été importées, car leurs entrées dans le catalogue sont incomplètes.", - "{photos} catalog records processed; {collections} collections.": "{photos} entrées du catalogue traitées ; {collections} collections.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} originaux sont manquants. Leurs entrées de catalogue sont disponibles ; utilisez Rechercher les photos manquantes pour rétablir les liens.", "Applied {name}": "{name} appliqué", "Delete “{name}”?": "Supprimer « {name} » ?", diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index 7bd027cc352..edc5e50ea4a 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -130,9 +130,6 @@ "Build Standard-Sized Previews ({scope})": "Buat pratinjau ukuran standar ({scope})", "Discard Smart Previews ({scope})": "Buang pratinjau pintar ({scope})", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Katalog Lightroom diperiksa: {photos} foto, {collections} koleksi, {missing} hilang", - "Lightroom import complete: {imported} photos added": "Impor Lightroom selesai: {imported} foto ditambahkan", - "Lightroom import complete: {imported} photos added, {failed} failed": "Impor Lightroom selesai: {imported} foto ditambahkan, {failed} gagal", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Impor Lightroom selesai: {imported} foto ditambahkan; peringatan indeks: {warning}", "Lightroom import failed: {e}{warning}": "Impor Lightroom gagal: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Pemeriksaan Lightroom gagal: {e}{warning}", "Label Set: {name}": "Set label: {name}", @@ -278,7 +275,6 @@ "{n} originals opened in the other editor": "{n} file asli dibuka di editor lain", "· {in_source} identical copies": "· {in_source} salinan identik", "{count} more warnings.": "{count} peringatan lainnya.", - "{photos} catalog records processed; {collections} collections.": "{photos} entri katalog diproses; {collections} koleksi.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} file asli hilang. Data katalognya masih tersedia; gunakan “Cari foto hilang” untuk menautkannya ulang.", "Applied {name}": "{name} diterapkan", "Delete “{name}”?": "Hapus “{name}”?", @@ -303,6 +299,21 @@ "{what} merge added at {mp}: its full size, {full}, needs more memory than this computer has": "Hasil penggabungan {what} ditambahkan dengan resolusi {mp}: resolusi penuhnya ({full}) memerlukan memori melebihi kapasitas komputer ini", "{what} merge added at {mp}, the largest a panorama can be (its full size is {full})": "Hasil penggabungan {what} ditambahkan dengan resolusi {mp}, resolusi maksimum untuk panorama (resolusi penuhnya {full})", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} foto katalog ada di Baru dihapus pada pustaka ini dan tetap di sana; pulihkan dari Baru dihapus untuk melihatnya.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Impor Lightroom selesai. {in_catalog} foto di katalog: {parts}", + "{added} added": "{added} ditambahkan", + "{already} already in the library": "{already} sudah ada di pustaka", + "{in_trash} in Recently Deleted": "{in_trash} di Baru dihapus", + "{not_supported} not supported": "{not_supported} tidak didukung", + "{path_refused} on refused paths": "{path_refused} di jalur yang ditolak", + "{incomplete} incomplete": "{incomplete} tidak lengkap", + "{failed} failed": "{failed} gagal", + "{message}; index warning: {warning}": "{message}; peringatan indeks: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} foto di katalog, termasuk salinan virtual; {collections} koleksi.", + "{added} added to the library.": "{added} ditambahkan ke pustaka.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} foto katalog sudah ada di pustaka ini dan diperbarui dari katalog.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} foto katalog tidak diimpor: LightCraft tidak membaca jenis file-nya.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} foto katalog tidak diimpor: LightCraft tidak membaca jenis file-nya ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} foto katalog tidak diimpor: file aslinya ada di komputer atau perangkat lain, atau jalurnya di katalog tidak valid. Peringatan mencantumkannya.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "Listing folders — folders: {folders}, files: {files}": "Mendata folder — folder: {folders}, file: {files}", "Added {n} photo{}": "{n} foto ditambahkan{:.0}", diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index 922bac810df..b0e8c236bba 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -80,9 +80,6 @@ "LightCraft could not open its window: {e}": "LightCraft non è riuscito ad aprire la sua finestra: {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft non è riuscito ad aprire la sua finestra: {e}\n\nI dettagli sono nel file di log: {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Catalogo di Lightroom esaminato: foto {photos}, raccolte {collections}, mancanti {missing}", - "Lightroom import complete: {imported} photos added": "Importazione da Lightroom completata: foto aggiunte {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Importazione da Lightroom completata: foto aggiunte {imported}, con errori {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Importazione da Lightroom completata: foto aggiunte {imported}; avviso sull'indice: {warning}", "Lightroom import failed: {e}{warning}": "Importazione da Lightroom non riuscita: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Analisi di Lightroom non riuscita: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Caratteri: {} (OFL). Icone: originali.", @@ -257,6 +254,21 @@ "Delete {n} effect preset{}? This can't be undone.": "Eliminare i preset effetto ({n})?{:.0} L'operazione non si può annullare.", "{count} more warnings.": "Altri avvisi: {count}.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} foto del catalogo sono in Eliminate di recente di questa libreria e vi restano; ripristinale da Eliminate di recente per vederle.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Importazione da Lightroom completata. Foto nel catalogo: {in_catalog} — {parts}", + "{added} added": "aggiunte {added}", + "{already} already in the library": "già nella libreria {already}", + "{in_trash} in Recently Deleted": "in Eliminate di recente {in_trash}", + "{not_supported} not supported": "non supportate {not_supported}", + "{path_refused} on refused paths": "con percorsi rifiutati {path_refused}", + "{incomplete} incomplete": "incomplete {incomplete}", + "{failed} failed": "con errori {failed}", + "{message}; index warning: {warning}": "{message}; avviso sull'indice: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Foto nel catalogo, copie virtuali incluse: {in_catalog}; raccolte: {collections}.", + "{added} added to the library.": "Aggiunte alla libreria: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "Foto del catalogo già in questa libreria, aggiornate dal catalogo: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Foto del catalogo non importate perché LightCraft non legge i loro tipi di file: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Foto del catalogo non importate perché LightCraft non legge i loro tipi di file ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Foto del catalogo non importate perché i loro originali sono su un altro computer o su un dispositivo, o i loro percorsi nel catalogo non sono validi: {path_refused}. Gli avvisi le elencano.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} immagini del catalogo non sono state importate perché i loro record nel catalogo sono incompleti.", "· {in_source} identical copies": "· copie identiche: {in_source}", "{what} merge added at {mp}, the largest a panorama can be (its full size is {full})": "Unione {what} aggiunta a {mp}, la dimensione massima di un panorama (la dimensione piena è {full})", @@ -272,7 +284,6 @@ "new, inside {parent}": "nuova, dentro {parent}", "Delete these {n} effect presets?": "Eliminare questi preset effetto ({n})?", "Imported {e} mask effect{} (Masking ▸ Effect)": "Imported {e} mask effect{} (Masking → Effect)", - "{photos} catalog records processed; {collections} collections.": "Record del catalogo elaborati: {photos}; raccolte: {collections}.", "Skipped {problem}": "Saltato: {problem}", "Updated {name}": "{name} aggiornato", "The XMP sidecars of {n} photos couldn't be written (is their folder offline?). LightCraft keeps trying.": "Non è stato possibile scrivere i file XMP di alcune foto ({n}): la loro cartella è scollegata? LightCraft continua a riprovare.", diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index 9f7dd3fe7cc..b3eb29ee59c 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -132,9 +132,6 @@ "Build Standard-Sized Previews ({scope})": "標準プレビューを作成({scope})", "Discard Smart Previews ({scope})": "スマートプレビューを破棄({scope})", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Lightroom カタログを確認しました:写真 {photos} 枚、コレクション {collections} 件、見つからないファイル {missing} 件", - "Lightroom import complete: {imported} photos added": "Lightroom の読み込みが完了しました:{imported} 枚の写真を追加", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom の読み込みが完了しました:{imported} 枚を追加、{failed} 枚が失敗", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom の読み込みが完了しました:{imported} 枚を追加。インデックスの警告:{warning}", "Lightroom import failed: {e}{warning}": "Lightroom の読み込みに失敗しました:{e}{warning}", "Lightroom inspection failed: {e}{warning}": "Lightroom の確認に失敗しました:{e}{warning}", "Label Set: {name}": "ラベルセット:{name}", @@ -283,8 +280,22 @@ "· {in_source} identical copies": "・同一のコピー {in_source} 件", "{count} more warnings.": "ほかに{count}件の警告があります。", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "カタログの写真 {in_trash} 枚は、このライブラリの「最近削除した写真」にあり、そのまま残ります。表示するには「最近削除した写真」から復元してください。", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom の読み込みが完了しました。カタログの写真 {in_catalog} 枚:{parts}", + "{added} added": "{added} 枚を追加", + "{already} already in the library": "{already} 枚はライブラリに既存", + "{in_trash} in Recently Deleted": "{in_trash} 枚は「最近削除した写真」内", + "{not_supported} not supported": "{not_supported} 枚は非対応", + "{path_refused} on refused paths": "{path_refused} 枚はパスを拒否", + "{incomplete} incomplete": "{incomplete} 枚は不完全", + "{failed} failed": "{failed} 枚が失敗", + "{message}; index warning: {warning}": "{message}。インデックスの警告:{warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "カタログの写真は {in_catalog} 枚(仮想コピーを含む)、コレクションは {collections} 件です。", + "{added} added to the library.": "{added} 枚をライブラリに追加しました。", + "{already} catalog photos were already in this library and were updated from the catalog.": "カタログの写真 {already} 枚はすでにこのライブラリにあり、カタログの内容で更新しました。", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "カタログの写真 {not_supported} 枚は読み込まれませんでした。LightCraft はそのファイル形式を読み込めません。", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "カタログの写真 {not_supported} 枚は読み込まれませんでした。LightCraft はそのファイル形式({types})を読み込めません。", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "カタログの写真 {path_refused} 枚は読み込まれませんでした。元画像が別のコンピューターやデバイス上にあるか、カタログ内のパスが無効です。警告に一覧があります。", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "カタログ内のレコードが不完全なため、{skipped}件の画像を読み込めませんでした。", - "{photos} catalog records processed; {collections} collections.": "カタログの{photos}件のレコードを処理しました。コレクションは{collections}件です。", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing}件のオリジナルが見つかりません。カタログのレコードは利用できます。「見つからない写真を検索」で再リンクしてください。", "Applied {name}": "{name} を適用しました", "Delete “{name}”?": "「{name}」を削除しますか?", diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index b13dc07d30d..60b22e3e8cb 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -99,9 +99,6 @@ "Lightroom geometry for {path} was not preserved; saved Upright transform is unsupported.": "{path}-ისთვის Lightroom-ის გეომეტრია არ შენარჩუნდა; Upright-ის შენახული გარდაქმნა არ არის მხარდაჭერილი.", "Lightroom geometry for {path} was not preserved; saved transform is ignored because Upright is Off.": "{path}-ისთვის Lightroom-ის გეომეტრია არ შენარჩუნდა; შენახული გარდაქმნა იგნორირებულია, რადგან Upright გამორთულია.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "{path}-ისთვის Lightroom-ის გეომეტრია არ შენარჩუნდა; {mode} ხელახლა გამოითვლება.", - "Lightroom import complete: {imported} photos added": "Lightroom-იდან იმპორტი დასრულდა: დაემატა ფოტო: {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom-იდან იმპორტი დასრულდა: დაემატა ფოტო: {imported}, ვერ მოხერხდა: {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom-იდან იმპორტი დასრულდა: დაემატა ფოტო: {imported}; ინდექსის გაფრთხილება: {warning}", "Lightroom import failed: {e}{warning}": "Lightroom-იდან იმპორტი ვერ მოხერხდა: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Lightroom-ის შემოწმება ვერ მოხერხდა: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. შრიფტები: {} (OFL). ხატულები: ორიგინალური.", @@ -287,6 +284,21 @@ "new, inside {parent}": "ახალი, {parent}-ის შიგნით", "{count} more warnings.": "კიდევ გაფრთხილება: {count}.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "კატალოგის ფოტოები ამ ბიბლიოთეკის ახლახან წაშლილებში: {in_trash}. ისინი იქ რჩება; სანახავად აღადგინეთ ისინი ახლახან წაშლილებიდან.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom-იდან იმპორტი დასრულდა. ფოტოები კატალოგში: {in_catalog} — {parts}", + "{added} added": "დაემატა: {added}", + "{already} already in the library": "უკვე ბიბლიოთეკაშია: {already}", + "{in_trash} in Recently Deleted": "ახლახან წაშლილებში: {in_trash}", + "{not_supported} not supported": "მხარდაუჭერელი: {not_supported}", + "{path_refused} on refused paths": "უარყოფილი ბილიკით: {path_refused}", + "{incomplete} incomplete": "არასრული: {incomplete}", + "{failed} failed": "ვერ მოხერხდა: {failed}", + "{message}; index warning: {warning}": "{message}; ინდექსის გაფრთხილება: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "ფოტოები კატალოგში, ვირტუალური ასლების ჩათვლით: {in_catalog}; კოლექციები: {collections}.", + "{added} added to the library.": "დაემატა ბიბლიოთეკას: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "კატალოგის ფოტოები, რომლებიც უკვე იყო ამ ბიბლიოთეკაში და განახლდა კატალოგიდან: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ფაილის ტიპებს LightCraft ვერ კითხულობს: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ფაილის ტიპებს LightCraft ვერ კითხულობს ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ორიგინალები სხვა კომპიუტერზე ან მოწყობილობაზეა, ან რომელთა ბილიკები კატალოგში არასწორია: {path_refused}. ისინი გაფრთხილებებშია ჩამოთვლილი.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "კატალოგის {skipped} სურათი არ დაიმპორტდა, რადგან მათი ჩანაწერები კატალოგში არასრულია.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "დაკარგულია ორიგინალი: {missing}. მათი კატალოგის ჩანაწერები ხელმისაწვდომია; ხელახლა დასაკავშირებლად გამოიყენეთ „დაკარგული ფოტოების მოძებნა“.", "{n} JPEG files": "JPEG ფაილი: {n}", @@ -295,7 +307,6 @@ "{n} photo{} in view · {slides} slide{} · {time}": "ფოტო ხედში: {n} · სლაიდი: {slides} · {time}{:.0}{:.0}", "{n} preset{}": "პრესეტი: {n}{:.0}", "{n} raws can now be developed from their raw data": "RAW ფაილების ({n}) დამუშავება ახლა მათი RAW მონაცემებიდან შეიძლება", - "{photos} catalog records processed; {collections} collections.": "დამუშავდა კატალოგის ჩანაწერი: {photos}; კოლექცია: {collections}.", "{s} s of AV1 video": "{s} წმ AV1 ვიდეო", "{what} merge added at {mp}, the largest a panorama can be (its full size is {full})": "{what}: გაერთიანება დაემატა {mp} ზომით, რაც პანორამის მაქსიმუმია (მისი სრული ზომაა {full})", "{what} merge added at {mp}: its full size, {full}, needs more memory than this computer has": "{what}: გაერთიანება დაემატა {mp} ზომით: მის სრულ ზომას, {full}, იმაზე მეტი მეხსიერება სჭირდება, ვიდრე ამ კომპიუტერს აქვს", diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index f03219ae1eb..f47fa539e1b 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -73,9 +73,6 @@ "LightCraft could not open its window: {e}": "LightCraft nie mógł otworzyć okna: {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft nie mógł otworzyć okna: {e}\n\nSzczegóły znajdują się w pliku dziennika: {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Sprawdzono katalog Lightroom — zdjęcia: {photos}, kolekcje: {collections}, brakujące: {missing}", - "Lightroom import complete: {imported} photos added": "Import z Lightroom zakończony — dodane zdjęcia: {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Import z Lightroom zakończony — dodane zdjęcia: {imported}, błędy: {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Import z Lightroom zakończony — dodane zdjęcia: {imported}; ostrzeżenie indeksu: {warning}", "Lightroom import failed: {e}{warning}": "Import z Lightroom nieudany: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Sprawdzanie katalogu Lightroom nieudane: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT lub Apache-2.0. Czcionki: {} (OFL). Ikony: oryginalne.", @@ -268,8 +265,22 @@ "{n} preset{}": "Ustawienia: {n}{:.0}", "{count} more warnings.": "Pozostałe ostrzeżenia: {count}.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "Zdjęcia katalogu w Ostatnio usuniętych tej biblioteki: {in_trash}. Pozostają tam; przywróć je z Ostatnio usuniętych, aby je zobaczyć.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Import z Lightroom zakończony. Zdjęcia w katalogu: {in_catalog} — {parts}", + "{added} added": "dodane: {added}", + "{already} already in the library": "już w bibliotece: {already}", + "{in_trash} in Recently Deleted": "w Ostatnio usuniętych: {in_trash}", + "{not_supported} not supported": "nieobsługiwane: {not_supported}", + "{path_refused} on refused paths": "z odrzuconą ścieżką: {path_refused}", + "{incomplete} incomplete": "niekompletne: {incomplete}", + "{failed} failed": "błędy: {failed}", + "{message}; index warning: {warning}": "{message}; ostrzeżenie indeksu: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Zdjęcia w katalogu, z wirtualnymi kopiami: {in_catalog}; kolekcje: {collections}.", + "{added} added to the library.": "Dodane do biblioteki: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "Zdjęcia katalogu, które już były w tej bibliotece i zostały zaktualizowane z katalogu: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Niezaimportowane zdjęcia katalogu, których typów plików LightCraft nie odczytuje: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Niezaimportowane zdjęcia katalogu, których typów plików LightCraft nie odczytuje ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Niezaimportowane zdjęcia katalogu, których oryginały są na innym komputerze lub urządzeniu albo których ścieżki w katalogu są nieprawidłowe: {path_refused}. Ostrzeżenia je wymieniają.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Nie zaimportowano obrazów z katalogu: {skipped}. Ich rekordy w katalogu są niekompletne.", - "{photos} catalog records processed; {collections} collections.": "Przetworzone rekordy katalogu: {photos}; kolekcje: {collections}.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Brakujące oryginały: {missing}. Ich rekordy w katalogu są dostępne; użyj polecenia Znajdź brakujące zdjęcia, aby je ponownie powiązać.", "Applied {name}": "Zastosowano {name}", "Delete “{name}”?": "Usunąć „{name}”?", diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index 762eed671a3..0d765b9f4c4 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -51,9 +51,6 @@ "Imported {n} preset{}, {f} file{} not readable": "{n} predefinição(ões) importada(s){:.0}, {f} arquivo(s) não legível(is){:.0}", "Imported {} photo{}": "{0} foto{1} importada{1}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Catálogo do Lightroom inspecionado: {photos} fotos, {collections} coleções, {missing} ausentes", - "Lightroom import complete: {imported} photos added": "Importação do Lightroom concluída: {imported} fotos adicionadas", - "Lightroom import complete: {imported} photos added, {failed} failed": "Importação do Lightroom concluída: {imported} fotos adicionadas, {failed} com falha", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Importação do Lightroom concluída: {imported} fotos adicionadas; aviso do índice: {warning}", "Lightroom import failed: {e}{warning}": "Falha na importação do Lightroom: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Falha na inspeção do Lightroom: {e}{warning}", "Label Set: {name}": "Conjunto de rótulos: {name}", @@ -283,8 +280,22 @@ "· {in_source} identical copies": "· {in_source} cópias idênticas", "{count} more warnings.": "Mais {count} avisos.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} fotos do catálogo estão em Excluídos recentemente desta biblioteca e continuam lá; restaure-as de Excluídos recentemente para vê-las.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Importação do Lightroom concluída. {in_catalog} fotos no catálogo: {parts}", + "{added} added": "{added} adicionadas", + "{already} already in the library": "{already} já na biblioteca", + "{in_trash} in Recently Deleted": "{in_trash} em Excluídos recentemente", + "{not_supported} not supported": "{not_supported} não compatíveis", + "{path_refused} on refused paths": "{path_refused} com caminhos recusados", + "{incomplete} incomplete": "{incomplete} incompletas", + "{failed} failed": "{failed} com falha", + "{message}; index warning: {warning}": "{message}; aviso do índice: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} fotos no catálogo, cópias virtuais incluídas; {collections} coleções.", + "{added} added to the library.": "{added} adicionadas à biblioteca.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} fotos do catálogo já estavam nesta biblioteca e foram atualizadas a partir do catálogo.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} fotos do catálogo não foram importadas: o LightCraft não lê seus tipos de arquivo.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} fotos do catálogo não foram importadas: o LightCraft não lê seus tipos de arquivo ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} fotos do catálogo não foram importadas: seus originais estão em outro computador ou em um dispositivo, ou seus caminhos no catálogo não são válidos. Os avisos as listam.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} imagens do catálogo não foram importadas porque seus registros no catálogo estão incompletos.", - "{photos} catalog records processed; {collections} collections.": "{photos} registros do catálogo processados; {collections} coleções.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} originais estão ausentes. Seus registros no catálogo estão disponíveis; use Encontrar fotos ausentes para vinculá-los novamente.", "Applied {name}": "{name} aplicado", "Delete “{name}”?": "Excluir “{name}”?", diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 24134de9440..5bdd76fa55d 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -87,9 +87,6 @@ "LightCraft could not open its window: {e}": "LightCraft не удалось открыть окно: {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft не удалось открыть окно: {e}\n\nПодробности в файле журнала: {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Каталог Lightroom проверен: фото — {photos}, коллекций — {collections}, отсутствует — {missing}", - "Lightroom import complete: {imported} photos added": "Импорт из Lightroom завершён: добавлено фото — {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Импорт из Lightroom завершён: добавлено фото — {imported}, ошибок — {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Импорт из Lightroom завершён: добавлено фото — {imported}; предупреждение индекса: {warning}", "Lightroom import failed: {e}{warning}": "Ошибка импорта из Lightroom: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Ошибка проверки Lightroom: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Шрифты: {} (OFL). Значки: оригинальные.", @@ -279,8 +276,22 @@ "· {in_source} identical copies": "· идентичных копий: {in_source}", "{count} more warnings.": "Других предупреждений: {count}.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "Фото каталога в «Недавно удалённых» этой библиотеки: {in_trash}. Они остаются там; чтобы увидеть их, восстановите их из «Недавно удалённых».", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Импорт из Lightroom завершён. Фото в каталоге: {in_catalog} — {parts}", + "{added} added": "добавлено: {added}", + "{already} already in the library": "уже в библиотеке: {already}", + "{in_trash} in Recently Deleted": "в «Недавно удалённых»: {in_trash}", + "{not_supported} not supported": "не поддерживается: {not_supported}", + "{path_refused} on refused paths": "с отклонённым путём: {path_refused}", + "{incomplete} incomplete": "неполных: {incomplete}", + "{failed} failed": "ошибок: {failed}", + "{message}; index warning: {warning}": "{message}; предупреждение индекса: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Фото в каталоге, включая виртуальные копии: {in_catalog}; коллекций: {collections}.", + "{added} added to the library.": "Добавлено в библиотеку: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "Фото каталога, которые уже были в этой библиотеке и обновлены из каталога: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Не импортированы фото каталога, типы файлов которых LightCraft не читает: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Не импортированы фото каталога, типы файлов которых LightCraft не читает ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Не импортированы фото каталога, оригиналы которых находятся на другом компьютере или устройстве или пути которых в каталоге недопустимы: {path_refused}. Они перечислены в предупреждениях.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Не импортированы изображения каталога: {skipped}. Их записи в каталоге неполные.", - "{photos} catalog records processed; {collections} collections.": "Обработано записей каталога: {photos}; коллекций: {collections}.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Не найдены оригиналы: {missing}. Их записи каталога доступны; используйте поиск отсутствующих фотографий, чтобы восстановить ссылки.", "Applied {name}": "Применено: {name}", "Delete “{name}”?": "Удалить «{name}»?", diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index e205ea56a93..e8fa073e339 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -117,9 +117,6 @@ "Lightroom geometry for {path} was not preserved; saved transform is ignored because Upright is Off.": "Lightroom-geometrin för {path} bevarades inte; den sparade transformeringen ignoreras eftersom Upright är av.", "Lightroom geometry for {path} was not preserved; saved Upright transform is unsupported.": "Lightroom-geometrin för {path} bevarades inte; sparad Upright-transformering stöds inte.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Lightroom-geometrin bevarades inte för {path}; {mode} beräknas om.", - "Lightroom import complete: {imported} photos added": "Lightroom-importen är klar: {imported} foton har lagts till", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom-importen är klar: {imported} foton har lagts till, {failed} misslyckades", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom-importen är klar: {imported} foton har lagts till; indexvarning: {warning}", "Lightroom import failed: {e}{warning}": "Lightroom-importen misslyckades: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Granskningen av Lightroom misslyckades: {e}{warning}", "Making the denoised picture… {}%": "Skapar den brusreducerade bilden… {}%", @@ -251,7 +248,6 @@ "{n} tasks are still running: {names}. Quitting stops them.": "{n} uppgifter körs fortfarande: {names}. Om du avslutar stoppas de.", "{n} {noun}": "{n} {noun}", "{pct} %": "{pct} %", - "{photos} catalog records processed; {collections} collections.": "{photos} katalogposter bearbetade; {collections} samlingar.", "{pid} (missing)": "{pid} (saknas)", "{sel_n} selected · {counted}": "Markerade: {sel_n} · {counted}", "{size} GB": "{size} GB", @@ -303,6 +299,21 @@ "Moved {n} photo{} to “{}”. Edit → Undo moves them back.": "Moved {n} photo{} to “{}”. Edit → Undo moves them back.", "{n} selected photos · {pages} pages": "{n} selected photos · {pages} pages", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} katalogfoton finns i Nyligen raderade i det här biblioteket och ligger kvar där; återställ dem från Nyligen raderade för att se dem.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom-importen är klar. {in_catalog} foton i katalogen: {parts}", + "{added} added": "{added} tillagda", + "{already} already in the library": "{already} redan i biblioteket", + "{in_trash} in Recently Deleted": "{in_trash} i Nyligen raderade", + "{not_supported} not supported": "{not_supported} stöds inte", + "{path_refused} on refused paths": "{path_refused} med nekade sökvägar", + "{incomplete} incomplete": "{incomplete} ofullständiga", + "{failed} failed": "{failed} misslyckades", + "{message}; index warning: {warning}": "{message}; indexvarning: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} foton i katalogen, virtuella kopior inräknade; {collections} samlingar.", + "{added} added to the library.": "{added} har lagts till i biblioteket.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} katalogfoton fanns redan i det här biblioteket och har uppdaterats från katalogen.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} katalogfoton importerades inte: LightCraft läser inte deras filtyper.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} katalogfoton importerades inte: LightCraft läser inte deras filtyper ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} katalogfoton importerades inte: deras original finns på en annan dator eller en enhet, eller så är deras sökvägar i katalogen ogiltiga. Varningarna listar dem.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "Listing folders — folders: {folders}, files: {files}": "Listar mappar — mappar: {folders}, filer: {files}", "Added {n} photo{}": "{n} foto tillagda{:.0}", diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index d30091f2d2b..dea0f836a75 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -83,9 +83,6 @@ "LightCraft could not open its window: {e}": "LightCraft не вдалося відкрити вікно: {e}", "LightCraft could not open its window: {e}\n\nThe log file has the details: {path}": "LightCraft не вдалося відкрити вікно: {e}\n\nПодробиці у файлі журналу: {path}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "Каталог Lightroom перевірено: фото — {photos}, колекцій — {collections}, відсутні — {missing}", - "Lightroom import complete: {imported} photos added": "Імпорт Lightroom завершено: додано фото — {imported}", - "Lightroom import complete: {imported} photos added, {failed} failed": "Імпорт Lightroom завершено: додано фото — {imported}, помилок — {failed}", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Імпорт Lightroom завершено: додано фото — {imported}; попередження індексу: {warning}", "Lightroom import failed: {e}{warning}": "Помилка імпорту Lightroom: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Помилка перевірки Lightroom: {e}{warning}", "MIT OR Apache-2.0. Fonts: {} (OFL). Icons: original.": "MIT OR Apache-2.0. Шрифти: {} (OFL). Значки: оригінальні.", @@ -279,8 +276,22 @@ "· {in_source} identical copies": "· ідентичних копій: {in_source}", "{count} more warnings.": "Інших попереджень: {count}.", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "Фото каталогу в нещодавно видалених цієї бібліотеки: {in_trash}. Вони залишаються там; щоб побачити їх, відновіть їх із нещодавно видалених.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Імпорт Lightroom завершено. Фото в каталозі: {in_catalog} — {parts}", + "{added} added": "додано: {added}", + "{already} already in the library": "уже в бібліотеці: {already}", + "{in_trash} in Recently Deleted": "у нещодавно видалених: {in_trash}", + "{not_supported} not supported": "не підтримується: {not_supported}", + "{path_refused} on refused paths": "з відхиленим шляхом: {path_refused}", + "{incomplete} incomplete": "неповних: {incomplete}", + "{failed} failed": "помилок: {failed}", + "{message}; index warning: {warning}": "{message}; попередження індексу: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Фото в каталозі, разом із віртуальними копіями: {in_catalog}; колекцій: {collections}.", + "{added} added to the library.": "Додано до бібліотеки: {added}.", + "{already} catalog photos were already in this library and were updated from the catalog.": "Фото каталогу, які вже були в цій бібліотеці й оновлені з каталогу: {already}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Не імпортовано фото каталогу, типи файлів яких LightCraft не читає: {not_supported}.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Не імпортовано фото каталогу, типи файлів яких LightCraft не читає ({types}): {not_supported}.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Не імпортовано фото каталогу, оригінали яких на іншому комп’ютері чи пристрої або шляхи яких у каталозі недійсні: {path_refused}. Їх перелічено в попередженнях.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Не імпортовано зображення каталогу: {skipped}. Їхні записи в каталозі неповні.", - "{photos} catalog records processed; {collections} collections.": "Оброблено записів каталогу: {photos}; колекцій: {collections}.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Не знайдено оригінали: {missing}. Їхні записи каталогу доступні; скористайтеся пошуком відсутніх фотографій, щоб відновити посилання.", "Applied {name}": "Застосовано: {name}", "Delete “{name}”?": "Видалити «{name}»?", diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index d6c686c3b54..a75af84c934 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -120,9 +120,6 @@ "Lightroom geometry for {path} was not preserved; saved Upright transform is unsupported.": "Hình học Lightroom cho {path} không được giữ; biến đổi Upright đã lưu không được hỗ trợ.", "Lightroom geometry for {path} was not preserved; saved transform is ignored because Upright is Off.": "Hình học Lightroom cho {path} không được giữ; biến đổi đã lưu bị bỏ qua vì Upright đang tắt.", "Lightroom geometry was not preserved for {path}; {mode} will be recalculated.": "Hình học Lightroom cho {path} không được giữ; {mode} sẽ được tính lại.", - "Lightroom import complete: {imported} photos added": "Nhập Lightroom xong: đã thêm {imported} ảnh", - "Lightroom import complete: {imported} photos added, {failed} failed": "Nhập Lightroom xong: đã thêm {imported} ảnh, {failed} thất bại", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Nhập Lightroom xong: đã thêm {imported} ảnh; cảnh báo chỉ mục: {warning}", "Lightroom import failed: {e}{warning}": "Nhập Lightroom thất bại: {e}{warning}", "Lightroom inspection failed: {e}{warning}": "Kiểm tra Lightroom thất bại: {e}{warning}", "Listing folders — folders: {folders}, files: {files}": "Đang liệt kê thư mục — thư mục: {folders}, tệp: {files}", @@ -259,11 +256,25 @@ "{n} tasks are still running: {names}. Quitting stops them.": "Còn {n} tác vụ đang chạy: {names}. Thoát sẽ dừng chúng.", "{n} {noun}": "{noun}: {n}", "{pct} %": "{pct} %", - "{photos} catalog records processed; {collections} collections.": "{photos} catalog records processed; {collections} collections.", "{pid} (missing)": "{pid} (thiếu)", "{sel_n} selected · {counted}": "Đã chọn {sel_n} · {counted}", "{size} GB": "{size} GB", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "{in_trash} ảnh của danh mục nằm trong Đã xóa gần đây của thư viện này và vẫn ở đó; hãy khôi phục chúng từ Đã xóa gần đây để xem.", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Nhập Lightroom xong. {in_catalog} ảnh trong danh mục: {parts}", + "{added} added": "đã thêm {added}", + "{already} already in the library": "{already} đã có trong thư viện", + "{in_trash} in Recently Deleted": "{in_trash} trong Đã xóa gần đây", + "{not_supported} not supported": "{not_supported} không được hỗ trợ", + "{path_refused} on refused paths": "{path_refused} ở đường dẫn bị từ chối", + "{incomplete} incomplete": "{incomplete} không đầy đủ", + "{failed} failed": "{failed} thất bại", + "{message}; index warning: {warning}": "{message}; cảnh báo chỉ mục: {warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} ảnh trong danh mục, kể cả bản sao ảo; {collections} bộ sưu tập.", + "{added} added to the library.": "Đã thêm {added} vào thư viện.", + "{already} catalog photos were already in this library and were updated from the catalog.": "{already} ảnh của danh mục đã có trong thư viện này và được cập nhật từ danh mục.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} ảnh của danh mục không được nhập: LightCraft không đọc được loại tệp của chúng.", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} ảnh của danh mục không được nhập: LightCraft không đọc được loại tệp của chúng ({types}).", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} ảnh của danh mục không được nhập: bản gốc của chúng nằm trên máy tính hoặc thiết bị khác, hoặc đường dẫn của chúng trong danh mục không hợp lệ. Các cảnh báo liệt kê chúng.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "{stage}… {:.0}%": "{stage}… {:.0}%", "{s} s of AV1 video": "{s} s of AV1 video", diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index 1d5f27c5764..a1b95bedaf4 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -132,9 +132,6 @@ "Build Standard-Sized Previews ({scope})": "生成标准尺寸预览({scope})", "Discard Smart Previews ({scope})": "丢弃智能预览({scope})", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "已检查 Lightroom 目录:{photos} 张照片,{collections} 个收藏夹,{missing} 个缺失", - "Lightroom import complete: {imported} photos added": "Lightroom 导入完成:已添加 {imported} 张照片", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom 导入完成:已添加 {imported} 张照片,{failed} 张失败", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom 导入完成:已添加 {imported} 张照片;索引警告:{warning}", "Lightroom import failed: {e}{warning}": "Lightroom 导入失败:{e}{warning}", "Lightroom inspection failed: {e}{warning}": "Lightroom 检查失败:{e}{warning}", "Label Set: {name}": "标签集:{name}", @@ -283,8 +280,22 @@ "· {in_source} identical copies": "· {in_source} 个相同副本", "{count} more warnings.": "另有 {count} 条警告。", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "目录中有 {in_trash} 张照片位于此图库的“最近删除”中,并将保留在那里;如需查看,请从“最近删除”中恢复。", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom 导入完成。目录中有 {in_catalog} 张照片:{parts}", + "{added} added": "已添加 {added} 张", + "{already} already in the library": "{already} 张已在图库中", + "{in_trash} in Recently Deleted": "{in_trash} 张在“最近删除”中", + "{not_supported} not supported": "{not_supported} 张不受支持", + "{path_refused} on refused paths": "{path_refused} 张路径被拒绝", + "{incomplete} incomplete": "{incomplete} 张不完整", + "{failed} failed": "{failed} 张失败", + "{message}; index warning: {warning}": "{message};索引警告:{warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "目录中有 {in_catalog} 张照片(含虚拟副本);{collections} 个收藏集。", + "{added} added to the library.": "已将 {added} 张添加到图库。", + "{already} catalog photos were already in this library and were updated from the catalog.": "目录中有 {already} 张照片已在此图库中,并已根据目录更新。", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "目录中有 {not_supported} 张照片未导入:LightCraft 无法读取其文件类型。", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "目录中有 {not_supported} 张照片未导入:LightCraft 无法读取其文件类型({types})。", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "目录中有 {path_refused} 张照片未导入:其原始文件位于其他计算机或设备上,或其在目录中的路径无效。警告中列出了它们。", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "有 {skipped} 张图像未导入,因为它们在目录中的记录不完整。", - "{photos} catalog records processed; {collections} collections.": "已处理 {photos} 条目录记录;{collections} 个收藏集。", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "有 {missing} 个原始文件缺失。其目录记录可用;请使用“查找缺失照片”重新链接文件。", "Applied {name}": "已应用 {name}", "Delete “{name}”?": "删除“{name}”?", diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index 51fb1109ae4..7d18de822c1 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -48,9 +48,6 @@ "Imported {n} preset{}, {f} file{} not readable": "已匯入 {n} 個預設集{:.0},{f} 個檔案無法讀取{:.0}", "Imported {} photo{}": "已匯入 {} 張照片{:.0}", "Lightroom catalog inspected: {photos} photos, {collections} collections, {missing} missing": "已檢查 Lightroom 目錄:{photos} 張相片,{collections} 個收藏集,{missing} 個遺失", - "Lightroom import complete: {imported} photos added": "Lightroom 匯入完成:已加入 {imported} 張相片", - "Lightroom import complete: {imported} photos added, {failed} failed": "Lightroom 匯入完成:已加入 {imported} 張相片,{failed} 張失敗", - "Lightroom import complete: {imported} photos added; index warning: {warning}": "Lightroom 匯入完成:已加入 {imported} 張相片;索引警告:{warning}", "Lightroom import failed: {e}{warning}": "Lightroom 匯入失敗:{e}{warning}", "Lightroom inspection failed: {e}{warning}": "Lightroom 檢查失敗:{e}{warning}", "Label Set: {name}": "標籤集:{name}", @@ -283,8 +280,22 @@ "· {in_source} identical copies": "· {in_source} 個相同副本", "{count} more warnings.": "另有 {count} 則警告。", "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.": "目錄中有 {in_trash} 張照片位於此圖庫的「最近刪除」中,並會保留在那裡;如需檢視,請從「最近刪除」中復原。", + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}": "Lightroom 匯入完成。目錄中有 {in_catalog} 張相片:{parts}", + "{added} added": "已加入 {added} 張", + "{already} already in the library": "{already} 張已在圖庫中", + "{in_trash} in Recently Deleted": "{in_trash} 張在「最近刪除」中", + "{not_supported} not supported": "{not_supported} 張不受支援", + "{path_refused} on refused paths": "{path_refused} 張路徑遭拒", + "{incomplete} incomplete": "{incomplete} 張不完整", + "{failed} failed": "{failed} 張失敗", + "{message}; index warning: {warning}": "{message};索引警告:{warning}", + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "目錄中有 {in_catalog} 張相片(含虛擬副本);{collections} 個收藏集。", + "{added} added to the library.": "已將 {added} 張加入圖庫。", + "{already} catalog photos were already in this library and were updated from the catalog.": "目錄中有 {already} 張相片已在此圖庫中,並已依目錄更新。", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "目錄中有 {not_supported} 張相片未匯入:LightCraft 無法讀取其檔案類型。", + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "目錄中有 {not_supported} 張相片未匯入:LightCraft 無法讀取其檔案類型({types})。", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "目錄中有 {path_refused} 張相片未匯入:其原始檔案位於其他電腦或裝置上,或其在目錄中的路徑無效。警告中列出了它們。", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "有 {skipped} 張影像未匯入,因為它們在目錄中的記錄不完整。", - "{photos} catalog records processed; {collections} collections.": "已處理 {photos} 筆目錄記錄;{collections} 個收藏集。", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "有 {missing} 個原始檔案遺失。其目錄記錄可用;請使用「尋找遺失相片」重新連結檔案。", "Applied {name}": "已套用 {name}", "Delete “{name}”?": "刪除「{name}」?", diff --git a/crates/ui-egui/src/lightroom_import.rs b/crates/ui-egui/src/lightroom_import.rs index 895becd9b50..12c8da3637c 100644 --- a/crates/ui-egui/src/lightroom_import.rs +++ b/crates/ui-egui/src/lightroom_import.rs @@ -287,20 +287,10 @@ fn terminal(app: &mut LightcraftApp, ctx: &egui::Context, task: &LightroomTask, missing = missing ) } else { - let report = value.get("report").unwrap_or(&value); - let imported = report["imported"].as_u64().unwrap_or(0); - let failed = report["failed"].as_array().map_or(0, Vec::len); - let warning = value.get("indexWarning").and_then(Value::as_str); - if let Some(warning) = warning { - crate::i18n::tr_format!( - "Lightroom import complete: {imported} photos added; index warning: {warning}", - imported = imported, - warning = warning - ) - } else if failed == 0 { - crate::i18n::tr_format!("Lightroom import complete: {imported} photos added", imported = imported) - } else { - crate::i18n::tr_format!("Lightroom import complete: {imported} photos added, {failed} failed", imported = imported, failed = failed) + let message = import_summary(value.get("report").unwrap_or(&value)); + match value.get("indexWarning").and_then(Value::as_str) { + Some(warning) => crate::i18n::tr_format!("{message}; index warning: {warning}", message = message, warning = warning), + None => message, } }; if matches!(kind, Kind::Import) && value.get("cancelled") != Some(&Value::Bool(true)) { @@ -312,43 +302,107 @@ fn terminal(app: &mut LightcraftApp, ctx: &egui::Context, task: &LightroomTask, app.toast_for(ctx, message, 6.0); } +/// The toast for a finished import: how many photos the catalog has and what became of them, the +/// photos added and then each other outcome there is (the report's breakdown, see +/// `lightroom_catalog::apply_prepared`). +fn import_summary(report: &Value) -> String { + let count = |key: &str| report[key].as_u64().unwrap_or(0); + let mut parts = vec![crate::i18n::tr_format!("{added} added", added = count("added"))]; + let already = count("alreadyInLibrary"); + if already > 0 { + parts.push(crate::i18n::tr_format!("{already} already in the library", already = already)); + } + let in_trash = count("inRecentlyDeleted"); + if in_trash > 0 { + parts.push(crate::i18n::tr_format!("{in_trash} in Recently Deleted", in_trash = in_trash)); + } + let not_supported = count("notSupported"); + if not_supported > 0 { + parts.push(crate::i18n::tr_format!("{not_supported} not supported", not_supported = not_supported)); + } + let path_refused = count("pathRefused"); + if path_refused > 0 { + parts.push(crate::i18n::tr_format!("{path_refused} on refused paths", path_refused = path_refused)); + } + let incomplete = count("incomplete"); + if incomplete > 0 { + parts.push(crate::i18n::tr_format!("{incomplete} incomplete", incomplete = incomplete)); + } + let failed = report["failed"].as_array().map_or(0, Vec::len); + if failed > 0 { + parts.push(crate::i18n::tr_format!("{failed} failed", failed = failed)); + } + crate::i18n::tr_format!( + "Lightroom import complete. {in_catalog} photos in the catalog: {parts}", + in_catalog = count("inCatalog"), + parts = parts.join(", ") + ) +} + fn show_result(app: &mut LightcraftApp) { if app.ui.dialog.is_none() { app.ui.dialog = app.lightroom_result.take(); } } -/// The lasting result window for an inspect or import: counts, failures, missing originals, the -/// skipped images (one line, in the UI language) and at most eight warnings. Show in Library goes -/// to the lowest mapped photo that is not in Recently Deleted, where All Photos can show it. +/// The lasting result window for an import: how many photos the catalog has and where each went +/// (one line per outcome there is, adding up to the catalog's photos), failures, missing +/// originals and at most eight warnings. Show in Library goes to the lowest mapped photo that is +/// not in Recently Deleted, where All Photos can show it. fn result_dialog(value: &Value, summary: &str, catalog: &lightcraft_catalog::Catalog) -> crate::state::Dialog { let report = value.get("report").unwrap_or(value); + let count = |key: &str| report[key].as_u64().unwrap_or(0); let mut details = Vec::new(); - if let Some(photos) = report["photos"].as_u64() { + if let Some(in_catalog) = report["inCatalog"].as_u64() { details.push(crate::i18n::tr_format!( - "{photos} catalog records processed; {collections} collections.", - photos = photos, - collections = report["collections"].as_u64().unwrap_or(0) + "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.", + in_catalog = in_catalog, + collections = count("collections") )); } - if let Some(failures) = report["failed"].as_array() { - details - .extend(failures.iter().take(4).map(|failure| format!("{}: {}", failure[0].as_str().unwrap_or(""), failure[1].as_str().unwrap_or("")))); + let added = count("added"); + if added > 0 { + details.push(crate::i18n::tr_format!("{added} added to the library.", added = added)); } - let missing = report["missing"].as_array().map_or(0, Vec::len); - if missing > 0 { + let already = count("alreadyInLibrary"); + if already > 0 { details.push(crate::i18n::tr_format!( - "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.", - missing = missing + "{already} catalog photos were already in this library and were updated from the catalog.", + already = already )); } - let in_trash = report["inRecentlyDeleted"].as_u64().unwrap_or(0); + let in_trash = count("inRecentlyDeleted"); if in_trash > 0 { details.push(crate::i18n::tr_format!( "{in_trash} catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.", in_trash = in_trash )); } + let not_supported = count("notSupported"); + if not_supported > 0 { + // the file types, as the files name them (MP4, MOV); one without an extension isn't named + let types: Vec = + report["notSupportedTypes"].as_object().into_iter().flatten().map(|(ext, _)| ext.to_uppercase()).filter(|ext| !ext.is_empty()).collect(); + details.push(if types.is_empty() { + crate::i18n::tr_format!( + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.", + not_supported = not_supported + ) + } else { + crate::i18n::tr_format!( + "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).", + not_supported = not_supported, + types = types.join(", ") + ) + }); + } + let path_refused = count("pathRefused"); + if path_refused > 0 { + details.push(crate::i18n::tr_format!( + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.", + path_refused = path_refused + )); + } // images whose catalog records are incomplete come as data (`skipped`), said here in the UI // language; their ids are in the report for the CLI and agents let skipped = report["skipped"].as_array().map_or(0, Vec::len); @@ -358,6 +412,17 @@ fn result_dialog(value: &Value, summary: &str, catalog: &lightcraft_catalog::Cat skipped = skipped )); } + let missing = report["missing"].as_array().map_or(0, Vec::len); + if missing > 0 { + details.push(crate::i18n::tr_format!( + "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.", + missing = missing + )); + } + if let Some(failures) = report["failed"].as_array() { + details + .extend(failures.iter().take(4).map(|failure| format!("{}: {}", failure[0].as_str().unwrap_or(""), failure[1].as_str().unwrap_or("")))); + } if let Some(warning) = value.get("indexWarning").and_then(Value::as_str) { details.push(warning.to_string()); } @@ -664,9 +729,9 @@ mod tests { rules: vec![lightcraft_catalog::rules::Rule::Field { field: "rating".into(), op: "is".into(), value: json!(5) }], }); let (task, _tx, _, _) = fake_import(&h); - let value = json!({"photos": 1, "imported": 1, "collections": 0, "missing": ["D:/Photos/a.NEF"], "mapping": {"1": id}, "library": "C:/Pictures/LightCraft Library"}); + let value = json!({"photos": 1, "imported": 1, "inCatalog": 1, "added": 1, "collections": 0, "missing": ["D:/Photos/a.NEF"], "mapping": {"1": id}, "library": "C:/Pictures/LightCraft Library"}); terminal(&mut h.app, &h.view.ctx, &task, value); - assert!(h.app.ui.toast.as_ref().unwrap().0.contains("1 photos added")); + assert!(h.app.ui.toast.as_ref().unwrap().0.contains("1 photos in the catalog: 1 added")); h.step(); h.step(); let text = h.painted_text().join(" "); @@ -751,25 +816,65 @@ mod tests { let crate::state::Dialog::LightroomResult { details: en, .. } = result_dialog(&value, "done", &Default::default()) else { panic!("not a Lightroom result") }; - assert_eq!(en.len(), 4, "{en:?}"); - assert_eq!(en[1], "3 catalog images were not imported because their records in the catalog are incomplete."); - assert_eq!(&en[2..], ["w1", "w2"]); + assert_eq!(en.len(), 3, "{en:?}"); + assert_eq!(en[0], "3 catalog images were not imported because their records in the catalog are incomplete."); + assert_eq!(&en[1..], ["w1", "w2"]); } + /// A report with one catalog photo per outcome (see `lightroom_catalog::apply_prepared`). + fn every_outcome() -> Value { + json!({"report": {"photos": 3, "collections": 2, "inCatalog": 8, "added": 2, "alreadyInLibrary": 1, "inRecentlyDeleted": 1, + "notSupported": 2, "notSupportedTypes": {"mov": 1, "mp4": 1}, "pathRefused": 1, "incomplete": 1, + "skipped": [{"image": 8, "reason": "missingFile"}], "missing": ["/a.ARW"], "failed": [], "warnings": []}}) + } + + /// The result window says where each of the catalog's photos went, one line per outcome there + /// is, so an import that adds fewer photos than the catalog has explains the rest (#2589, #1584). #[test] - fn photos_left_in_recently_deleted_are_one_line() { - let value = json!({"report": {"photos": 3, "collections": 0, "inRecentlyDeleted": 2}}); + fn the_result_lists_each_outcome_there_is() { crate::i18n::set_language(crate::i18n::Locale::En); - let crate::state::Dialog::LightroomResult { details, .. } = result_dialog(&value, "done", &Default::default()) else { + let crate::state::Dialog::LightroomResult { details, .. } = result_dialog(&every_outcome(), "done", &Default::default()) else { panic!("not a Lightroom result") }; - assert_eq!(details.len(), 2, "{details:?}"); - assert!(details[1].starts_with("2 catalog photos are in this library's Recently Deleted"), "{details:?}"); - let value = json!({"report": {"photos": 3, "collections": 0, "inRecentlyDeleted": 0}}); + assert_eq!( + details, + [ + "8 photos in the catalog, virtual copies included; 2 collections.", + "2 added to the library.", + "1 catalog photos were already in this library and were updated from the catalog.", + "1 catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.", + "2 catalog photos were not imported: LightCraft doesn't read their file types (MOV, MP4).", + "1 catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.", + "1 catalog images were not imported because their records in the catalog are incomplete.", + "1 originals are missing. Their catalog records are available; use Find Missing Photos to relink them.", + ] + ); + // an outcome no photo had gets no line + let value = + json!({"report": {"inCatalog": 3, "collections": 0, "added": 0, "alreadyInLibrary": 3, "inRecentlyDeleted": 0, "notSupported": 0}}); let crate::state::Dialog::LightroomResult { details, .. } = result_dialog(&value, "done", &Default::default()) else { panic!("not a Lightroom result") }; - assert_eq!(details.len(), 1, "no line when none are: {details:?}"); + assert_eq!(details.len(), 2, "{details:?}"); + assert!(details[1].starts_with("3 catalog photos were already in this library"), "{details:?}"); + } + + /// The toast counts the catalog's photos and names each outcome besides the photos added only + /// when some photo had it: "nothing happened" was "0 added" (#1584). + #[test] + fn the_toast_reconciles_the_catalog() { + crate::i18n::set_language(crate::i18n::Locale::En); + let report = json!({"inCatalog": 45091, "added": 16521, "alreadyInLibrary": 812, "inRecentlyDeleted": 0, "failed": []}); + assert_eq!(import_summary(&report), "Lightroom import complete. 45091 photos in the catalog: 16521 added, 812 already in the library"); + let report = json!({"inCatalog": 5, "added": 0, "alreadyInLibrary": 5}); + assert_eq!(import_summary(&report), "Lightroom import complete. 5 photos in the catalog: 0 added, 5 already in the library"); + let mut report = every_outcome()["report"].clone(); + report["failed"] = json!([["/b.ARW", "unreadable"]]); + assert_eq!( + import_summary(&report), + "Lightroom import complete. 8 photos in the catalog: 2 added, 1 already in the library, 1 in Recently Deleted, 2 not supported, \ + 1 on refused paths, 1 incomplete, 1 failed" + ); } #[test] @@ -798,6 +903,8 @@ mod tests { collection_content: Vec::new(), warnings: vec!["warning".into()], skipped: Vec::new(), + images: 0, + not_supported: Default::default(), }); assert_eq!(report["photos"], 0); assert_eq!(report["collections"], 0); diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index d2316d17bc9..a71c5440485 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -54,7 +54,24 @@ lightcraft-cli run --library "LightCraft Library" library.importLightroom path=" The import itself (`library.importLightroom`, `lightcraft-cli run`) adds records to the currently open LightCraft library; only the desktop window above can make a new library for it first. The desktop result stays open until dismissed and -shows the destination library, the number of records added, missing originals and warnings. +shows the destination library, where each of the catalog's photos went, missing originals and warnings. + +**Where the photos went** (issues #2589, #1584). The report accounts for every image of the catalog, once: +`inCatalog` is the catalog's image count (its `Adobe_images` rows: masters and virtual copies, as Lightroom's All +Photographs counts them), and these add up to it: + +| Report key | Catalog photos that… | +|---|---| +| `added` | became new library records (offline originals and virtual copies included), or whose record this import's file import made, or browsed Local photos that joined the library | +| `alreadyInLibrary` | matched a library photo (by path, or by the import index on reimport); the record is updated in place | +| `inRecentlyDeleted` | matched a library photo in Recently Deleted; it stays there | +| `notSupported` | aren't a file type LightCraft reads (videos, for one), with their virtual copies; `notSupportedTypes` counts them by extension | +| `pathRefused` | have an original the import doesn't look at (below), with their virtual copies; no record is made | +| `incomplete` | have incomplete catalog records (`skipped`) | + +Should the counts not add up, a warning says by how much. `imported` (records added, as before) stays in the report +and normally equals `added`. The toast says, for example, "45091 photos in the catalog: 16521 added, 812 already in +the library" (only the outcomes some photo had, then failures); the result window has one line per outcome. **Show in Library** opens All Photos, clears filters and selects an imported record (not one left in Recently Deleted; the button is left out when every record is there). Errors stay readable in the same result window. If another dialog is open, the result waits until that dialog closes. The result @@ -162,8 +179,10 @@ Original and root folder paths are resolved with the catalog as the document and only when they are on this computer or on the network share the catalog itself is on (`crates/engine/src/doc_path.rs`). An original on another computer (`\\server\share\…`, `//server/…`, `file://server/…`), a device path, or one whose folder or file name in the catalog is -an absolute path is not looked at: the import lists it as missing with a warning and leaves the -photo and its virtual copies out of the library. To import originals on a share, open the catalog +an absolute path is not looked at: the import leaves the photo and its virtual copies out of the library, with a +warning naming it, and counts them as `pathRefused`. They get no record because a record would have the app look at +that path later (previews, Find Missing Photos), which is what the refusal prevents; so they are not listed as missing +either. To import originals on a share, open the catalog from that share. A path that is not a path on this computer (a Windows drive path read on macOS or Linux) is not looked at either and stays catalogued as missing. diff --git a/docs/whats-new.md b/docs/whats-new.md index f3339263784..1cf62c3518a 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -156,6 +156,15 @@ inside the corrected photo, as in Lightroom, so no grey corners or edge marks show. Perspective corrections still need Constrain Crop to do the same. +### A Lightroom catalog import says where every photo went +- When a catalog import finishes, the message counts the catalog's photos (virtual copies included) and how many + were added, and also how many were already in the library, are in Recently Deleted, aren't a file type LightCraft + reads, have paths it doesn't open, or have incomplete catalog records, when there are any. The result window gives + each of these its own line, and the lines add up to the catalog's photos. Before, it gave only the photos added, so + an import of a large catalog seemed to lose photos, and re-importing one already in the library seemed to do + nothing. Photos on another computer or a device are no longer reported as missing originals for Find Missing + Photos, which had no record to relink them to. + ### The Flatpak may talk to the accessibility bus - The Flatpak package now has access to the accessibility bus (`org.a11y.Bus`) and no other new permission; its network, Pictures folder and GPU access are unchanged. Without it the sandbox hid the bus, which AccessKit needs to reach a screen reader such as Orca; this has not been tried with Orca yet. The Flatpak build is the only one affected. From 603618a44531f8cb56298198366ff15cec73dab8 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Tue, 27 Oct 2026 10:39:27 -0500 Subject: [PATCH 06/22] fix(lightroom): refused-path warnings no longer say "listed as missing" (#2589) Since the import counts an original on a refused path as `pathRefused` and leaves it out of `missing`, the root-folder and image warnings that said its photos are "listed as missing and not added" were wrong. They now say the photos (an image with its virtual copies) are not imported. Tests: the refused-root and absolute-folder cases check the new wording and that no warning mentions missing. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 5 ++--- crates/engine/src/lightroom_catalog/tests.rs | 13 +++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 0c04f1206b0..4321bac7515 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -613,8 +613,7 @@ fn read_file(path: &Path, document: &Path, source: &Path, cancel: &AtomicBool, d None => absolute.to_string(), }; if let Err(crate::doc_path::NotFollowed::Refused(why)) = crate::doc_path::resolve(&resolved, Some(document)) { - warnings - .push(format!("root folder {}: {resolved} is not opened: {why}; its photos are listed as missing and not added", text(root, "name"))); + warnings.push(format!("root folder {}: {resolved} is not opened: {why}; its photos are not imported", text(root, "name"))); refused_roots.insert(id); } root_paths.insert(id, resolved); @@ -669,7 +668,7 @@ fn read_file(path: &Path, document: &Path, source: &Path, cancel: &AtomicBool, d if let Original::Refused(why) = &original && !refused_roots.contains(&root_id) { - out.warnings.push(format!("image {id}: {photo_path} is not opened: {why}; listed as missing and not added")); + out.warnings.push(format!("image {id}: {photo_path} is not opened: {why}; it and its virtual copies are not imported")); } let packet = match xmp(metadata.get(&id).and_then(|r| r.get("xmp"))) { Ok(s) => s, diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index 5c1af5dbf7e..251d5e6a492 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -1926,7 +1926,13 @@ fn originals_on_other_computers_are_never_looked_at_or_added() { std::fs::write(&source, native_catalog(&photo_tables((root, "")))).unwrap(); let catalog = read(&source).unwrap(); assert!(matches!(catalog.photos[0].original, Original::Refused(_)), "{root}: {:?}", catalog.photos[0]); - assert!(catalog.warnings.iter().any(|w| w.contains("not opened")), "{root}: {:?}", catalog.warnings); + // counted as `pathRefused`, not as missing (#2589) + assert!( + catalog.warnings.iter().any(|w| w.contains("not opened") && w.ends_with("its photos are not imported")), + "{root}: {:?}", + catalog.warnings + ); + assert!(!catalog.warnings.iter().any(|w| w.contains("missing")), "{root}: {:?}", catalog.warnings); let mut s = crate::Session::new(); let probes = Arc::new(AtomicUsize::new(0)); let calls = probes.clone(); @@ -1945,7 +1951,10 @@ fn originals_on_other_computers_are_never_looked_at_or_added() { let mut tables = photo_tables((dir.to_str().unwrap(), "")); tables[1].2[2] = SqlValue::Text(format!("{}/Photos/", dir.display())); std::fs::write(&source, native_catalog(&tables)).unwrap(); - assert!(matches!(read(&source).unwrap().photos[0].original, Original::Refused(_))); + let catalog = read(&source).unwrap(); + assert!(matches!(catalog.photos[0].original, Original::Refused(_))); + assert!(catalog.warnings.iter().any(|w| w.ends_with("it and its virtual copies are not imported")), "{:?}", catalog.warnings); + assert!(!catalog.warnings.iter().any(|w| w.contains("missing")), "{:?}", catalog.warnings); // A root beside the catalog is followed. std::fs::write(&source, native_catalog(&photo_tables((dir.to_str().unwrap(), "")))).unwrap(); let catalog = read(&source).unwrap(); From 49966a1ee61a90d4f50602146b65cbb7f24025d1 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Thu, 29 Oct 2026 23:58:41 -0500 Subject: [PATCH 07/22] fix(lightroom): a refused photo with id 0 refuses only itself (#2589) `masterImage` is 0 for every master, so a refused photo whose id reads as 0 (a malformed catalog) counted every master as `pathRefused` and imported none of them; the totals still added up, so no warning said so. The refused-master check now skips 0, as `refuse_non_media` already does. The `Original::Refused` doc no longer says the photo is reported missing. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 8 +++++--- crates/engine/src/lightroom_catalog/tests.rs | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 4321bac7515..a2b516c101d 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -171,7 +171,8 @@ pub enum Original { #[default] NotHere, /// `path` is refused (why): it is on another computer or a device, or its folder or file name - /// is an absolute path. The photo is reported missing and not added to the library. + /// is an absolute path. The photo gets no library record, so it isn't reported missing either: + /// the import counts it in `pathRefused`. Refused(String), } @@ -1292,8 +1293,9 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co let master = number(&src.image, "masterImage"); // A refused path must not become a library record the app would look at later; its // virtual copies go with it. Having no record, it isn't missing (Find Missing Photos has - // nothing to relink): it is counted on its own. - if refused.contains(&src.source_id) || refused.contains(&master) { + // nothing to relink): it is counted on its own. (`masterImage` is 0 for a master, so a + // refused id of 0, from a malformed catalog, must not refuse every master.) + if refused.contains(&src.source_id) || (master != 0 && refused.contains(&master)) { path_refused += 1; continue; } diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index 251d5e6a492..43e4cccec8a 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -647,6 +647,24 @@ fn the_report_accounts_for_every_catalog_image_once() { let counts = ["added", "alreadyInLibrary", "inRecentlyDeleted"].map(|k| again[k].as_u64().unwrap()); assert_eq!(counts, [0, 3, 1], "{again}"); } +/// A refused photo whose id reads as 0 (a malformed catalog) refuses only itself and its own +/// copies: `masterImage` is 0 for every master, so every master was counted as refused (#2589). +#[test] +fn a_refused_photo_with_id_zero_refuses_only_itself() { + let mut s = crate::Session::new(); + let mut data = sample(); + let mut far = data.photos[1].clone(); + far.source_id = 0; + far.uuid = "image-0".into(); + far.path = "//server/share/far.ARW".into(); + far.image = row(json!({"id_local": 0, "fileFormat": "ARW"})); + far.original = Original::Refused("it is on another computer".into()); + data.photos.push(far); + data.images = 3; + let r = apply(&mut s, data, false).unwrap(); + assert_eq!((r["added"].as_u64(), r["pathRefused"].as_u64()), (Some(2), Some(1)), "the master and its copy are added: {r}"); + assert_eq!(s.catalog.len(), 2, "{r}"); +} /// Counts that don't add up to the catalog's images say so instead of passing silently. #[test] From 236fb68a0d0d53ed33461bb11c6e9acd45ec46d7 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Sat, 31 Oct 2026 22:17:11 -0500 Subject: [PATCH 08/22] docs(lightroom): a catalog video is a record now, not "not supported" (#2589) Main now imports a video the catalog lists as one (format VIDEO with a video extension) as a video record, so it counts in `added`. The `notSupported` docs no longer give videos as the example; the report test's MP4 is a file the catalog doesn't list as a video. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 6 +++--- crates/engine/src/lightroom_catalog/tests.rs | 3 ++- docs/lightroom-catalog-import.md | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index a2b516c101d..0a5cbfde22f 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -209,9 +209,9 @@ pub struct CatalogImport { /// Lightroom's All Photographs counts them). The import report accounts for each one. #[serde(default)] pub images: usize, - /// Catalog images left out because their original isn't a file type LightCraft reads (videos, - /// for one), counted by the original's extension in lower case ("" for none); a virtual copy - /// counts under its master's. Their ids are in [`CatalogImport::warnings`]. + /// Catalog images left out because their original isn't a file type LightCraft reads (a + /// document or a program; a video the catalog lists as one becomes a video record), counted by + /// the original's extension in lower case ("" for none); a virtual copy counts under its master's. Their ids are in [`CatalogImport::warnings`]. #[serde(default)] pub not_supported: BTreeMap, } diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index 43e4cccec8a..d5447f80812 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -610,7 +610,8 @@ fn the_report_accounts_for_every_catalog_image_once() { data.photos.extend([ photo(3, "/library/kept.ARW", 0), photo(4, "/library/trashed.ARW", 0), - // a video and its virtual copy + // a file type LightCraft doesn't read (an MP4 the catalog doesn't list as a video) and its + // virtual copy photo(5, "/Videos/clip.MP4", 0), photo(6, "/Videos/clip.MP4", 5), far, diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index a71c5440485..50e4c6b5797 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -65,7 +65,7 @@ Photographs counts them), and these add up to it: | `added` | became new library records (offline originals and virtual copies included), or whose record this import's file import made, or browsed Local photos that joined the library | | `alreadyInLibrary` | matched a library photo (by path, or by the import index on reimport); the record is updated in place | | `inRecentlyDeleted` | matched a library photo in Recently Deleted; it stays there | -| `notSupported` | aren't a file type LightCraft reads (videos, for one), with their virtual copies; `notSupportedTypes` counts them by extension | +| `notSupported` | aren't a file type LightCraft reads (a document or a program; a video the catalog lists as one becomes a video record, in `added`), with their virtual copies; `notSupportedTypes` counts them by extension | | `pathRefused` | have an original the import doesn't look at (below), with their virtual copies; no record is made | | `incomplete` | have incomplete catalog records (`skipped`) | From fa5c815e259c8d1684b2b28ddcbcdbf9714852ed Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Mon, 2 Nov 2026 09:35:32 -0600 Subject: [PATCH 09/22] fix(lightroom): the result window names at most eight unsupported file types (#2589) The result window's other lines are bounded however large the catalog: one per outcome, a count of the missing originals, four failures, eight warnings and a count of the rest. The line for the photos LightCraft doesn't read named every file type the catalog has, so a catalog naming thousands of extensions made it thousands of names long. It now names eight and ends the rest with an ellipsis. Test: a 100,000-photo report with 1,000 unsupported types, 1,000 missing originals, 1,000 failures and 100,000 warnings gives a window of 16 lines. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/lightroom_import.rs | 34 ++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/lightroom_import.rs b/crates/ui-egui/src/lightroom_import.rs index 12c8da3637c..a21ce64cabb 100644 --- a/crates/ui-egui/src/lightroom_import.rs +++ b/crates/ui-egui/src/lightroom_import.rs @@ -380,9 +380,14 @@ fn result_dialog(value: &Value, summary: &str, catalog: &lightcraft_catalog::Cat } let not_supported = count("notSupported"); if not_supported > 0 { - // the file types, as the files name them (MP4, MOV); one without an extension isn't named - let types: Vec = + // the file types, as the files name them (MP4, MOV); one without an extension isn't named, + // and past eight the rest are an ellipsis (a crafted catalog can name thousands) + let mut types: Vec = report["notSupportedTypes"].as_object().into_iter().flatten().map(|(ext, _)| ext.to_uppercase()).filter(|ext| !ext.is_empty()).collect(); + if types.len() > 8 { + types.truncate(8); + types.push("…".into()); + } details.push(if types.is_empty() { crate::i18n::tr_format!( "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.", @@ -859,6 +864,31 @@ mod tests { assert!(details[1].starts_with("3 catalog photos were already in this library"), "{details:?}"); } + /// However many photos and file types a catalog has, the result window has a line per outcome: + /// the file types LightCraft doesn't read are named up to eight, and per-photo lists (missing + /// originals, failures, warnings) are counted or cut short (#2589). + #[test] + fn a_catalog_of_100000_photos_gets_a_bounded_result() { + crate::i18n::set_language(crate::i18n::Locale::En); + let types: serde_json::Map = (0..1000).map(|i| (format!("x{i:04}"), json!(100))).collect(); + let missing: Vec<_> = (0..1000).map(|i| format!("/gone/{i}.ARW")).collect(); + let failed: Vec<_> = (0..1000).map(|i| json!([format!("/bad/{i}.ARW"), "unreadable"])).collect(); + let warnings: Vec<_> = (0..100_000).map(|i| format!("image {i}: not imported")).collect(); + let value = json!({"report": {"inCatalog": 100_000, "collections": 0, "added": 0, "notSupported": 100_000, "notSupportedTypes": types, + "missing": missing, "failed": failed, "warnings": warnings}}); + let crate::state::Dialog::LightroomResult { details, .. } = result_dialog(&value, "done", &Default::default()) else { + panic!("not a Lightroom result") + }; + // the catalog, the unsupported types, the missing originals, 4 failures, 8 warnings and the rest counted + assert_eq!(details.len(), 1 + 1 + 1 + 4 + 8 + 1, "{details:?}"); + assert_eq!( + details[1], + "100000 catalog photos were not imported: LightCraft doesn't read their file types (X0000, X0001, X0002, X0003, X0004, X0005, X0006, X0007, …)." + ); + assert_eq!(details[2], "1000 originals are missing. Their catalog records are available; use Find Missing Photos to relink them."); + assert_eq!(details.last().map(String::as_str), Some("99992 more warnings.")); + } + /// The toast counts the catalog's photos and names each outcome besides the photos added only /// when some photo had it: "nothing happened" was "0 added" (#1584). #[test] From 0c981d5e977c7492dfd1d7fb8ecf040bc33c3936 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:31:23 -0600 Subject: [PATCH 10/22] fix(lightroom): inspecting a catalog doesn't list refused paths as missing (#2589) The import gives a photo on a refused path no record and counts it in `pathRefused`, not `missing`; inspecting the catalog (the desktop's Inspect and `library.inspectLightroom`) still listed it as missing. Both now use `CatalogPhoto::original_is_missing`: not a file here, and not refused. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/library/specs.rs | 2 +- crates/engine/src/lightroom_catalog.rs | 6 +++ crates/engine/src/lightroom_catalog/tests.rs | 3 ++ crates/ui-egui/src/lightroom_import.rs | 41 +++++++++++++++++++- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/library/specs.rs b/crates/engine/src/cmd/library/specs.rs index bbd618f9f1a..05680f5d3db 100644 --- a/crates/engine/src/cmd/library/specs.rs +++ b/crates/engine/src/cmd/library/specs.rs @@ -1309,7 +1309,7 @@ pub fn specs() -> Vec { let temp = crate::lightroom_catalog::backup_temp_root(s); let data = crate::lightroom_catalog::read_source(std::path::Path::new(path), temp.as_deref(), &cancel, &total, &done) .map_err(|e| bad("library.inspectLightroom",e))?; - Ok(json!({"photos":data.photos.len(),"collections":data.collections.iter().filter(|r|r.get("systemOnly").and_then(Value::as_f64).unwrap_or(0.0)==0.0).count(),"missing":data.photos.iter().filter(|p| !p.original_is_file()).map(|p|&p.path).collect::>(),"warnings":data.warnings,"skipped":data.skipped})) + Ok(json!({"photos":data.photos.len(),"collections":data.collections.iter().filter(|r|r.get("systemOnly").and_then(Value::as_f64).unwrap_or(0.0)==0.0).count(),"missing":data.photos.iter().filter(|p| p.original_is_missing()).map(|p|&p.path).collect::>(),"warnings":data.warnings,"skipped":data.skipped})) }), cmd!( "library.importLightroom", diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 0a5cbfde22f..f397ea811c4 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -181,6 +181,12 @@ impl CatalogPhoto { pub fn original_is_file(&self) -> bool { self.original == Original::Local && Path::new(&self.path).is_file() } + + /// Whether an inspection lists the original as missing, as the import does: it isn't a file + /// here and isn't on a refused path (which gets no record, see [`Original::Refused`]). + pub fn original_is_missing(&self) -> bool { + !matches!(self.original, Original::Refused(_)) && !self.original_is_file() + } } #[derive(Clone, Debug, Serialize, Deserialize)] diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index d5447f80812..27b34192754 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -1953,6 +1953,9 @@ fn originals_on_other_computers_are_never_looked_at_or_added() { ); assert!(!catalog.warnings.iter().any(|w| w.contains("missing")), "{root}: {:?}", catalog.warnings); let mut s = crate::Session::new(); + // inspecting the catalog doesn't list it as missing either + let inspected = s.execute("library.inspectLightroom", &json!({"path": source})).unwrap(); + assert_eq!(inspected["missing"], json!([]), "{root}: {inspected}"); let probes = Arc::new(AtomicUsize::new(0)); let calls = probes.clone(); s.media.file_probe = Some(Arc::new(move |_| { diff --git a/crates/ui-egui/src/lightroom_import.rs b/crates/ui-egui/src/lightroom_import.rs index a21ce64cabb..21e101eac57 100644 --- a/crates/ui-egui/src/lightroom_import.rs +++ b/crates/ui-egui/src/lightroom_import.rs @@ -246,13 +246,14 @@ fn spawn_finalize( } /// What `status` and the result window show for an inspected catalog: counts, missing originals, -/// warnings and skipped images. +/// warnings and skipped images (a photo on a refused path isn't missing, see +/// `CatalogPhoto::original_is_missing`). #[cfg(not(target_arch = "wasm32"))] fn inspect_report(data: lightcraft_engine::lightroom_catalog::CatalogImport) -> Value { json!({ "photos": data.photos.len(), "collections": data.collections.iter().filter(|r| r.get("systemOnly").and_then(Value::as_f64).unwrap_or(0.0) == 0.0).count(), - "missing": data.photos.iter().filter(|p| !p.original_is_file()).map(|p| &p.path).collect::>(), + "missing": data.photos.iter().filter(|p| p.original_is_missing()).map(|p| &p.path).collect::>(), "warnings": data.warnings, "skipped": data.skipped, }) @@ -941,4 +942,40 @@ mod tests { assert_eq!(report["missing"], serde_json::json!([])); assert_eq!(report["warnings"], serde_json::json!(["warning"])); } + + /// Inspecting a catalog lists as missing what the import would: an original on a refused path + /// gets no record (the import counts it in `pathRefused`), so it isn't missing; one that + /// isn't on this computer is (#2589). + #[test] + fn inspect_report_does_not_list_refused_paths_as_missing() { + use lightcraft_engine::lightroom_catalog::{CatalogPhoto, Original}; + let photo = |source_id, path: &str, original| CatalogPhoto { + source_id, + uuid: String::new(), + path: path.into(), + image: Default::default(), + settings: String::new(), + xmp: String::new(), + keywords: Vec::new(), + history: Vec::new(), + snapshots: Vec::new(), + original, + }; + let report = inspect_report(CatalogImport { + source: "synthetic.lrcat".into(), + photos: vec![ + photo(1, "//server/share/a.dng", Original::Refused("it is on another computer".into())), + photo(2, "D:/Photos/b.dng", Original::NotHere), + ], + collections: Vec::new(), + members: Vec::new(), + collection_content: Vec::new(), + warnings: Vec::new(), + skipped: Vec::new(), + images: 2, + not_supported: Default::default(), + }); + assert_eq!(report["photos"], 2); + assert_eq!(report["missing"], serde_json::json!(["D:/Photos/b.dng"])); + } } From e75c59b3ec3af7787dd97bf4c23d1e71615c53c7 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:31:23 -0600 Subject: [PATCH 11/22] fix(lightroom): the toast says unreadable originals apart from where photos went (#2589) An original that is there but can't be read is also one of the catalog's outcomes (a new one is added as a placeholder), so counting it among the parts made them add up to more than the catalog's photos ("1 added, 1 failed" for one photo). The toast now gives the parts, then "; N originals could not be read". Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/locales/cs-formats.json | 2 +- crates/ui-egui/locales/de-formats.json | 2 +- crates/ui-egui/locales/es-formats.json | 2 +- crates/ui-egui/locales/fi-formats.json | 2 +- crates/ui-egui/locales/fr-formats.json | 2 +- crates/ui-egui/locales/id-formats.json | 2 +- crates/ui-egui/locales/it-formats.json | 2 +- crates/ui-egui/locales/ja-formats.json | 2 +- crates/ui-egui/locales/ka-formats.json | 2 +- crates/ui-egui/locales/pl-formats.json | 2 +- crates/ui-egui/locales/pt-br-formats.json | 2 +- crates/ui-egui/locales/ru-formats.json | 2 +- crates/ui-egui/locales/sv-formats.json | 2 +- crates/ui-egui/locales/uk-formats.json | 2 +- crates/ui-egui/locales/vi-formats.json | 2 +- crates/ui-egui/locales/zh-hans-formats.json | 2 +- crates/ui-egui/locales/zh-hant-formats.json | 2 +- crates/ui-egui/src/lightroom_import.rs | 19 +++++++++++-------- docs/lightroom-catalog-import.md | 3 ++- 19 files changed, 30 insertions(+), 26 deletions(-) diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index 0c061be22e3..afd7627981c 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -278,7 +278,7 @@ "{not_supported} not supported": "nepodporováno: {not_supported}", "{path_refused} on refused paths": "s odmítnutou cestou: {path_refused}", "{incomplete} incomplete": "neúplné: {incomplete}", - "{failed} failed": "neúspěšné: {failed}", + "{message}; {failed} originals could not be read": "{message}; nečitelné originály: {failed}", "{message}; index warning: {warning}": "{message}; varování indexu: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Fotografií v katalogu včetně virtuálních kopií: {in_catalog}; kolekcí: {collections}.", "{added} added to the library.": "Přidáno do knihovny: {added}.", diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index 8c572860442..fcce0e3c83a 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -282,7 +282,7 @@ "{not_supported} not supported": "{not_supported} nicht unterstützt", "{path_refused} on refused paths": "{path_refused} mit abgelehnten Pfaden", "{incomplete} incomplete": "{incomplete} unvollständig", - "{failed} failed": "{failed} fehlgeschlagen", + "{message}; {failed} originals could not be read": "{message}; {failed} Originale konnten nicht gelesen werden", "{message}; index warning: {warning}": "{message}; Index-Warnung: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} Fotos im Katalog, virtuelle Kopien eingeschlossen; {collections} Sammlungen.", "{added} added to the library.": "{added} zur Bibliothek hinzugefügt.", diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index d08320002c8..1011fa6524e 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -283,7 +283,7 @@ "{not_supported} not supported": "{not_supported} no compatibles", "{path_refused} on refused paths": "{path_refused} con rutas rechazadas", "{incomplete} incomplete": "{incomplete} incompletas", - "{failed} failed": "{failed} con errores", + "{message}; {failed} originals could not be read": "{message}; no se pudieron leer {failed} originales", "{message}; index warning: {warning}": "{message}; aviso del índice: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} fotos en el catálogo, copias virtuales incluidas; {collections} colecciones.", "{added} added to the library.": "{added} añadidas a la biblioteca.", diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index a7570e772b8..a475fe8d6a3 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -267,7 +267,7 @@ "{not_supported} not supported": "ei tuettu {not_supported}", "{path_refused} on refused paths": "torjutuissa poluissa {path_refused}", "{incomplete} incomplete": "puutteellisia {incomplete}", - "{failed} failed": "epäonnistuneita {failed}", + "{message}; {failed} originals could not be read": "{message}; lukukelvottomia alkuperäisiä: {failed}", "{message}; index warning: {warning}": "{message}; hakemistovaroitus: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Kuvia katalogissa virtuaalikopiot mukaan lukien: {in_catalog}; kokoelmia: {collections}.", "{added} added to the library.": "Lisätty kirjastoon: {added}.", diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index 97b8c494120..21bb30461da 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -283,7 +283,7 @@ "{not_supported} not supported": "{not_supported} non prises en charge", "{path_refused} on refused paths": "{path_refused} aux chemins refusés", "{incomplete} incomplete": "{incomplete} incomplètes", - "{failed} failed": "{failed} échec(s)", + "{message}; {failed} originals could not be read": "{message} ; originaux illisibles : {failed}", "{message}; index warning: {warning}": "{message} ; avertissement d’index : {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} photos dans le catalogue, copies virtuelles comprises ; {collections} collections.", "{added} added to the library.": "{added} ajoutées à la photothèque.", diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index edc5e50ea4a..2cf231ee44c 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -306,7 +306,7 @@ "{not_supported} not supported": "{not_supported} tidak didukung", "{path_refused} on refused paths": "{path_refused} di jalur yang ditolak", "{incomplete} incomplete": "{incomplete} tidak lengkap", - "{failed} failed": "{failed} gagal", + "{message}; {failed} originals could not be read": "{message}; {failed} file asli tidak dapat dibaca", "{message}; index warning: {warning}": "{message}; peringatan indeks: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} foto di katalog, termasuk salinan virtual; {collections} koleksi.", "{added} added to the library.": "{added} ditambahkan ke pustaka.", diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index b0e8c236bba..b1c670b988b 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -261,7 +261,7 @@ "{not_supported} not supported": "non supportate {not_supported}", "{path_refused} on refused paths": "con percorsi rifiutati {path_refused}", "{incomplete} incomplete": "incomplete {incomplete}", - "{failed} failed": "con errori {failed}", + "{message}; {failed} originals could not be read": "{message}; originali non leggibili: {failed}", "{message}; index warning: {warning}": "{message}; avviso sull'indice: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Foto nel catalogo, copie virtuali incluse: {in_catalog}; raccolte: {collections}.", "{added} added to the library.": "Aggiunte alla libreria: {added}.", diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index b3eb29ee59c..87e997bc616 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -287,7 +287,7 @@ "{not_supported} not supported": "{not_supported} 枚は非対応", "{path_refused} on refused paths": "{path_refused} 枚はパスを拒否", "{incomplete} incomplete": "{incomplete} 枚は不完全", - "{failed} failed": "{failed} 枚が失敗", + "{message}; {failed} originals could not be read": "{message}。読み込めなかった元画像:{failed} 枚", "{message}; index warning: {warning}": "{message}。インデックスの警告:{warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "カタログの写真は {in_catalog} 枚(仮想コピーを含む)、コレクションは {collections} 件です。", "{added} added to the library.": "{added} 枚をライブラリに追加しました。", diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index 60b22e3e8cb..4a9531d02a2 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -291,7 +291,7 @@ "{not_supported} not supported": "მხარდაუჭერელი: {not_supported}", "{path_refused} on refused paths": "უარყოფილი ბილიკით: {path_refused}", "{incomplete} incomplete": "არასრული: {incomplete}", - "{failed} failed": "ვერ მოხერხდა: {failed}", + "{message}; {failed} originals could not be read": "{message}; ვერ წაიკითხა ორიგინალი: {failed}", "{message}; index warning: {warning}": "{message}; ინდექსის გაფრთხილება: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "ფოტოები კატალოგში, ვირტუალური ასლების ჩათვლით: {in_catalog}; კოლექციები: {collections}.", "{added} added to the library.": "დაემატა ბიბლიოთეკას: {added}.", diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index f47fa539e1b..d2dd958c840 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -272,7 +272,7 @@ "{not_supported} not supported": "nieobsługiwane: {not_supported}", "{path_refused} on refused paths": "z odrzuconą ścieżką: {path_refused}", "{incomplete} incomplete": "niekompletne: {incomplete}", - "{failed} failed": "błędy: {failed}", + "{message}; {failed} originals could not be read": "{message}; nieczytelne oryginały: {failed}", "{message}; index warning: {warning}": "{message}; ostrzeżenie indeksu: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Zdjęcia w katalogu, z wirtualnymi kopiami: {in_catalog}; kolekcje: {collections}.", "{added} added to the library.": "Dodane do biblioteki: {added}.", diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index 0d765b9f4c4..4812e11f35d 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -287,7 +287,7 @@ "{not_supported} not supported": "{not_supported} não compatíveis", "{path_refused} on refused paths": "{path_refused} com caminhos recusados", "{incomplete} incomplete": "{incomplete} incompletas", - "{failed} failed": "{failed} com falha", + "{message}; {failed} originals could not be read": "{message}; {failed} originais não puderam ser lidos", "{message}; index warning: {warning}": "{message}; aviso do índice: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} fotos no catálogo, cópias virtuais incluídas; {collections} coleções.", "{added} added to the library.": "{added} adicionadas à biblioteca.", diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 5bdd76fa55d..2b0f3b5f403 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -283,7 +283,7 @@ "{not_supported} not supported": "не поддерживается: {not_supported}", "{path_refused} on refused paths": "с отклонённым путём: {path_refused}", "{incomplete} incomplete": "неполных: {incomplete}", - "{failed} failed": "ошибок: {failed}", + "{message}; {failed} originals could not be read": "{message}; не удалось прочитать оригиналов: {failed}", "{message}; index warning: {warning}": "{message}; предупреждение индекса: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Фото в каталоге, включая виртуальные копии: {in_catalog}; коллекций: {collections}.", "{added} added to the library.": "Добавлено в библиотеку: {added}.", diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index e8fa073e339..1cc704a4898 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -306,7 +306,7 @@ "{not_supported} not supported": "{not_supported} stöds inte", "{path_refused} on refused paths": "{path_refused} med nekade sökvägar", "{incomplete} incomplete": "{incomplete} ofullständiga", - "{failed} failed": "{failed} misslyckades", + "{message}; {failed} originals could not be read": "{message}; {failed} original kunde inte läsas", "{message}; index warning: {warning}": "{message}; indexvarning: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} foton i katalogen, virtuella kopior inräknade; {collections} samlingar.", "{added} added to the library.": "{added} har lagts till i biblioteket.", diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index dea0f836a75..9da6aa67bbd 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -283,7 +283,7 @@ "{not_supported} not supported": "не підтримується: {not_supported}", "{path_refused} on refused paths": "з відхиленим шляхом: {path_refused}", "{incomplete} incomplete": "неповних: {incomplete}", - "{failed} failed": "помилок: {failed}", + "{message}; {failed} originals could not be read": "{message}; не вдалося прочитати оригіналів: {failed}", "{message}; index warning: {warning}": "{message}; попередження індексу: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "Фото в каталозі, разом із віртуальними копіями: {in_catalog}; колекцій: {collections}.", "{added} added to the library.": "Додано до бібліотеки: {added}.", diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index a75af84c934..4338e6a40be 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -267,7 +267,7 @@ "{not_supported} not supported": "{not_supported} không được hỗ trợ", "{path_refused} on refused paths": "{path_refused} ở đường dẫn bị từ chối", "{incomplete} incomplete": "{incomplete} không đầy đủ", - "{failed} failed": "{failed} thất bại", + "{message}; {failed} originals could not be read": "{message}; {failed} bản gốc không đọc được", "{message}; index warning: {warning}": "{message}; cảnh báo chỉ mục: {warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "{in_catalog} ảnh trong danh mục, kể cả bản sao ảo; {collections} bộ sưu tập.", "{added} added to the library.": "Đã thêm {added} vào thư viện.", diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index a1b95bedaf4..771d8a81e4a 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -287,7 +287,7 @@ "{not_supported} not supported": "{not_supported} 张不受支持", "{path_refused} on refused paths": "{path_refused} 张路径被拒绝", "{incomplete} incomplete": "{incomplete} 张不完整", - "{failed} failed": "{failed} 张失败", + "{message}; {failed} originals could not be read": "{message};{failed} 张原片无法读取", "{message}; index warning: {warning}": "{message};索引警告:{warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "目录中有 {in_catalog} 张照片(含虚拟副本);{collections} 个收藏集。", "{added} added to the library.": "已将 {added} 张添加到图库。", diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index 7d18de822c1..9fee419608e 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -287,7 +287,7 @@ "{not_supported} not supported": "{not_supported} 張不受支援", "{path_refused} on refused paths": "{path_refused} 張路徑遭拒", "{incomplete} incomplete": "{incomplete} 張不完整", - "{failed} failed": "{failed} 張失敗", + "{message}; {failed} originals could not be read": "{message};{failed} 張原始檔無法讀取", "{message}; index warning: {warning}": "{message};索引警告:{warning}", "{in_catalog} photos in the catalog, virtual copies included; {collections} collections.": "目錄中有 {in_catalog} 張相片(含虛擬副本);{collections} 個收藏集。", "{added} added to the library.": "已將 {added} 張加入圖庫。", diff --git a/crates/ui-egui/src/lightroom_import.rs b/crates/ui-egui/src/lightroom_import.rs index 21e101eac57..6e384912b1f 100644 --- a/crates/ui-egui/src/lightroom_import.rs +++ b/crates/ui-egui/src/lightroom_import.rs @@ -329,15 +329,16 @@ fn import_summary(report: &Value) -> String { if incomplete > 0 { parts.push(crate::i18n::tr_format!("{incomplete} incomplete", incomplete = incomplete)); } - let failed = report["failed"].as_array().map_or(0, Vec::len); - if failed > 0 { - parts.push(crate::i18n::tr_format!("{failed} failed", failed = failed)); - } - crate::i18n::tr_format!( + let message = crate::i18n::tr_format!( "Lightroom import complete. {in_catalog} photos in the catalog: {parts}", in_catalog = count("inCatalog"), parts = parts.join(", ") - ) + ); + // An original that is there but can't be read already has its outcome among the parts (a new + // one is added as a placeholder, as a missing original is), so the parts add up to the + // catalog's photos and the failures are said after them. + let failed = report["failed"].as_array().map_or(0, Vec::len); + if failed > 0 { crate::i18n::tr_format!("{message}; {failed} originals could not be read", message = message, failed = failed) } else { message } } fn show_result(app: &mut LightcraftApp) { @@ -891,7 +892,9 @@ mod tests { } /// The toast counts the catalog's photos and names each outcome besides the photos added only - /// when some photo had it: "nothing happened" was "0 added" (#1584). + /// when some photo had it: "nothing happened" was "0 added" (#1584). Originals that couldn't + /// be read are said apart: each is also one of the outcomes, which add up to the catalog's + /// photos (#2589). #[test] fn the_toast_reconciles_the_catalog() { crate::i18n::set_language(crate::i18n::Locale::En); @@ -904,7 +907,7 @@ mod tests { assert_eq!( import_summary(&report), "Lightroom import complete. 8 photos in the catalog: 2 added, 1 already in the library, 1 in Recently Deleted, 2 not supported, \ - 1 on refused paths, 1 incomplete, 1 failed" + 1 on refused paths, 1 incomplete; 1 originals could not be read" ); } diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index 50e4c6b5797..9ad96544cf1 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -71,7 +71,8 @@ Photographs counts them), and these add up to it: Should the counts not add up, a warning says by how much. `imported` (records added, as before) stays in the report and normally equals `added`. The toast says, for example, "45091 photos in the catalog: 16521 added, 812 already in -the library" (only the outcomes some photo had, then failures); the result window has one line per outcome. +the library" (only the outcomes some photo had); then, apart, how many originals couldn't be read, since each of +those is also one of the outcomes (a new one is added as a placeholder). The result window has one line per outcome. **Show in Library** opens All Photos, clears filters and selects an imported record (not one left in Recently Deleted; the button is left out when every record is there). Errors stay readable in the same result window. If another dialog is open, the result waits until that dialog closes. The result From 445b1cf8c28be8ebef8865b13af7d1759fa7dc7d Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Tue, 10 Nov 2026 20:09:04 -0600 Subject: [PATCH 12/22] Issue #2589: the inspect report test builds a catalog with main's backup fields Main added `catalog_id` and `catalog_path` to `CatalogImport` (#2592); the test that a refused path isn't listed as missing builds one, so it names them too. --- crates/ui-egui/src/lightroom_import.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/ui-egui/src/lightroom_import.rs b/crates/ui-egui/src/lightroom_import.rs index 6e384912b1f..507a4ed80ed 100644 --- a/crates/ui-egui/src/lightroom_import.rs +++ b/crates/ui-egui/src/lightroom_import.rs @@ -966,6 +966,8 @@ mod tests { }; let report = inspect_report(CatalogImport { source: "synthetic.lrcat".into(), + catalog_id: None, + catalog_path: None, photos: vec![ photo(1, "//server/share/a.dng", Original::Refused("it is on another computer".into())), photo(2, "D:/Photos/b.dng", Original::NotHere), From 4a28737fbd890050722a06d16778018be79b52c5 Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Tue, 3 Nov 2026 13:25:47 -0600 Subject: [PATCH 13/22] fix(engine): #3707 a Lightroom import develops the records it adds from the catalog A catalog photo whose file the same import added (with an XMP sidecar that gave the new record develop settings) kept the sidecar's settings unless "update existing" was on, and was counted under preservedExistingEdits although nothing existed before the import. The file import's report now says which of its imported records were browsed Local photos it promoted (not serialized), so apply_prepared knows which records the import made: those take the catalog's develop settings and aren't counted as preserved. A record that was there before, in the library or in Local, keeps its edit as before. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/import/commit.rs | 1 + crates/engine/src/import/types.rs | 4 ++ crates/engine/src/lightroom_catalog.rs | 7 ++- crates/engine/src/lightroom_job.rs | 69 ++++++++++++++++++++++++++ docs/lightroom-catalog-import.md | 4 +- 5 files changed, 83 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/import/commit.rs b/crates/engine/src/import/commit.rs index 1a142972497..cbaf49d8a03 100644 --- a/crates/engine/src/import/commit.rs +++ b/crates/engine/src/import/commit.rs @@ -229,6 +229,7 @@ pub fn commit_prepared(s: &mut Session, opts: &ImportOptions, now: &str, prepare ops.push(Op::SetLocal { id, local: false }); } report.imported.push(id.0); + report.promoted.push(id.0); } PreparedItem::Duplicate { path, existing, reason, hash, file } => { let existing = existing.or_else(|| { diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index 298ff987464..4cf82e87914 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -185,6 +185,10 @@ pub struct FileFacts { #[derive(Clone, Debug, Default, Serialize)] pub struct ImportReport { pub imported: Vec, + /// Of `imported`, the photos browsed in Local that joined the library: records that were + /// there before the import, unlike the rest, which it made. (Not in the report.) + #[serde(skip)] + pub promoted: Vec, pub duplicates: Vec, /// [`OnDeleted::Restore`]: photos brought back from Recently Deleted instead of imported. #[serde(skip_serializing_if = "Vec::is_empty")] diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index f397ea811c4..5f2b8e33b9c 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -1282,6 +1282,11 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // The records the file import just made: the catalog photo that finds one was added, not // already in the library. let mut fresh: HashSet = files.imported.iter().copied().collect(); + // The records the file import just made (a photo browsed in Local that it promoted was there + // before). Its XMP sidecar may have given one develop settings, but that is no edit made in + // the library: the catalog's settings apply to it (#3707). + let was_there: HashSet = files.promoted.iter().copied().collect(); + let made: HashSet = files.imported.iter().copied().filter(|id| !was_there.contains(id)).collect(); let mut promoted = HashSet::new(); let mut unmapped = BTreeMap::new(); let mut preserved = 0; @@ -1404,7 +1409,7 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co } ids.insert(src.source_id, p.id); index.photos.insert(identity(&data, src), p.id.0); - let keep_develop = existing_id.is_some() && p.edited.is_some() && !update_existing; + let keep_develop = existing_id.is_some_and(|id| !made.contains(&id.0)) && p.edited.is_some() && !update_existing; let previous_develop = (p.develop.clone(), p.edited.clone()); if keep_develop { preserved += 1; diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index abd73200d0a..25dc4c32437 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -600,4 +600,73 @@ mod tests { assert_eq!(std::fs::read(&sidecar).unwrap(), original); std::fs::remove_dir_all(dir).unwrap(); } + + /// A catalog photo whose file this same import adds gets the catalog's develop settings, even + /// though the file's XMP sidecar gave the new record develop settings of its own: nothing was + /// in the library before, so there is no edit to keep. A record that was there before the + /// import, in the library or browsed in Local (which the import promotes), keeps its edit. + #[test] + fn the_catalog_develops_a_record_this_import_made_from_a_file_with_a_sidecar() { + // what the library had at the photo's path before the import: nothing, a photo in the + // library, a photo browsed in Local + for before in [None, Some(false), Some(true)] { + let dir = crate::tests_xmp::temp_dir(&format!("lr-job-made-{before:?}")); + let file = dir.join("made.jpg"); + std::fs::write(&file, b"made bytes").unwrap(); + std::fs::write( + dir.join("made.xmp"), + r#" + +"#, + ) + .unwrap(); + let path = file.to_string_lossy().into_owned(); + let mut session = crate::Session::new(); + session.media.file_probe = Some(Arc::new(|_| { + Ok(crate::media::ProbeInfo { + format: "JPEG".into(), + width: 20, + height: 10, + content_hash: Some("made-bytes".into()), + ..Default::default() + }) + })); + let personal = before.map(|local| { + let id = session.catalog.alloc_photo_id(); + let mut photo = + lightcraft_catalog::Photo::new(id, lightcraft_catalog::Source::File { path: path.clone() }, "made.jpg", "JPEG", 20, 10, "before"); + photo.local = local; + session.commit("Before", crate::Op::AddPhoto { photo: Box::new(photo) }).unwrap(); + let mut settings = lightcraft_develop::DevelopSettings::default(); + settings.light.exposure = 0.75; + session.set_develop(id, settings, "Personal edit").unwrap(); + id + }); + let options = ImportOptions { mode: ImportMode::Add, on_deleted: crate::import::OnDeleted::Skip, ..ImportOptions::default() }; + let mut import = ImportJob::new(&mut session, options).unwrap(); + let mut prepared = prepared_for(&session, &path, 3); + prepared.normal = import.prepare_files(vec![path.clone()], &AtomicBool::new(false)); + prepared.missing_sources.clear(); + prepared.data.photos[0].settings = "s = { Exposure2012 = -1.0 }".into(); + let report = commit_prepared(&mut session, prepared).unwrap().report; + let id = lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap()); + let photo = session.catalog.photo(id).unwrap(); + assert_eq!(session.catalog.len(), 1, "{before:?}"); + assert!(!photo.local, "{before:?}"); + assert_eq!(photo.rating, 3, "{before:?}: the catalog's rating applies either way"); + match personal { + None => { + assert_eq!(photo.develop.light.exposure, -1.0, "the catalog's exposure, not the sidecar's +2"); + assert_eq!(report["preservedExistingEdits"], 0, "nothing existed to preserve: {report}"); + assert_eq!(report["imported"], 1); + } + Some(personal) => { + assert_eq!(id, personal, "{before:?}"); + assert_eq!(photo.develop.light.exposure, 0.75, "{before:?}: the edit made before the import stays"); + assert_eq!(report["preservedExistingEdits"], 1, "{before:?}: {report}"); + } + } + std::fs::remove_dir_all(dir).unwrap(); + } + } } diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index 9ad96544cf1..665902c55ee 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -91,7 +91,9 @@ image id with its reason, `missingFile`, `missingFolder`, `missingRoot`, `incomp `masterSkipped`), also in `library.inspectLightroom`, and the desktop result window says how many in the UI language. Virtual copies count as added records too; reimport reports zero additions when all records already exist. Existing LightCraft -edits are preserved by default; `updateExisting=true` explicitly replaces them. Persistent import +edits are preserved by default; `updateExisting=true` explicitly replaces them. A record the import +itself adds is not an existing edit: when its file has an XMP sidecar with develop settings, the +catalog's settings still apply on top (#3707). Persistent import identity prevents reimport from duplicating virtual copies and collections. One undo step reverses catalog changes; any saved recovery archives remain available. From 87c8fca52df606dbf9f103cd3e65caf7eb0ff2fa Mon Sep 17 00:00:00 2001 From: Chad Elliott <880190+THEtheChad@users.noreply.github.com> Date: Tue, 3 Nov 2026 16:23:20 -0600 Subject: [PATCH 14/22] refactor(engine): one origin per record for a Lightroom import job The Lightroom catalog import (and the file import it runs first) had no single record of where each library record in the job came from. Each fix derived its own signal: `read_duplicates` (only the Lightroom import reads a content duplicate's sidecar), `fresh` (the report's breakdown), `promoted` / `made` (#3707: whether a record's develop settings are an edit to keep), and `existing_id.is_some()` underneath them. Now the job keeps one `Origin` per record (Created, Promoted, Existing) in `import::Origins`, recorded where the record is made or first matched: the file import records the records it makes and promotes, and `apply_prepared` goes on with the same record for the ones it matches and makes. The develop decision, `preservedExistingEdits` and the report's added / alreadyInLibrary breakdown follow from it. `ImportOptions::read_duplicates` becomes `same_content: SameContent` (Skip, Create): the job says what a content duplicate becomes, and what is read of the file follows from that. A second catalog photo at a path the job is adding (a content duplicate) no longer keeps its sidecar's develop settings as an existing edit: finding the path among the records being made read as "there before". Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/library/import.rs | 2 +- crates/engine/src/import.rs | 2 +- crates/engine/src/import/commit.rs | 5 +- crates/engine/src/import/job.rs | 18 +-- crates/engine/src/import/types.rs | 73 ++++++++-- crates/engine/src/lightroom_catalog.rs | 44 +++--- crates/engine/src/lightroom_catalog/tests.rs | 12 +- crates/engine/src/lightroom_job.rs | 139 ++++++++++++++++++- 8 files changed, 247 insertions(+), 48 deletions(-) diff --git a/crates/engine/src/cmd/library/import.rs b/crates/engine/src/cmd/library/import.rs index 61a7ccefdaa..a76bc61be3a 100644 --- a/crates/engine/src/cmd/library/import.rs +++ b/crates/engine/src/cmd/library/import.rs @@ -83,7 +83,7 @@ pub fn import_params(s: &Session, p: &Value) -> Result { convert_dng: bool_or(p, "dng", false), local: bool_or(p, "local", false), // (only the Lightroom import makes records of duplicates) - read_duplicates: false, + same_content: crate::import::SameContent::Skip, recipe: crate::cmd::recipe_param(p, "library.import")?, }; let album_name = str_param(p, "albumName").map(str::trim).filter(|n| !n.is_empty()).map(str::to_string); diff --git a/crates/engine/src/import.rs b/crates/engine/src/import.rs index fda577f0c06..f4b3de3a0e5 100644 --- a/crates/engine/src/import.rs +++ b/crates/engine/src/import.rs @@ -64,7 +64,7 @@ pub use scan::{ use scan::{library_files, library_hashes}; pub use types::{ Duplicate, FileFacts, ImportCandidate, ImportMode, ImportOptions, ImportReport, ImportUprightMode, ImportWarning, ImportWarningCode, Kept, Moved, - OnDeleted, Organize, + OnDeleted, Organize, Origin, Origins, SameContent, }; #[cfg(test)] diff --git a/crates/engine/src/import/commit.rs b/crates/engine/src/import/commit.rs index cbaf49d8a03..1b45489e584 100644 --- a/crates/engine/src/import/commit.rs +++ b/crates/engine/src/import/commit.rs @@ -1,7 +1,7 @@ use super::defaults::apply_import_defaults; use super::files::copy_into; use super::job::{Prepared, PreparedItem, ReadyFile}; -use super::types::{Duplicate, FileFacts, ImportOptions, ImportReport, Kept, Moved, OnDeleted}; +use super::types::{Duplicate, FileFacts, ImportOptions, ImportReport, Kept, Moved, OnDeleted, Origin}; use super::{HashMap, Op, Path, PathBuf, Photo, PhotoId, ProbeInfo, Session, Source}; /// A batch's items in file order while its transfers are pending ([`ImportJob::run_plan`]). @@ -229,7 +229,7 @@ pub fn commit_prepared(s: &mut Session, opts: &ImportOptions, now: &str, prepare ops.push(Op::SetLocal { id, local: false }); } report.imported.push(id.0); - report.promoted.push(id.0); + report.origins.record(id, Origin::Promoted); } PreparedItem::Duplicate { path, existing, reason, hash, file } => { let existing = existing.or_else(|| { @@ -317,6 +317,7 @@ pub fn commit_prepared(s: &mut Session, opts: &ImportOptions, now: &str, prepare p.history.push(lightcraft_catalog::HistoryStep { label: "Import adjustments".into(), settings: d }); } report.imported.push(id.0); + report.origins.record(id, Origin::Created); p.local = opts.local; if opts.local { // the state as browsed: a later change keeps the record from being forgotten diff --git a/crates/engine/src/import/job.rs b/crates/engine/src/import/job.rs index 847942b3cc5..66714db6512 100644 --- a/crates/engine/src/import/job.rs +++ b/crates/engine/src/import/job.rs @@ -1,6 +1,6 @@ use super::commit::{How, Plan, Slot, Transfer, commit_prepared, name_family, run_transfers, system_clock}; use super::files::{Seen, expand, probe_all, reusable_probes, sidecars_of}; -use super::types::{FileFacts, ImportCandidate, ImportMode, ImportOptions, ImportReport, Kept, OnDeleted}; +use super::types::{FileFacts, ImportCandidate, ImportMode, ImportOptions, ImportReport, Kept, OnDeleted, SameContent}; use super::{HashMap, MediaKind, Path, PathBuf, Photo, PhotoId, ProbeInfo, Session, Source}; /// Import files/folders. See the module docs. @@ -299,13 +299,15 @@ impl ImportJob { // names asked of the disk, which on a network share made a folder of thousands of photos wait // a round trip per name, one name after another. let asked: Vec<&str> = todo.iter().zip(&probed).filter(|(_, p)| p.is_ok()).map(|(f, _)| f.as_str()).collect(); - // (a file whose content the library has is skipped below as a duplicate: it asks the disk - // nothing, unless the import makes a record of it from its file and sidecar, #2589) - let skipped = !opts.local && !opts.read_duplicates; + // What the job makes of a file decides what is read of it: a file it makes a record of is + // read in full, its XMP sidecar included; a duplicate by content it skips (`SameContent`) + // asks the disk nothing here (#2954), and has its sidecar read below only for the capture + // time its file lacks. + let skips_duplicates = !opts.local && opts.same_content == SameContent::Skip; let known: std::collections::HashSet<&str> = todo .iter() .zip(&probed) - .filter(|(_, p)| skipped && p.as_ref().is_ok_and(|i| i.content_hash.as_ref().is_some_and(|h| self.by_hash.contains_key(h)))) + .filter(|(_, p)| skips_duplicates && p.as_ref().is_ok_and(|i| i.content_hash.as_ref().is_some_and(|h| self.by_hash.contains_key(h)))) .map(|(f, _)| f.as_str()) .collect(); let mut found = @@ -340,14 +342,14 @@ impl ImportJob { break; } } - // same bytes as a library photo: skipped below, once its capture time is known (and, - // when the import makes a record of it, once it is read as a file import reads it) + // same bytes as a library photo: a duplicate below, once its capture time is known (and, + // when the job makes a record of it, once it is read as any such file is) let duplicate_of = info.content_hash.as_ref().filter(|_| !opts.local).and_then(|h| self.by_hash.get(h).map(|existing| (h.clone(), *existing))); // the XMP sidecar (or a raw's embedded XMP), read before copying: its capture time files // and names the copy when the file itself has none (a skipped duplicate needs only that time) let raw = info.kind == MediaKind::Raw; - let packet = if duplicate_of.is_some() && info.captured.is_some() && !opts.read_duplicates { + let packet = if duplicate_of.is_some() && skips_duplicates && info.captured.is_some() { None } else { found_sidecar.and_then(|f| std::fs::read_to_string(f).ok()).or_else(|| info.xmp.clone().filter(|_| raw)) diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index 4cf82e87914..8ab98fac072 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -1,4 +1,4 @@ -use super::{Deserialize, MediaKind, Photo, Serialize}; +use super::{Deserialize, HashMap, MediaKind, Photo, PhotoId, Serialize}; #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] pub enum ImportMode { @@ -67,10 +67,8 @@ pub struct ImportOptions { pub metadata_preset: Option, /// Copy: raws are copied as DNG (Copy as DNG). pub convert_dng: bool, - /// A duplicate by content is read as a new file is, its XMP sidecar included: the Lightroom - /// import makes a record of its own from it ([`Duplicate::file`], #2589). Any other import - /// skips it without looking up its sidecar (a round trip per name on a network share, #2954). - pub read_duplicates: bool, + /// What the import makes of a file whose bytes a library photo already has. + pub same_content: SameContent, /// A batch-edit recipe: develop control id / value pairs (e.g. `light.exposure` → 0.5), /// applied to every imported photo *after* its XMP sidecar, camera default and import preset, /// as one more History step (`Import adjustments`). Only the named controls change; the recipe @@ -83,6 +81,65 @@ pub struct ImportOptions { pub recipe: Vec<(String, f64)>, } +/// What an import makes of a file whose bytes a library photo already has (a duplicate by +/// content). What is read of the file follows from it: a file the job makes a record of is read in +/// full, its XMP sidecar included; one it only matches to a library photo needs no more than its +/// capture time. +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] +pub enum SameContent { + /// No record: the report lists it in [`ImportReport::duplicates`]. Its sidecar is read only for + /// the capture time its file lacks, and not looked up otherwise (a round trip per name on a + /// network share, #2954). + #[default] + Skip, + /// A record of its own ([`Origin::Created`]), which the Lightroom catalog import makes from + /// [`Duplicate::file`] (catalogs hold distinct originals with identical bytes): read as any + /// file the job makes a record of, its XMP sidecar included (#2589). + Create, +} + +/// Where a library record an import job made or landed on came from. The job keeps one origin per +/// record ([`Origins`]), set where the record is made or first matched, and what the import does +/// to a record follows from it: whether its develop settings are an edit to keep, and how the +/// report counts it. +#[derive(Clone, Copy, Debug, PartialEq, Eq)] +pub enum Origin { + /// This job made it, from a file (its metadata, the import defaults, its XMP sidecar) or from a + /// Lightroom catalog: nothing in it is an edit made in the library. + Created, + /// A photo browsed in Local that this job brought into the library: there before the job, + /// with whatever was done to it while it was browsed. + Promoted, + /// In the library before the job. + Existing, +} + +impl Origin { + /// There before the job: what it has may be the user's own work. + pub fn was_there(self) -> bool { + self != Origin::Created + } +} + +/// The origin of each record an import job made or landed on ([`Origin`]): the file import +/// records the ones it makes and promotes ([`ImportReport::origins`]), and a Lightroom catalog +/// import goes on with the same record for the ones it matches and makes. +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Origins(HashMap); + +impl Origins { + /// `id`'s origin in this job: the one recorded first. A record the job made stays + /// [`Origin::Created`] when a later step of the job finds it in the library. + pub fn record(&mut self, id: PhotoId, origin: Origin) -> Origin { + *self.0.entry(id).or_insert(origin) + } + + /// `id`'s origin, if the job recorded one. + pub fn get(&self, id: PhotoId) -> Option { + self.0.get(&id).copied() + } +} + /// How copies are filed in the destination. The date is the capture time, else the time of the /// import. #[derive(Clone, Debug, Default, PartialEq, Eq)] @@ -185,10 +242,10 @@ pub struct FileFacts { #[derive(Clone, Debug, Default, Serialize)] pub struct ImportReport { pub imported: Vec, - /// Of `imported`, the photos browsed in Local that joined the library: records that were - /// there before the import, unlike the rest, which it made. (Not in the report.) + /// The origin of each record in `imported`: made from its file, or a photo browsed in Local + /// that joined the library. (Not in the report.) #[serde(skip)] - pub promoted: Vec, + pub origins: Origins, pub duplicates: Vec, /// [`OnDeleted::Restore`]: photos brought back from Recently Deleted instead of imported. #[serde(skip_serializing_if = "Vec::is_empty")] diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 5f2b8e33b9c..3c15d225e2e 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -8,6 +8,7 @@ use std::sync::{ atomic::{AtomicBool, AtomicUsize, Ordering}, }; +use crate::import::Origin; use crate::lightroom_sqlite::{Database, FileSource, LiveTable, Value as SqlValue}; use lightcraft_catalog::{Album, Flag, Op, Photo, PhotoId, Source}; use lightcraft_geom::{Affine, Orientation, Point, Rect}; @@ -1263,7 +1264,7 @@ fn stage_collections( /// import doesn't look at, see [`Original::Refused`]: no record) or `incomplete` (`skipped`). /// Should they not add up, a warning says by how much. pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, context: ApplyPrepared<'_>) -> crate::Result { - let ApplyPrepared { update_existing, files, index, archive_path, missing_sources, undo0 } = context; + let ApplyPrepared { update_existing, mut files, index, archive_path, missing_sources, undo0 } = context; // nothing but a file type LightCraft reads becomes a record, whichever route got here (#2135) refuse_non_media(&mut data); validate(&data).map_err(error)?; @@ -1279,15 +1280,12 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // Normal import counts probed originals; catalog import also adds offline records, // distinct originals with identical bytes, and virtual copies. let mut imported = files.imported.len(); - // The records the file import just made: the catalog photo that finds one was added, not - // already in the library. - let mut fresh: HashSet = files.imported.iter().copied().collect(); - // The records the file import just made (a photo browsed in Local that it promoted was there - // before). Its XMP sidecar may have given one develop settings, but that is no edit made in - // the library: the catalog's settings apply to it (#3707). - let was_there: HashSet = files.promoted.iter().copied().collect(); - let made: HashSet = files.imported.iter().copied().filter(|id| !was_there.contains(id)).collect(); - let mut promoted = HashSet::new(); + // Where each record this job lands on came from, from the file import on: what the import + // does to the record follows from it (its develop settings, the report's breakdown). + let mut origins = std::mem::take(&mut files.origins); + // The records a catalog photo has landed on so far: the first one counts it as added (or + // promotes it), any other catalog photo with the same path finds it already there. + let mut claimed = HashSet::new(); let mut unmapped = BTreeMap::new(); let mut preserved = 0; // Where each catalog photo went (the report's breakdown, see above). A library photo in Recently @@ -1321,9 +1319,12 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co .filter(|id| s.catalog.photo(*id).is_some_and(|p| source_path(p).is_some_and(|path| key(path) == key(&src.path)))); let existing_id = indexed.or_else(|| if master == 0 { by_path.get(&key(&src.path)).copied() } else { None }); let mut trashed = false; - let mut p = if let Some(id) = existing_id.and_then(|id| s.catalog.photo(id)) { - trashed = id.deleted; - (**id).clone() + let (mut p, origin) = if let Some(found) = existing_id.and_then(|id| s.catalog.photo(id)) { + trashed = found.deleted; + // what the job already says of it (a record its file import made or promoted), else + // it was there before the job: browsed in Local or in the library + let origin = origins.record(found.id, if found.local { Origin::Promoted } else { Origin::Existing }); + ((**found).clone(), origin) } else if master != 0 { let master_id = ids.get(&master).copied().ok_or_else(|| error(format!("virtual copy {}: missing master", src.source_id)))?; let mut p = planned @@ -1336,7 +1337,7 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co p.copy_name = Some(text(&src.image, "copyName").to_string()); // a new copy of a master in Recently Deleted is imported, not trashed with it p.deleted = false; - p + (p, Origin::Created) } else if let Some((duplicate, file)) = duplicates.get(&key(&src.path)).and_then(|(id, meta)| s.catalog.photo(*id).cloned().map(|p| (p, *meta))) { @@ -1385,7 +1386,7 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // (as-shot white balance, embedded lens corrections, the default preset), its XMP // sidecar; the catalog's settings and metadata apply on top crate::import::start_from_file(s, &mut p, file, &now); - p + (p, Origin::Created) } else { let id = s.catalog.alloc_photo_id(); let name = Path::new(&src.path).file_name().map(|n| n.to_string_lossy().to_string()).unwrap_or_else(|| src.path.clone()); @@ -1401,15 +1402,18 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co if ["RAW", "DNG", "ARW", "CR2", "CR3", "CRW", "NEF", "NRW", "RAF", "ORF", "RW2", "PEF"].contains(&p.format.to_uppercase().as_str()) { p.kind = lightcraft_catalog::MediaKind::Raw; } - p + (p, Origin::Created) }; + let origin = origins.record(p.id, origin); // Offline videos bypass file probing; Lightroom's format still identifies their kind. if text(&src.image, "fileFormat").eq_ignore_ascii_case("VIDEO") { p.kind = lightcraft_catalog::MediaKind::Video; } ids.insert(src.source_id, p.id); index.photos.insert(identity(&data, src), p.id.0); - let keep_develop = existing_id.is_some_and(|id| !made.contains(&id.0)) && p.edited.is_some() && !update_existing; + // Only a record that was there before the job can hold an edit made in the library. One the + // job made has what its file and XMP sidecar gave it: the catalog's settings apply (#3707). + let keep_develop = origin.was_there() && p.edited.is_some() && !update_existing; let previous_develop = (p.develop.clone(), p.edited.clone()); if keep_develop { preserved += 1; @@ -1481,14 +1485,14 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co repaired.kind = p.kind; ops.extend([Op::RemovePhoto { id: p.id }, Op::AddPhoto { photo: Box::new(repaired) }]); } - let promote = was_local && promoted.insert(p.id); - if promote { + let first = claimed.insert(p.id); + if was_local && first { imported += 1; ops.push(Op::SetLocal { id: p.id, local: false }); } if trashed { in_trash += 1; - } else if promote || fresh.remove(&p.id.0) { + } else if first && origin != Origin::Existing { added += 1; } else { already += 1; diff --git a/crates/engine/src/lightroom_catalog/tests.rs b/crates/engine/src/lightroom_catalog/tests.rs index 27b34192754..e19f4ddf6e2 100644 --- a/crates/engine/src/lightroom_catalog/tests.rs +++ b/crates/engine/src/lightroom_catalog/tests.rs @@ -516,18 +516,18 @@ fn only_an_import_that_makes_a_record_of_a_content_duplicate_reads_its_sidecar() ) .unwrap(); let paths = [file.to_string_lossy().into_owned()]; - for read_duplicates in [false, true] { + for same_content in [crate::import::SameContent::Skip, crate::import::SameContent::Create] { let mut s = crate::Session::new(); let other = library_photo(&mut s, "/elsewhere/a.ARW", |p| p.meta.caption = "Other photo's caption".into()); s.media.file_probe = Some(Arc::new(|_| Ok(crate::media::ProbeInfo { format: "ARW".into(), content_hash: Some("same-bytes".into()), ..Default::default() }))); - let opts = crate::import::ImportOptions { read_duplicates, ..Default::default() }; + let opts = crate::import::ImportOptions { same_content, ..Default::default() }; let r = crate::import::import_with(&mut s, &paths, &opts).unwrap(); - assert!(r.imported.is_empty() && s.catalog.photos().count() == 1, "{read_duplicates}: {r:?}"); - let [d] = r.duplicates.as_slice() else { panic!("{read_duplicates}: {r:?}") }; - assert_eq!((d.reason, d.existing), ("content", Some(other.0)), "{read_duplicates}"); + assert!(r.imported.is_empty() && s.catalog.photos().count() == 1, "{same_content:?}: {r:?}"); + let [d] = r.duplicates.as_slice() else { panic!("{same_content:?}: {r:?}") }; + assert_eq!((d.reason, d.existing), ("content", Some(other.0)), "{same_content:?}"); let caption = d.file.as_ref().and_then(|f| f.sidecar.as_ref()).and_then(|sc| sc.caption.clone()); - if read_duplicates { + if same_content == crate::import::SameContent::Create { assert_eq!(caption.as_deref(), Some("Harbour at dawn"), "the Lightroom import reads it: {r:?}"); } else { assert_eq!(caption, None, "a skipped duplicate's sidecar isn't looked up: {r:?}"); diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index 25dc4c32437..09404242c4d 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -209,8 +209,12 @@ impl LightroomJob { pub fn new(s: &mut crate::Session, path: PathBuf, update_existing: bool) -> crate::Result { // a photo deleted here stays deleted: the catalog's record is matched, not restored; a // duplicate by content becomes a record of its own, so its file and sidecar are read (#2589) - let opts = - ImportOptions { mode: ImportMode::Add, on_deleted: crate::import::OnDeleted::Skip, read_duplicates: true, ..ImportOptions::default() }; + let opts = ImportOptions { + mode: ImportMode::Add, + on_deleted: crate::import::OnDeleted::Skip, + same_content: crate::import::SameContent::Create, + ..ImportOptions::default() + }; let import = ImportJob::new(s, opts)?; let archive_dir = s.library.as_ref().filter(|library| library.on_disk).map(|library| library.dir.join("Interop")); let progress = LightroomProgress { @@ -669,4 +673,135 @@ mod tests { std::fs::remove_dir_all(dir).unwrap(); } } + + /// A file beside an XMP sidecar with develop settings (`Exposure2012 +2`), and a session whose + /// probe reads it with `hash`. + fn file_with_develop_sidecar(name: &str, hash: &'static str) -> (PathBuf, String, crate::Session) { + let dir = crate::tests_xmp::temp_dir(name); + let file = dir.join("photo.jpg"); + std::fs::write(&file, b"photo bytes").unwrap(); + std::fs::write( + dir.join("photo.xmp"), + r#" + +"#, + ) + .unwrap(); + let mut session = crate::Session::new(); + session.media.file_probe = Some(Arc::new(move |_| { + Ok(crate::media::ProbeInfo { format: "JPEG".into(), width: 20, height: 10, content_hash: Some(hash.into()), ..Default::default() }) + })); + (dir, file.to_string_lossy().into_owned(), session) + } + + /// A library record with an edit (exposure 0.75), browsed in Local or not, with `hash`. + fn edited_record(session: &mut crate::Session, path: &str, local: bool, hash: Option<&str>) -> lightcraft_catalog::PhotoId { + let id = session.catalog.alloc_photo_id(); + let mut photo = + lightcraft_catalog::Photo::new(id, lightcraft_catalog::Source::File { path: path.into() }, "photo.jpg", "JPEG", 20, 10, "before"); + photo.local = local; + photo.content_hash = hash.map(str::to_string); + session.commit("Before", crate::Op::AddPhoto { photo: Box::new(photo) }).unwrap(); + let mut settings = lightcraft_develop::DevelopSettings::default(); + settings.light.exposure = 0.75; + session.set_develop(id, settings, "Personal edit").unwrap(); + id + } + + /// The job's real route: the Lightroom job's own file import prepares `paths`, then the + /// catalog (`data`, settings `Exposure2012 = -1.0` on every photo) is committed on top of it. + fn run_job(session: &mut crate::Session, mut prepared: PreparedLightroom, paths: Vec, update_existing: bool) -> Value { + let mut job = LightroomJob::new(session, PathBuf::from("fixture.lrcat"), update_existing).unwrap(); + prepared.normal = job.import.prepare_files(paths, &AtomicBool::new(false)); + prepared.missing_sources.clear(); + prepared.update_existing = update_existing; + for photo in &mut prepared.data.photos { + photo.settings = "s = { Exposure2012 = -1.0 }".into(); + } + commit_prepared(session, prepared).unwrap().report + } + + /// Each origin a record can have in the job decides, on its own, whether its develop settings + /// are an edit to keep, whether the report counts it as preserved, and where the breakdown puts + /// it: a record the job made from the file and its sidecar (Created) takes the catalog's + /// settings and is added; a photo browsed in Local (Promoted) is added and keeps its edit; a + /// library record (Existing) is already there and keeps its edit. "Update existing" replaces + /// the edits of the last two only. + #[test] + fn each_record_origin_decides_its_develop_and_where_the_report_counts_it() { + // (record before the job: none, browsed in Local, in the library) + for (before, update_existing) in [None, Some(true), Some(false)].into_iter().flat_map(|b| [(b, false), (b, true)]) { + let case = format!("{before:?} update {update_existing}"); + let (dir, path, mut session) = file_with_develop_sidecar(&format!("lr-job-origin-{before:?}-{update_existing}"), "origin-bytes"); + let personal = before.map(|local| edited_record(&mut session, &path, local, None)); + let prepared = prepared_for(&session, &path, 3); + let report = run_job(&mut session, prepared, vec![path.clone()], update_existing); + let id = lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap()); + let photo = session.catalog.photo(id).unwrap(); + assert_eq!(session.catalog.len(), 1, "{case}: {report}"); + assert!(!photo.local, "{case}"); + assert_eq!(photo.rating, 3, "{case}"); + if let Some(personal) = personal { + assert_eq!(id, personal, "{case}"); + } + let kept = before.is_some() && !update_existing; + let exposure = if kept { 0.75 } else { -1.0 }; + assert_eq!(photo.develop.light.exposure, exposure, "{case}: never the sidecar's +2"); + assert_eq!(report["preservedExistingEdits"], u64::from(kept), "{case}: {report}"); + let added = before != Some(false); + assert_eq!( + (report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), + (Some(u64::from(added)), Some(u64::from(!added))), + "{case}: {report}" + ); + assert_eq!(report["imported"], u64::from(added), "{case}: {report}"); + assert_eq!(report["inCatalog"], 1, "{case}"); + std::fs::remove_dir_all(dir).unwrap(); + } + } + + /// A catalog photo whose file has the same bytes as another library photo gets a record of its + /// own, which the job makes (Created) from its file and XMP sidecar, the sidecar read by the + /// job's own file import: the catalog's settings apply on top, the other photo's edit isn't + /// taken or counted as preserved, and the photo is added. + #[test] + fn a_content_duplicate_is_a_record_the_job_made() { + let (dir, path, mut session) = file_with_develop_sidecar("lr-job-origin-duplicate", "duplicate-bytes"); + let other = edited_record(&mut session, "/elsewhere/other.jpg", false, Some("duplicate-bytes")); + let prepared = prepared_for(&session, &path, 3); + let report = run_job(&mut session, prepared, vec![path.clone()], false); + let id = lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap()); + assert_ne!(id, other, "{report}"); + let new = session.catalog.photo(id).unwrap(); + assert_eq!(new.develop.light.exposure, -1.0, "the catalog's settings, not the sidecar's +2 or the other photo's 0.75: {report}"); + assert_eq!(session.catalog.photo(other).unwrap().develop.light.exposure, 0.75, "the other photo is untouched"); + assert_eq!(report["preservedExistingEdits"], 0, "{report}"); + assert_eq!((report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), (Some(1), Some(0)), "{report}"); + std::fs::remove_dir_all(dir).unwrap(); + } + + /// Two catalog photos at the same path whose file is a content duplicate: the second lands on + /// no library record (the first one's is still being made), so the job makes another one from + /// the file and its sidecar. That record is the job's own too: the catalog's settings apply and + /// nothing counts as preserved. (Before, finding the path among the records being made read as + /// "there before", and the sidecar's develop settings were kept as an existing edit.) + #[test] + fn a_second_catalog_photo_at_a_path_the_job_is_adding_takes_the_catalog_develop() { + let (dir, path, mut session) = file_with_develop_sidecar("lr-job-origin-same-path", "same-path-bytes"); + edited_record(&mut session, "/elsewhere/other.jpg", false, Some("same-path-bytes")); + let mut prepared = prepared_for(&session, &path, 3); + let mut second = prepared.data.photos[0].clone(); + second.source_id = 2; + second.uuid = "fixture-photo-2".into(); + second.image.insert("id_local".into(), serde_json::json!(2)); + prepared.data.photos.push(second); + prepared.data.images = 2; + let report = run_job(&mut session, prepared, vec![path.clone()], false); + for source in ["1", "2"] { + let id = lightcraft_catalog::PhotoId(report["mapping"][source].as_u64().unwrap()); + assert_eq!(session.catalog.photo(id).unwrap().develop.light.exposure, -1.0, "catalog photo {source}: {report}"); + } + assert_eq!(report["preservedExistingEdits"], 0, "{report}"); + std::fs::remove_dir_all(dir).unwrap(); + } } From eae4a1304e9d06f9f1e8de6983f0908bd1bbf96b Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Tue, 3 Nov 2026 21:42:30 -0600 Subject: [PATCH 15/22] test(engine): pin each record origin's report counts and the job's duplicate reads Two catalog photos at one path count their record once (added or already in the library, imported once; preservedExistingEdits counts catalog photos). An offline original's Local or library record takes its origin in the catalog step. Two new files with the same bytes each keep their own sidecar, which the job's file import reads because the job makes a record of the second. The job's file import uses one set of options for prepare and commit, and the unused Origins::get is gone. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/import/types.rs | 5 - crates/engine/src/lightroom_job.rs | 149 ++++++++++++++++++++++++++--- 2 files changed, 138 insertions(+), 16 deletions(-) diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index 8ab98fac072..21ef68cbbb0 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -133,11 +133,6 @@ impl Origins { pub fn record(&mut self, id: PhotoId, origin: Origin) -> Origin { *self.0.entry(id).or_insert(origin) } - - /// `id`'s origin, if the job recorded one. - pub fn get(&self, id: PhotoId) -> Option { - self.0.get(&id).copied() - } } /// How copies are filed in the destination. The date is the capture time, else the time of the diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index 09404242c4d..722236faeaf 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -207,15 +207,7 @@ pub struct LightroomJob { impl LightroomJob { /// Snapshot session state only. This constructor performs no filesystem work. pub fn new(s: &mut crate::Session, path: PathBuf, update_existing: bool) -> crate::Result { - // a photo deleted here stays deleted: the catalog's record is matched, not restored; a - // duplicate by content becomes a record of its own, so its file and sidecar are read (#2589) - let opts = ImportOptions { - mode: ImportMode::Add, - on_deleted: crate::import::OnDeleted::Skip, - same_content: crate::import::SameContent::Create, - ..ImportOptions::default() - }; - let import = ImportJob::new(s, opts)?; + let import = ImportJob::new(s, file_import_options())?; let archive_dir = s.library.as_ref().filter(|library| library.on_disk).map(|library| library.dir.join("Interop")); let progress = LightroomProgress { read_total: Arc::clone(&import.read_total), @@ -288,6 +280,18 @@ impl LightroomJob { } } +/// The options of the job's file import, for both its halves (prepare and commit): a photo +/// deleted here stays deleted (the catalog's record is matched, not restored), and a duplicate by +/// content becomes a record of its own, so its file and sidecar are read (#2589). +fn file_import_options() -> ImportOptions { + ImportOptions { + mode: ImportMode::Add, + on_deleted: crate::import::OnDeleted::Skip, + same_content: crate::import::SameContent::Create, + ..ImportOptions::default() + } +} + /// Apply prepared data on the owner thread. No source, archive or index filesystem work occurs. pub fn commit_prepared(s: &mut crate::Session, mut prepared: PreparedLightroom) -> crate::Result { if prepared.cancelled { @@ -306,9 +310,8 @@ pub fn commit_prepared(s: &mut crate::Session, mut prepared: PreparedLightroom) let undo0 = s.undo.len(); prepared.normal.revalidate_add(s); - let options = ImportOptions { mode: ImportMode::Add, on_deleted: crate::import::OnDeleted::Skip, ..ImportOptions::default() }; let now = prepared.now.clone(); - let files = crate::import::commit_prepared(s, &options, &now, prepared.normal)?; + let files = crate::import::commit_prepared(s, &file_import_options(), &now, prepared.normal)?; let applied = lightroom_catalog::apply_prepared( s, prepared.data, @@ -804,4 +807,128 @@ mod tests { assert_eq!(report["preservedExistingEdits"], 0, "{report}"); std::fs::remove_dir_all(dir).unwrap(); } + + /// `prepared` with a second catalog photo (source id 2) at `path`. + fn with_second_photo(mut prepared: PreparedLightroom, path: &str) -> PreparedLightroom { + let mut second = prepared.data.photos[0].clone(); + second.source_id = 2; + second.uuid = "fixture-photo-2".into(); + second.path = path.into(); + second.image.insert("id_local".into(), serde_json::json!(2)); + prepared.data.photos.push(second); + prepared.data.images = 2; + prepared + } + + /// Two catalog photos at one path land on one record. The report counts that record once + /// (`added` for one the job made or promoted, the other photo `alreadyInLibrary`), and + /// `imported` counts it once. `preservedExistingEdits` counts catalog photos, not records: both + /// photos keep the record's edit when it was there before the job. + #[test] + fn two_catalog_photos_at_one_path_count_their_record_once() { + // (record before the job: none, browsed in Local, in the library) + for before in [None, Some(true), Some(false)] { + let (dir, path, mut session) = file_with_develop_sidecar(&format!("lr-job-origin-twice-{before:?}"), "twice-bytes"); + if let Some(local) = before { + edited_record(&mut session, &path, local, None); + } + let prepared = with_second_photo(prepared_for(&session, &path, 3), &path); + let report = run_job(&mut session, prepared, vec![path.clone()], false); + assert_eq!(session.catalog.len(), 1, "{before:?}: {report}"); + assert_eq!(report["mapping"]["1"], report["mapping"]["2"], "{before:?}: one record"); + let id = lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap()); + let photo = session.catalog.photo(id).unwrap(); + assert!(!photo.local, "{before:?}"); + let (exposure, preserved, added, already, imported) = match before { + None => (-1.0, 0, 1, 1, 1), + Some(true) => (0.75, 2, 1, 1, 1), + Some(false) => (0.75, 2, 0, 2, 0), + }; + assert_eq!(photo.develop.light.exposure, exposure, "{before:?}: {report}"); + assert_eq!(report["preservedExistingEdits"], preserved, "{before:?}: {report}"); + assert_eq!((report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), (Some(added), Some(already)), "{before:?}: {report}"); + assert_eq!(report["imported"], imported, "{before:?}: {report}"); + std::fs::remove_dir_all(dir).unwrap(); + } + } + + /// A catalog photo whose original is offline never reaches the job's file import, so the + /// catalog step records the origin of the library record it finds there: a photo browsed in + /// Local (Promoted) joins the library and is added, a library record (Existing) is already + /// there, and both keep their edit unless "update existing" is on. + #[test] + fn an_offline_original_s_record_keeps_its_origin() { + let path = "/missing/lr-job-offline.jpg"; + for (local, update_existing) in [(true, false), (true, true), (false, false), (false, true)] { + let case = format!("local {local} update {update_existing}"); + let mut session = crate::Session::new(); + let personal = edited_record(&mut session, path, local, None); + let mut prepared = prepared_for(&session, path, 3); + prepared.update_existing = update_existing; + prepared.data.photos[0].settings = "s = { Exposure2012 = -1.0 }".into(); + let report = commit_prepared(&mut session, prepared).unwrap().report; + assert_eq!(report["mapping"]["1"].as_u64(), Some(personal.0), "{case}: {report}"); + let photo = session.catalog.photo(personal).unwrap(); + assert!(!photo.local, "{case}: the import brings it into the library"); + assert_eq!(photo.develop.light.exposure, if update_existing { -1.0 } else { 0.75 }, "{case}: {report}"); + assert_eq!(report["preservedExistingEdits"], u64::from(!update_existing), "{case}: {report}"); + assert_eq!( + (report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), + (Some(u64::from(local)), Some(u64::from(!local))), + "{case}: {report}" + ); + assert_eq!(report["imported"], u64::from(local), "{case}: {report}"); + } + } + + /// Two new files with the same bytes, each beside its own XMP sidecar, and each with a capture + /// time of its own: the job's file import adds the first and reads the second's sidecar too, + /// since the job makes a record of it (`SameContent::Create`). Each record has its own caption. + #[test] + fn two_new_files_with_the_same_bytes_each_keep_their_own_sidecar() { + let dir = crate::tests_xmp::temp_dir("lr-job-origin-same-bytes"); + let caption = |text: &str| { + format!( + r#" + +{text} +"# + ) + }; + let paths: Vec = ["a", "b"] + .iter() + .map(|name| { + let file = dir.join(format!("{name}.jpg")); + std::fs::write(&file, b"same bytes").unwrap(); + std::fs::write(dir.join(format!("{name}.xmp")), caption(&format!("Caption {name}"))).unwrap(); + file.to_string_lossy().into_owned() + }) + .collect(); + let mut session = crate::Session::new(); + session.media.file_probe = Some(Arc::new(|_| { + Ok(crate::media::ProbeInfo { + format: "JPEG".into(), + width: 20, + height: 10, + content_hash: Some("same-bytes".into()), + captured: Some("2024-05-06T07:08:09".into()), + ..Default::default() + }) + })); + let prepared = with_second_photo(prepared_for(&session, &paths[0], 3), &paths[1]); + let report = run_job(&mut session, prepared, paths.clone(), false); + assert_eq!(session.catalog.len(), 2, "{report}"); + for (source, name) in [("1", "a"), ("2", "b")] { + let id = lightcraft_catalog::PhotoId(report["mapping"][source].as_u64().unwrap()); + let photo = session.catalog.photo(id).unwrap(); + assert_eq!(photo.meta.caption, format!("Caption {name}"), "catalog photo {source}: {report}"); + assert_eq!(photo.develop.light.exposure, -1.0, "catalog photo {source}: {report}"); + } + assert_eq!( + (report["added"].as_u64(), report["imported"].as_u64(), report["preservedExistingEdits"].as_u64()), + (Some(2), Some(2), Some(0)), + "{report}" + ); + std::fs::remove_dir_all(dir).unwrap(); + } } From 5987ef01a26a5c45927c6657610733150d409b80 Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 04:37:33 -0600 Subject: [PATCH 16/22] fix(engine): #3434 a record a Lightroom import makes starts from the camera's defaults Lightroom leaves settings at zero (Clarity2012, Texture, LuminanceSmoothing, ...) out of its develop text. A record the job made (Origin::Created: from a file and its XMP, embedded or a sidecar, from a content duplicate, an offline original or a virtual copy's master) had the catalog's settings applied on top of what the file, a default import preset or the master gave it, so a value only those held survived under the catalog's settings. The catalog's settings for such a record now start from Photo::camera_defaults(); with no develop text the record keeps what it has. Records there before the job are unchanged. The rule and the embedded-XMP / sidecar / import-preset test come from #3435, ported onto the job's origin; the clarity checks on the existing origin tests and the virtual-copy test are new. Co-authored-by: clydecbrown <5354382+clydecbrown@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 7 ++ crates/engine/src/lightroom_job.rs | 100 +++++++++++++++++++++++-- 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 3c15d225e2e..a024c8120f3 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -1418,6 +1418,13 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co if keep_develop { preserved += 1; } + // Lightroom leaves settings at zero (Clarity, Texture, …) out of its develop text, so the + // catalog's settings for a record the job made start from the camera's defaults, not from + // what its file's XMP, a default import preset or a virtual copy's master gave it (#3434). + // With no develop text there is nothing to replace. + if !origin.was_there() && !src.settings.is_empty() { + p.develop = Arc::new(p.camera_defaults()); + } let orientation = lightroom_orientation(text(&src.image, "orientation")).unwrap_or_default(); let stored_aspect = number(&src.image, "fileWidth") as f64 / number(&src.image, "fileHeight") as f64; if !src.xmp.is_empty() { diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index 722236faeaf..f01ef9bff5f 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -677,8 +677,8 @@ mod tests { } } - /// A file beside an XMP sidecar with develop settings (`Exposure2012 +2`), and a session whose - /// probe reads it with `hash`. + /// A file beside an XMP sidecar with develop settings (`Exposure2012 +2`, and `Clarity2012 +30`, + /// which the catalog's settings leave out), and a session whose probe reads it with `hash`. fn file_with_develop_sidecar(name: &str, hash: &'static str) -> (PathBuf, String, crate::Session) { let dir = crate::tests_xmp::temp_dir(name); let file = dir.join("photo.jpg"); @@ -686,7 +686,7 @@ mod tests { std::fs::write( dir.join("photo.xmp"), r#" - + "#, ) .unwrap(); @@ -713,13 +713,24 @@ mod tests { /// The job's real route: the Lightroom job's own file import prepares `paths`, then the /// catalog (`data`, settings `Exposure2012 = -1.0` on every photo) is committed on top of it. - fn run_job(session: &mut crate::Session, mut prepared: PreparedLightroom, paths: Vec, update_existing: bool) -> Value { + fn run_job(session: &mut crate::Session, prepared: PreparedLightroom, paths: Vec, update_existing: bool) -> Value { + run_job_with(session, prepared, paths, update_existing, "s = { Exposure2012 = -1.0 }") + } + + /// [`run_job`] with `settings` on every catalog photo. + fn run_job_with( + session: &mut crate::Session, + mut prepared: PreparedLightroom, + paths: Vec, + update_existing: bool, + settings: &str, + ) -> Value { let mut job = LightroomJob::new(session, PathBuf::from("fixture.lrcat"), update_existing).unwrap(); prepared.normal = job.import.prepare_files(paths, &AtomicBool::new(false)); prepared.missing_sources.clear(); prepared.update_existing = update_existing; for photo in &mut prepared.data.photos { - photo.settings = "s = { Exposure2012 = -1.0 }".into(); + photo.settings = settings.into(); } commit_prepared(session, prepared).unwrap().report } @@ -750,6 +761,7 @@ mod tests { let kept = before.is_some() && !update_existing; let exposure = if kept { 0.75 } else { -1.0 }; assert_eq!(photo.develop.light.exposure, exposure, "{case}: never the sidecar's +2"); + assert_eq!(photo.develop.effects.clarity, 0.0, "{case}: a setting the catalog leaves out is not the sidecar's +30"); assert_eq!(report["preservedExistingEdits"], u64::from(kept), "{case}: {report}"); let added = before != Some(false); assert_eq!( @@ -777,6 +789,7 @@ mod tests { assert_ne!(id, other, "{report}"); let new = session.catalog.photo(id).unwrap(); assert_eq!(new.develop.light.exposure, -1.0, "the catalog's settings, not the sidecar's +2 or the other photo's 0.75: {report}"); + assert_eq!(new.develop.effects.clarity, 0.0, "a setting the catalog leaves out is not the sidecar's +30: {report}"); assert_eq!(session.catalog.photo(other).unwrap().develop.light.exposure, 0.75, "the other photo is untouched"); assert_eq!(report["preservedExistingEdits"], 0, "{report}"); assert_eq!((report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), (Some(1), Some(0)), "{report}"); @@ -802,7 +815,9 @@ mod tests { let report = run_job(&mut session, prepared, vec![path.clone()], false); for source in ["1", "2"] { let id = lightcraft_catalog::PhotoId(report["mapping"][source].as_u64().unwrap()); - assert_eq!(session.catalog.photo(id).unwrap().develop.light.exposure, -1.0, "catalog photo {source}: {report}"); + let photo = session.catalog.photo(id).unwrap(); + assert_eq!(photo.develop.light.exposure, -1.0, "catalog photo {source}: {report}"); + assert_eq!(photo.develop.effects.clarity, 0.0, "catalog photo {source}: not the sidecar's +30: {report}"); } assert_eq!(report["preservedExistingEdits"], 0, "{report}"); std::fs::remove_dir_all(dir).unwrap(); @@ -931,4 +946,77 @@ mod tests { ); std::fs::remove_dir_all(dir).unwrap(); } + + /// Settings a file's XMP gives the record the job makes of it (embedded in a DNG, or a sidecar) + /// are not edits the library had: the catalog's settings win without "update existing", and + /// nothing counts as preserved. They start from the camera's defaults, so a setting the catalog + /// leaves out (Lightroom omits those at zero) is taken neither from the file nor from a default + /// import preset. (Adapted from #3435.) + #[test] + fn a_photo_the_job_adds_takes_the_catalogs_settings_over_its_files_xmp() { + let dir = crate::tests_xmp::temp_dir("lr-job-embedded-edits"); + let saved = r#""#; + let embedded = dir.join("embedded.dng"); + std::fs::write(&embedded, crate::tests_xmp::synthetic_dng_with(Some(saved), Default::default())).unwrap(); + let beside = dir.join("sidecar.dng"); + std::fs::write(&beside, crate::tests_xmp::synthetic_dng_with(None, Default::default())).unwrap(); + std::fs::write(dir.join("sidecar.xmp"), saved).unwrap(); + let paths: Vec = [&embedded, &beside].iter().map(|p| p.to_string_lossy().into_owned()).collect(); + let mut session = crate::Session::new().with_fs(); + // a default import preset sets a value the catalog leaves out too + session.presets.push(lightcraft_develop::Preset { + id: "look".into(), + name: "Look".into(), + group: "g".into(), + settings: serde_json::json!({"effects": {"texture": 12.0}}), + favorite: false, + builtin: false, + }); + session.import_defaults.raw_preset = Some("look".into()); + let mut prepared = with_second_photo(prepared_for(&session, &paths[0], 0), &paths[1]); + for photo in &mut prepared.data.photos { + for (key, value) in + [("fileFormat", serde_json::json!("DNG")), ("fileWidth", serde_json::json!(32)), ("fileHeight", serde_json::json!(24))] + { + photo.image.insert(key.into(), value); + } + } + let report = run_job_with(&mut session, prepared, paths, false, "s = { Exposure2012 = 1, Dehaze = -50 }"); + assert_eq!(report["imported"], 2, "{report}"); + assert_eq!(report["preservedExistingEdits"], 0, "the library held nothing before the import: {report}"); + assert_eq!(session.catalog.len(), 2, "{report}"); + for p in session.catalog.photos() { + assert_eq!(p.develop.light.exposure, 1.0, "{}: the file's saved exposure and the catalog's agree", p.file_name); + assert_eq!(p.develop.effects.dehaze, -50.0, "{}: the catalog's later edit is kept, not the file's", p.file_name); + assert_eq!(p.develop.effects.clarity, 0.0, "{}: a setting the catalog leaves out is not taken from the file", p.file_name); + assert_eq!(p.develop.effects.texture, 0.0, "{}: nor from a default import preset", p.file_name); + } + std::fs::remove_dir_all(dir).unwrap(); + } + + /// A new virtual copy is a record the job makes too: its catalog settings start from the + /// camera's defaults, not from its master's, so a setting the copy's develop text leaves out + /// (Lightroom omits those at zero) is zero, while the master keeps its own. + #[test] + fn a_new_virtual_copy_takes_none_of_its_masters_settings_the_catalog_leaves_out() { + let mut session = crate::Session::new(); + let mut prepared = prepared_for(&session, "/missing/lr-job-copy.jpg", 3); + prepared.data.photos[0].settings = "s = { Exposure2012 = -1.0, Clarity2012 = 30 }".into(); + let mut copy = prepared.data.photos[0].clone(); + copy.source_id = 2; + copy.uuid = "fixture-copy".into(); + copy.image.insert("id_local".into(), serde_json::json!(2)); + copy.image.insert("masterImage".into(), serde_json::json!(1)); + copy.image.insert("copyName".into(), serde_json::json!("Copy 1")); + copy.settings = "s = { Exposure2012 = 0.5 }".into(); + prepared.data.photos.push(copy); + prepared.data.images = 2; + let report = commit_prepared(&mut session, prepared).unwrap().report; + let develop = + |source: &str| session.catalog.photo(lightcraft_catalog::PhotoId(report["mapping"][source].as_u64().unwrap())).unwrap().develop.clone(); + let (master, copy) = (develop("1"), develop("2")); + assert_eq!((master.light.exposure, master.effects.clarity), (-1.0, 30.0), "{report}"); + assert_eq!((copy.light.exposure, copy.effects.clarity), (0.5, 0.0), "the copy's own settings, not its master's clarity: {report}"); + assert_eq!(report["preservedExistingEdits"], 0, "{report}"); + } } From bce9ef76a3579969864df3f2b892bb5af470cf59 Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 04:37:40 -0600 Subject: [PATCH 17/22] fix(engine): #3434 a photo browsed in Local and untouched since is one a Lightroom import makes Browsing a folder reads each file's XMP into its Local record, so a browsed photo nobody has touched since holds only what its file says, as a record the job makes from that file would. It now counts as Origin::Created (Origin::of: Photo::untouched_local(), so any change after browsing, a rating or keyword too, keeps it Promoted): the catalog's settings apply, from the camera's defaults, and it is not a preserved edit. Its origin is read where the job first sees it, before the promotion is committed: the file import's Promote arm, or, for an offline original that never reaches the file import, the catalog step's match. A photo changed after browsing keeps its edit unless "update existing" is on, as before. The rule, its offline-original case and the test (untouched / changed, original present / offline) come from #3435, ported onto the job's origin instead of a promoted_changed list; the docs and whats-new entry follow its wording. Co-authored-by: clydecbrown <5354382+clydecbrown@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/import/commit.rs | 3 +- crates/engine/src/import/types.rs | 23 +++++++++-- crates/engine/src/lightroom_catalog.rs | 5 ++- crates/engine/src/lightroom_job.rs | 57 ++++++++++++++++++++++++++ docs/lightroom-catalog-import.md | 10 +++-- docs/whats-new.md | 9 ++++ 6 files changed, 98 insertions(+), 9 deletions(-) diff --git a/crates/engine/src/import/commit.rs b/crates/engine/src/import/commit.rs index 1b45489e584..dcc4a19b0e7 100644 --- a/crates/engine/src/import/commit.rs +++ b/crates/engine/src/import/commit.rs @@ -229,7 +229,8 @@ pub fn commit_prepared(s: &mut Session, opts: &ImportOptions, now: &str, prepare ops.push(Op::SetLocal { id, local: false }); } report.imported.push(id.0); - report.origins.record(id, Origin::Promoted); + // (read before the promotion is committed: a promoted record is no longer Local) + report.origins.record(id, s.catalog.photo(id).map_or(Origin::Promoted, |p| Origin::of(p))); } PreparedItem::Duplicate { path, existing, reason, hash, file } => { let existing = existing.or_else(|| { diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index 21ef68cbbb0..112049db5c2 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -105,16 +105,33 @@ pub enum SameContent { #[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum Origin { /// This job made it, from a file (its metadata, the import defaults, its XMP sidecar) or from a - /// Lightroom catalog: nothing in it is an edit made in the library. + /// Lightroom catalog, or it is a photo browsed in Local and not changed since, which holds only + /// what browsing read from its file, as a record made from that file would (#3434): nothing in + /// it is an edit made in the library. Created, - /// A photo browsed in Local that this job brought into the library: there before the job, - /// with whatever was done to it while it was browsed. + /// A photo browsed in Local and changed since browsing that this job brought into the library: + /// there before the job, with the user's changes. Promoted, /// In the library before the job. Existing, } impl Origin { + /// The origin of `p`, a record that was in the library or browsed in Local when the job found + /// it: [`Origin::Created`] if browsed and untouched since ([`Photo::untouched_local`]: any + /// change counts, a rating or keyword too), [`Origin::Promoted`] if browsed and changed, + /// [`Origin::Existing`] otherwise. Read before the job promotes it (a promoted record is no + /// longer Local). + pub fn of(p: &Photo) -> Origin { + if p.untouched_local() { + Origin::Created + } else if p.local { + Origin::Promoted + } else { + Origin::Existing + } + } + /// There before the job: what it has may be the user's own work. pub fn was_there(self) -> bool { self != Origin::Created diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index a024c8120f3..da0abde379e 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -1322,8 +1322,9 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co let (mut p, origin) = if let Some(found) = existing_id.and_then(|id| s.catalog.photo(id)) { trashed = found.deleted; // what the job already says of it (a record its file import made or promoted), else - // it was there before the job: browsed in Local or in the library - let origin = origins.record(found.id, if found.local { Origin::Promoted } else { Origin::Existing }); + // what it was before the job: browsed in Local (untouched since or changed, as for an + // offline original, which never reaches the file import) or in the library + let origin = origins.record(found.id, Origin::of(found)); ((**found).clone(), origin) } else if master != 0 { let master_id = ids.get(&master).copied().ok_or_else(|| error(format!("virtual copy {}: missing master", src.source_id)))?; diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index f01ef9bff5f..e2c82acdd90 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -994,6 +994,63 @@ mod tests { std::fs::remove_dir_all(dir).unwrap(); } + /// A photo browsed in Local joins the library through the job's file import, or, when its + /// original is offline, through the catalog step alone. Untouched since browsing, it holds only + /// what browsing read from its file (Created): the catalog's settings replace it, from the + /// camera's defaults, and nothing counts as preserved. Changed after browsing (Promoted), it + /// keeps its settings whole. Either way it is added. (Adapted from #3435.) + #[test] + fn a_browsed_photo_keeps_only_edits_made_after_browsing() { + for (changed, offline) in [(false, false), (true, false), (false, true), (true, true)] { + let case = format!("changed {changed} offline {offline}"); + let (dir, file, mut session) = file_with_develop_sidecar(&format!("lr-job-browsed-{changed}-{offline}"), "browsed-bytes"); + let path = if offline { "/missing/lr-job-browsed.jpg".to_string() } else { file }; + let id = session.catalog.alloc_photo_id(); + let mut browsed = + lightcraft_catalog::Photo::new(id, lightcraft_catalog::Source::File { path: path.clone() }, "photo.jpg", "JPEG", 20, 10, "before"); + browsed.local = true; + // as browsing a file whose XMP holds develop settings leaves it, with a setting the + // catalog's develop text leaves out (Clarity) + let mut from_file = (*browsed.develop).clone(); + from_file.effects.dehaze = 10.0; + from_file.effects.clarity = 15.0; + browsed.develop = Arc::new(from_file); + browsed.edited = Some("before".into()); + browsed.set_local_baseline(); + session.commit("Browse folder", crate::Op::AddPhoto { photo: Box::new(browsed) }).unwrap(); + assert!(session.catalog.photo(id).unwrap().untouched_local(), "{case}"); + if changed { + let mut edit = (*session.catalog.photo(id).unwrap().develop).clone(); + edit.effects.dehaze = 25.0; + session.set_develop(id, edit, "Personal edit").unwrap(); + } + let settings = "s = { Dehaze = -50 }"; + let report = if offline { + let mut prepared = prepared_for(&session, &path, 3); + prepared.data.photos[0].settings = settings.into(); + commit_prepared(&mut session, prepared).unwrap().report + } else { + let prepared = prepared_for(&session, &path, 3); + run_job_with(&mut session, prepared, vec![path.clone()], false, settings) + }; + assert_eq!(report["mapping"]["1"].as_u64(), Some(id.0), "{case}: {report}"); + assert_eq!(report["imported"], 1, "{case}: the browsed photo joins the library: {report}"); + assert_eq!((report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), (Some(1), Some(0)), "{case}: {report}"); + let photo = session.catalog.photo(id).unwrap(); + assert!(!photo.local, "{case}"); + if changed { + assert_eq!(report["preservedExistingEdits"], 1, "{case}: the edit came before the import: {report}"); + assert_eq!(photo.develop.effects.dehaze, 25.0, "{case}: the library's edit is kept"); + assert_eq!(photo.develop.effects.clarity, 15.0, "{case}: the kept settings are kept whole"); + } else { + assert_eq!(report["preservedExistingEdits"], 0, "{case}: browsing read the file, nobody edited it: {report}"); + assert_eq!(photo.develop.effects.dehaze, -50.0, "{case}: the catalog's settings replace the file's"); + assert_eq!(photo.develop.effects.clarity, 0.0, "{case}: a setting the catalog leaves out is not the file's"); + } + std::fs::remove_dir_all(dir).unwrap(); + } + } + /// A new virtual copy is a record the job makes too: its catalog settings start from the /// camera's defaults, not from its master's, so a setting the copy's develop text leaves out /// (Lightroom omits those at zero) is zero, while the master keeps its own. diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index 665902c55ee..5926ea371e2 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -91,9 +91,13 @@ image id with its reason, `missingFile`, `missingFolder`, `missingRoot`, `incomp `masterSkipped`), also in `library.inspectLightroom`, and the desktop result window says how many in the UI language. Virtual copies count as added records too; reimport reports zero additions when all records already exist. Existing LightCraft -edits are preserved by default; `updateExisting=true` explicitly replaces them. A record the import -itself adds is not an existing edit: when its file has an XMP sidecar with develop settings, the -catalog's settings still apply on top (#3707). Persistent import +edits are preserved by default; `updateExisting=true` explicitly replaces them. Settings read from an +original's own XMP (embedded or a sidecar) while the import adds it, or while it was browsed, are not +existing edits: a record the import itself adds, or a Local photo unchanged since browsing, takes the +catalog's settings (#3434, #3707). They start from the camera's defaults, not from what the file's +XMP, a default import preset or a virtual copy's master gave the record, since Lightroom leaves +settings at zero out of its develop text. Any change after browsing, a rating or keyword included, +makes a Local photo's settings count as existing. Persistent import identity prevents reimport from duplicating virtual copies and collections. One undo step reverses catalog changes; any saved recovery archives remain available. diff --git a/docs/whats-new.md b/docs/whats-new.md index 1cf62c3518a..3a753e36486 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -156,6 +156,15 @@ inside the corrected photo, as in Lightroom, so no grey corners or edge marks show. Perspective corrections still need Constrain Crop to do the same. +### A Lightroom catalog's edits win over the settings saved in its raws +- Importing a Lightroom Classic catalog gives every photo it adds, and every photo only browsed and not changed + since, the catalog's develop settings. Before, a photo whose file held XMP settings (embedded in a DNG, or in a + `.xmp` sidecar) kept those instead, so any edit made in Lightroom since its metadata was last saved to the file + was lost, and the import report counted the photo as one whose existing edits it had preserved. A setting the + catalog leaves at zero is zero, not what the file's XMP or a default import preset said. A photo edited in the + library still keeps its settings, and so does a browsed one changed in any way since browsing (a rating or a + keyword counts), unless `library.importLightroom` is run with `updateExisting`. + ### A Lightroom catalog import says where every photo went - When a catalog import finishes, the message counts the catalog's photos (virtual copies included) and how many were added, and also how many were already in the library, are in Recently Deleted, aren't a file type LightCraft From e2cf557d5d3538670f185f4dd5e9e327e197b89b Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 05:00:32 -0600 Subject: [PATCH 18/22] fix(engine): unreadable catalog develop text leaves a made record as it was A record a Lightroom import makes is reset to the camera's defaults before the catalog's settings apply. When the row's develop text can't be read (truncated, not a settings table), the reset was committed with nothing on top, losing the settings the file's XMP, a default preset or a virtual copy's master gave the record, where before only a warning changed. The text is now read once, before the reset, which waits for settings to replace them with. The docs say the reset applies when the catalog has develop settings for the photo. Found by the GPT-6 Astra review of the #3435 port. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 79 +++++++++++++++++--------- crates/engine/src/lightroom_job.rs | 16 ++++++ docs/lightroom-catalog-import.md | 7 ++- docs/whats-new.md | 5 +- 4 files changed, 75 insertions(+), 32 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index da0abde379e..4155720fb0a 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -787,6 +787,23 @@ fn ensure_read_active(cancel: &AtomicBool) -> Result<(), String> { if cancel.load(Ordering::Relaxed) { Err("Lightroom import cancelled".into()) } else { Ok(()) } } +/// A catalog row's develop text, read: its settings as XMP properties, their values, and how many +/// deferred adjustments (`-999999`) it held. Fails on text that isn't a Lua settings table. +type CatalogSettings = (crate::crs::Props, crate::crs_masks::Values, usize); + +fn read_settings(text: &str) -> Result { + let mut root = crate::preset_import::parse_lua(text)?; + let deferred = strip_lua_sentinels(&mut root); + let (props, mut values) = crate::preset_import::lua_settings_props(&root)?; + // Catalog Lua names the component inversion `Inverted` while XMP's is `MaskInverted`; + // rename it so an inverted mask keeps its inversion instead of importing as normal. + for v in values.values_mut() { + alias_catalog_inverted(v); + } + Ok((props, values, deferred)) +} + +#[cfg(test)] fn mapped_settings( text: &str, target: crate::crs::Target, @@ -795,14 +812,19 @@ fn mapped_settings( stored_aspect: f64, user: Orientation, ) -> Result<(Value, Vec), String> { - let mut root = crate::preset_import::parse_lua(text)?; - let deferred = strip_lua_sentinels(&mut root); - let (mut props, mut values) = crate::preset_import::lua_settings_props(&root)?; - // Catalog Lua names the component inversion `Inverted` while XMP's is `MaskInverted`; - // rename it so an inverted mask keeps its inversion instead of importing as normal. - for v in values.values_mut() { - alias_catalog_inverted(v); - } + Ok(mapped(read_settings(text)?, target, aspect, orientation, stored_aspect, user)) +} + +/// [`read_settings`]' settings as a develop patch for the photo. +fn mapped( + settings: CatalogSettings, + target: crate::crs::Target, + aspect: f64, + orientation: Orientation, + stored_aspect: f64, + user: Orientation, +) -> (Value, Vec) { + let (mut props, values, deferred) = settings; // A catalog's develop settings carry the crop edges and angle but no `HasCrop` (XMP has it): // any crop field means the photo is cropped. const CROP: [&str; 5] = ["crs:CropLeft", "crs:CropTop", "crs:CropRight", "crs:CropBottom", "crs:CropAngle"]; @@ -819,7 +841,7 @@ fn mapped_settings( if deferred > 0 { unknown.push("Deferred Lightroom adjustments (-999999)".into()); } - Ok((partial, unknown)) + (partial, unknown) } /// Lightroom's `Adobe_images.orientation`: where the stored image's top-left and top-right corners @@ -1419,11 +1441,14 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co if keep_develop { preserved += 1; } + // the catalog's develop settings this photo takes, read once (none to take: no text, or + // the record's own edit is kept) + let settings = (!src.settings.is_empty() && !keep_develop).then(|| read_settings(&src.settings)); // Lightroom leaves settings at zero (Clarity, Texture, …) out of its develop text, so the // catalog's settings for a record the job made start from the camera's defaults, not from // what its file's XMP, a default import preset or a virtual copy's master gave it (#3434). - // With no develop text there is nothing to replace. - if !origin.was_there() && !src.settings.is_empty() { + // With no develop text, or text that can't be read, there is nothing to replace them with. + if !origin.was_there() && matches!(settings, Some(Ok(_))) { p.develop = Arc::new(p.camera_defaults()); } let orientation = lightroom_orientation(text(&src.image, "orientation")).unwrap_or_default(); @@ -1453,24 +1478,24 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co if !src.keywords.is_empty() { p.meta.keywords = src.keywords.clone(); } - if !src.settings.is_empty() && !keep_develop { - match mapped_settings( - &src.settings, - crate::crs::Target::for_photo(&p), - p.width.max(1) as f64 / p.height.max(1) as f64, - orientation, - stored_aspect, - p.develop.orientation, - ) { - Ok((partial, unknown)) => { - p.develop = Arc::new(lightcraft_develop::apply_partial(&p.develop, &partial, 1.0)); - p.edited = Some(now.clone()); - if !unknown.is_empty() { - unmapped.insert(src.source_id, unknown); - } + match settings { + Some(Ok(settings)) => { + let (partial, unknown) = mapped( + settings, + crate::crs::Target::for_photo(&p), + p.width.max(1) as f64 / p.height.max(1) as f64, + orientation, + stored_aspect, + p.develop.orientation, + ); + p.develop = Arc::new(lightcraft_develop::apply_partial(&p.develop, &partial, 1.0)); + p.edited = Some(now.clone()); + if !unknown.is_empty() { + unmapped.insert(src.source_id, unknown); } - Err(e) => warnings.push(format!("image {} settings: {e}", src.source_id)), } + Some(Err(e)) => warnings.push(format!("image {} settings: {e}", src.source_id)), + None => {} } if keep_develop { (p.develop, p.edited) = previous_develop; diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index e2c82acdd90..6752e083147 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -1051,6 +1051,22 @@ mod tests { } } + /// A record the job made whose catalog develop text can't be read keeps what its file gave it: + /// the reset to the camera's defaults waits for settings to replace them with, so the warning + /// is the only change. + #[test] + fn unreadable_catalog_settings_leave_a_made_record_as_its_file_gave_it() { + let (dir, path, mut session) = file_with_develop_sidecar("lr-job-unreadable-settings", "unreadable-bytes"); + let prepared = prepared_for(&session, &path, 3); + let report = run_job_with(&mut session, prepared, vec![path.clone()], false, "s = {"); + let id = lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap()); + let photo = session.catalog.photo(id).unwrap(); + assert_eq!((photo.develop.light.exposure, photo.develop.effects.clarity), (2.0, 30.0), "the sidecar's settings: {report}"); + assert!(report["warnings"].as_array().unwrap().iter().any(|w| w.as_str().is_some_and(|w| w.contains("settings"))), "{report}"); + assert_eq!(report["preservedExistingEdits"], 0, "{report}"); + std::fs::remove_dir_all(dir).unwrap(); + } + /// A new virtual copy is a record the job makes too: its catalog settings start from the /// camera's defaults, not from its master's, so a setting the copy's develop text leaves out /// (Lightroom omits those at zero) is zero, while the master keeps its own. diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index 5926ea371e2..21970ac5920 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -94,9 +94,10 @@ records already exist. Existing LightCraft edits are preserved by default; `updateExisting=true` explicitly replaces them. Settings read from an original's own XMP (embedded or a sidecar) while the import adds it, or while it was browsed, are not existing edits: a record the import itself adds, or a Local photo unchanged since browsing, takes the -catalog's settings (#3434, #3707). They start from the camera's defaults, not from what the file's -XMP, a default import preset or a virtual copy's master gave the record, since Lightroom leaves -settings at zero out of its develop text. Any change after browsing, a rating or keyword included, +catalog's settings (#3434, #3707). When the catalog has develop settings for the photo, they start +from the camera's defaults, not from what the file's XMP, a default import preset or a virtual +copy's master gave the record, since Lightroom leaves settings at zero out of its develop text; +without any, the record keeps what it has. Any change after browsing, a rating or keyword included, makes a Local photo's settings count as existing. Persistent import identity prevents reimport from duplicating virtual copies and collections. One undo step reverses catalog changes; any saved recovery archives remain available. diff --git a/docs/whats-new.md b/docs/whats-new.md index 3a753e36486..2cd3faa6e48 100644 --- a/docs/whats-new.md +++ b/docs/whats-new.md @@ -160,8 +160,9 @@ - Importing a Lightroom Classic catalog gives every photo it adds, and every photo only browsed and not changed since, the catalog's develop settings. Before, a photo whose file held XMP settings (embedded in a DNG, or in a `.xmp` sidecar) kept those instead, so any edit made in Lightroom since its metadata was last saved to the file - was lost, and the import report counted the photo as one whose existing edits it had preserved. A setting the - catalog leaves at zero is zero, not what the file's XMP or a default import preset said. A photo edited in the + was lost, and the import report counted the photo as one whose existing edits it had preserved. When the catalog + has develop settings for a photo, a setting it leaves at zero is zero, not what the file's XMP or a default import + preset said. A photo edited in the library still keeps its settings, and so does a browsed one changed in any way since browsing (a rating or a keyword counts), unless `library.importLightroom` is run with `updateExisting`. From 3848d8483c5bb5f337f2a5e4b03099ec2235e3a1 Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 06:27:19 -0600 Subject: [PATCH 19/22] fix(engine): a Lightroom import reports what a made record's XMP sidecar doesn't apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A catalog photo whose file is a content duplicate gets a record of its own, made in the catalog's apply from its file and XMP sidecar (`start_from_file`). The `SidecarData` it returned was dropped, so what the sidecar named and LightCraft doesn't apply (a camera profile, Upright geometry, unmapped adjustments) never reached the report: the photo imported with partial develop settings and no notice. The same was true of a record the job's file import adds: `files.warnings` wasn't read. Both now say it, as `image XMP sidecar of : …` in the report's warnings, while the record keeps the sidecar's develop settings (no catalog develop text, or text that can't be read). When the catalog's settings are read they replace the sidecar's from the camera's defaults (#3434), so there is nothing to warn about. A sidecar's unmapped fields are listed up to twelve. Test: `a_sidecar_s_warnings_reach_the_report_while_its_develop_settings_stand` (a duplicate and a new file, with and without catalog settings, through the job's real route). Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 62 +++++++++++++++++++++++++- crates/engine/src/lightroom_job.rs | 40 +++++++++++++++++ docs/lightroom-catalog-import.md | 6 ++- 3 files changed, 105 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 4155720fb0a..34fca68853f 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -1305,6 +1305,10 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // Where each record this job lands on came from, from the file import on: what the import // does to the record follows from it (its develop settings, the report's breakdown). let mut origins = std::mem::take(&mut files.origins); + // What the XMP sidecars of the files this job's file import read named and LightCraft doesn't + // apply (a camera profile, Upright geometry, unmapped fields), by path: the report says it for + // the record made from the file (see `sidecar_warning`). + let mut sidecar_warnings = warnings_by_path(std::mem::take(&mut files.warnings)); // The records a catalog photo has landed on so far: the first one counts it as added (or // promotes it), any other catalog photo with the same path finds it already there. let mut claimed = HashSet::new(); @@ -1341,12 +1345,15 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co .filter(|id| s.catalog.photo(*id).is_some_and(|p| source_path(p).is_some_and(|path| key(path) == key(&src.path)))); let existing_id = indexed.or_else(|| if master == 0 { by_path.get(&key(&src.path)).copied() } else { None }); let mut trashed = false; + // the warnings of the XMP sidecar that gave this record its develop settings, if one did + let mut from_sidecar = Vec::new(); let (mut p, origin) = if let Some(found) = existing_id.and_then(|id| s.catalog.photo(id)) { trashed = found.deleted; // what the job already says of it (a record its file import made or promoted), else // what it was before the job: browsed in Local (untouched since or changed, as for an // offline original, which never reaches the file import) or in the library let origin = origins.record(found.id, Origin::of(found)); + from_sidecar = made_from_file(&mut sidecar_warnings, origin, master, &src.path); ((**found).clone(), origin) } else if master != 0 { let master_id = ids.get(&master).copied().ok_or_else(|| error(format!("virtual copy {}: missing master", src.source_id)))?; @@ -1408,7 +1415,7 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // as a file import of it: its file's metadata and capture time, the import defaults // (as-shot white balance, embedded lens corrections, the default preset), its XMP // sidecar; the catalog's settings and metadata apply on top - crate::import::start_from_file(s, &mut p, file, &now); + from_sidecar = crate::import::start_from_file(s, &mut p, file, &now).map(|sc| sc.warnings).unwrap_or_default(); (p, Origin::Created) } else { let id = s.catalog.alloc_photo_id(); @@ -1450,6 +1457,9 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co // With no develop text, or text that can't be read, there is nothing to replace them with. if !origin.was_there() && matches!(settings, Some(Ok(_))) { p.develop = Arc::new(p.camera_defaults()); + } else { + // the sidecar's develop settings stand, so what it named and isn't applied is said + warnings.extend(from_sidecar.iter().map(|warning| sidecar_warning(src, warning))); } let orientation = lightroom_orientation(text(&src.image, "orientation")).unwrap_or_default(); let stored_aspect = number(&src.image, "fileWidth") as f64 / number(&src.image, "fileHeight") as f64; @@ -1567,6 +1577,56 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co }) } +/// The file import's XMP sidecar warnings, by path ([`key`]). +fn warnings_by_path(warnings: Vec) -> HashMap> { + let mut out: HashMap> = HashMap::new(); + for warning in warnings { + out.entry(key(&warning.path)).or_default().push(warning); + } + out +} + +/// The sidecar warnings of a record the job's file import made from the file at `path` (a master +/// whose origin is `Created`), taken once: none for any other record. +fn made_from_file( + warnings: &mut HashMap>, + origin: Origin, + master: i64, + path: &str, +) -> Vec { + if origin == Origin::Created && master == 0 { warnings.remove(&key(path)).unwrap_or_default() } else { Vec::new() } +} + +/// A report line for what a catalog photo's XMP sidecar named that LightCraft doesn't apply (the +/// file import's [`crate::import::ImportWarning`], which the import window words in the UI +/// language), for a record whose develop settings came from that sidecar. A sidecar can name any +/// number of unmapped fields: past twelve the rest are an ellipsis. +fn sidecar_warning(src: &CatalogPhoto, warning: &crate::import::ImportWarning) -> String { + use crate::import::{ImportUprightMode as Mode, ImportWarningCode as Code}; + let what = match warning.code { + Code::CameraProfile => { + format!("the XMP profile \"{}\" was not applied; colors may differ from Lightroom", warning.profile.as_deref().unwrap_or_default()) + } + Code::UprightGeometry => match warning.mode.unwrap_or(Mode::Unknown) { + Mode::Off => "Lightroom geometry was not preserved; the saved transform is ignored because Upright is Off".into(), + Mode::Guided => "Lightroom geometry was not preserved; Guided Upright's saved transform is unsupported".into(), + Mode::Auto => "Lightroom geometry was not preserved; Auto Upright will be recalculated".into(), + Mode::Level => "Lightroom geometry was not preserved; Level Upright will be recalculated".into(), + Mode::Vertical => "Lightroom geometry was not preserved; Vertical Upright will be recalculated".into(), + Mode::Full => "Lightroom geometry was not preserved; Full Upright will be recalculated".into(), + Mode::Unknown => "Lightroom geometry was not preserved; the saved Upright transform is unsupported".into(), + }, + Code::UnmappedXmp => { + let mut fields: Vec<&str> = warning.fields.iter().take(12).map(String::as_str).collect(); + if warning.fields.len() > 12 { + fields.push("…"); + } + format!("XMP adjustments were not imported: {}", fields.join(", ")) + } + }; + format!("image {} XMP sidecar of {}: {what}", src.source_id, src.path) +} + /// The collection set a Lightroom collection's album goes into (`None`: the top level), and whether that isn't its /// Lightroom parent. A LightCraft album nests only in a folder, but Lightroom also keeps a print, book, slideshow or /// web gallery (or, in an odd catalog, a collection) inside a plain or smart collection, and a parent can be diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index 6752e083147..074933b67a4 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -796,6 +796,46 @@ mod tests { std::fs::remove_dir_all(dir).unwrap(); } + /// What a photo's XMP sidecar names and LightCraft doesn't apply (here a camera profile) is + /// said in the report for the record the job makes from that file, a content duplicate's (whose + /// sidecar the catalog's apply reads) as well as one the file import adds, while the record + /// keeps the sidecar's develop settings. Catalog settings that replace them leave nothing to + /// warn about. (Before, the report never said it, and the photo had partial settings.) + #[test] + fn a_sidecar_s_warnings_reach_the_report_while_its_develop_settings_stand() { + for duplicate in [true, false] { + for settings in ["", "s = { Exposure2012 = -1.0 }"] { + let case = format!("duplicate {duplicate}, settings {settings:?}"); + let (dir, path, mut session) = + file_with_develop_sidecar(&format!("lr-job-sidecar-warning-{duplicate}-{}", settings.len()), "warned-bytes"); + std::fs::write( + dir.join("photo.xmp"), + r#" + +"#, + ) + .unwrap(); + let other = duplicate.then(|| edited_record(&mut session, "/elsewhere/other.jpg", false, Some("warned-bytes"))); + let prepared = prepared_for(&session, &path, 3); + let report = run_job_with(&mut session, prepared, vec![path.clone()], false, settings); + let id = lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap()); + assert_ne!(Some(id), other, "{case}: a record of its own: {report}"); + assert_eq!((report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), (Some(1), Some(0)), "{case}: {report}"); + let said: Vec<&str> = + report["warnings"].as_array().unwrap().iter().filter_map(Value::as_str).filter(|w| w.contains("Camera Faithful")).collect(); + let stands = settings.is_empty(); + assert_eq!(session.catalog.photo(id).unwrap().develop.light.exposure, if stands { 2.0 } else { -1.0 }, "{case}"); + if stands { + assert_eq!(said.len(), 1, "{case}: {report}"); + assert!(said[0].starts_with("image 1 XMP sidecar of ") && said[0].contains(&path), "{case}: {}", said[0]); + } else { + assert!(said.is_empty(), "{case}: the catalog's settings replace the sidecar's: {report}"); + } + std::fs::remove_dir_all(dir).unwrap(); + } + } + } + /// Two catalog photos at the same path whose file is a content duplicate: the second lands on /// no library record (the first one's is still being made), so the job makes another one from /// the file and its sidecar. That record is the job's own too: the catalog's settings apply and diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index 21970ac5920..e27babbecd3 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -97,8 +97,10 @@ existing edits: a record the import itself adds, or a Local photo unchanged sinc catalog's settings (#3434, #3707). When the catalog has develop settings for the photo, they start from the camera's defaults, not from what the file's XMP, a default import preset or a virtual copy's master gave the record, since Lightroom leaves settings at zero out of its develop text; -without any, the record keeps what it has. Any change after browsing, a rating or keyword included, -makes a Local photo's settings count as existing. Persistent import +without any, the record keeps what it has, and the result's warnings say what its XMP sidecar +names that LightCraft doesn't apply (a camera profile, Upright geometry, unmapped adjustments). +Any change after browsing, a rating or keyword included, makes a Local photo's settings count as +existing. Persistent import identity prevents reimport from duplicating virtual copies and collections. One undo step reverses catalog changes; any saved recovery archives remain available. From d4b123c0478499a5aa1e5bf0cac808b9e0c00fed Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 06:27:19 -0600 Subject: [PATCH 20/22] fix(ui-egui): the refused-paths line says what the warnings name The Lightroom result window said the warnings list the photos on refused paths, but a refused root folder gets one warning for the folder, not one per photo. The line now says the warnings name each photo, or its folder when the whole folder isn't opened; all 17 format catalogs follow. Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/locales/cs-formats.json | 2 +- crates/ui-egui/locales/de-formats.json | 2 +- crates/ui-egui/locales/es-formats.json | 2 +- crates/ui-egui/locales/fi-formats.json | 2 +- crates/ui-egui/locales/fr-formats.json | 2 +- crates/ui-egui/locales/id-formats.json | 2 +- crates/ui-egui/locales/it-formats.json | 2 +- crates/ui-egui/locales/ja-formats.json | 2 +- crates/ui-egui/locales/ka-formats.json | 2 +- crates/ui-egui/locales/pl-formats.json | 2 +- crates/ui-egui/locales/pt-br-formats.json | 2 +- crates/ui-egui/locales/ru-formats.json | 2 +- crates/ui-egui/locales/sv-formats.json | 2 +- crates/ui-egui/locales/uk-formats.json | 2 +- crates/ui-egui/locales/vi-formats.json | 2 +- crates/ui-egui/locales/zh-hans-formats.json | 2 +- crates/ui-egui/locales/zh-hant-formats.json | 2 +- crates/ui-egui/src/lightroom_import.rs | 4 ++-- 18 files changed, 19 insertions(+), 19 deletions(-) diff --git a/crates/ui-egui/locales/cs-formats.json b/crates/ui-egui/locales/cs-formats.json index afd7627981c..1b2bae3993c 100644 --- a/crates/ui-egui/locales/cs-formats.json +++ b/crates/ui-egui/locales/cs-formats.json @@ -285,7 +285,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "Fotografie katalogu, které už v této knihovně byly a byly aktualizovány z katalogu: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Neimportované fotografie katalogu, jejichž typy souborů LightCraft nečte: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Neimportované fotografie katalogu, jejichž typy souborů LightCraft nečte ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Neimportované fotografie katalogu, jejichž originály jsou na jiném počítači nebo zařízení nebo jejichž cesty v katalogu nejsou platné: {path_refused}. Varování je vypisují.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "Neimportované fotografie katalogu, jejichž originály jsou na jiném počítači nebo zařízení nebo jejichž cesty v katalogu nejsou platné: {path_refused}. Varování uvádějí každou fotografii, nebo její složku, když se neotevře celá složka.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Neimportované obrázky katalogu: {skipped}. Jejich záznamy v katalogu jsou neúplné.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Chybějící originály: {missing}. Jejich záznamy jsou v katalogu dostupné; použijte Najít chybějící fotografie a znovu je propojte.", "Applied {name}": "Použito: {name}", diff --git a/crates/ui-egui/locales/de-formats.json b/crates/ui-egui/locales/de-formats.json index fcce0e3c83a..d3955b20a9f 100644 --- a/crates/ui-egui/locales/de-formats.json +++ b/crates/ui-egui/locales/de-formats.json @@ -289,7 +289,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} Katalogfotos waren schon in dieser Bibliothek und wurden aus dem Katalog aktualisiert.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} Katalogfotos wurden nicht importiert: LightCraft liest ihre Dateitypen nicht.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} Katalogfotos wurden nicht importiert: LightCraft liest ihre Dateitypen nicht ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} Katalogfotos wurden nicht importiert: Ihre Originale liegen auf einem anderen Computer oder einem Gerät, oder ihre Pfade im Katalog sind ungültig. Die Warnungen führen sie auf.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "{path_refused} Katalogfotos wurden nicht importiert: Ihre Originale liegen auf einem anderen Computer oder einem Gerät, oder ihre Pfade im Katalog sind ungültig. Die Warnungen nennen jedes Foto oder, wenn der ganze Ordner nicht geöffnet wird, seinen Ordner.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} Katalogbilder wurden nicht importiert, weil ihre Einträge im Katalog unvollständig sind.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} Originale fehlen. Ihre Katalogeinträge sind verfügbar; verwende „Fehlende Fotos suchen“, um sie neu zu verknüpfen.", "Applied {name}": "{name} angewendet", diff --git a/crates/ui-egui/locales/es-formats.json b/crates/ui-egui/locales/es-formats.json index 1011fa6524e..ec64b8a6491 100644 --- a/crates/ui-egui/locales/es-formats.json +++ b/crates/ui-egui/locales/es-formats.json @@ -290,7 +290,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} fotos del catálogo ya estaban en esta biblioteca y se actualizaron desde el catálogo.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "No se importaron {not_supported} fotos del catálogo: LightCraft no lee sus tipos de archivo.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "No se importaron {not_supported} fotos del catálogo: LightCraft no lee sus tipos de archivo ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "No se importaron {path_refused} fotos del catálogo: sus originales están en otro ordenador o en un dispositivo, o sus rutas en el catálogo no son válidas. Los avisos las enumeran.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "No se importaron {path_refused} fotos del catálogo: sus originales están en otro ordenador o en un dispositivo, o sus rutas en el catálogo no son válidas. Los avisos nombran cada foto, o su carpeta cuando no se abre la carpeta entera.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "No se importaron {skipped} imágenes del catálogo porque sus registros en el catálogo están incompletos.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Faltan {missing} originales. Sus registros del catálogo están disponibles; usa Buscar fotos que faltan para volver a vincularlos.", "Applied {name}": "Se aplicó {name}", diff --git a/crates/ui-egui/locales/fi-formats.json b/crates/ui-egui/locales/fi-formats.json index a475fe8d6a3..28a1259d28e 100644 --- a/crates/ui-egui/locales/fi-formats.json +++ b/crates/ui-egui/locales/fi-formats.json @@ -274,7 +274,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "Katalogin kuvia, jotka olivat jo tässä kirjastossa ja päivitettiin katalogista: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Katalogin kuvia ei tuotu, koska LightCraft ei lue niiden tiedostotyyppejä: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Katalogin kuvia ei tuotu, koska LightCraft ei lue niiden tiedostotyyppejä ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Katalogin kuvia ei tuotu, koska niiden alkuperäiset ovat toisella tietokoneella tai laitteella tai niiden polut katalogissa eivät kelpaa: {path_refused}. Varoitukset luettelevat ne.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "Katalogin kuvia ei tuotu, koska niiden alkuperäiset ovat toisella tietokoneella tai laitteella tai niiden polut katalogissa eivät kelpaa: {path_refused}. Varoitukset nimeävät jokaisen kuvan tai sen kansion, kun koko kansiota ei avata.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "{stage}… {:.0}%": "{stage}… {:.0}%", "{s} s of AV1 video": "{s} s AV1-videota", diff --git a/crates/ui-egui/locales/fr-formats.json b/crates/ui-egui/locales/fr-formats.json index 21bb30461da..b220392ff42 100644 --- a/crates/ui-egui/locales/fr-formats.json +++ b/crates/ui-egui/locales/fr-formats.json @@ -290,7 +290,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} photos du catalogue étaient déjà dans cette photothèque et ont été mises à jour depuis le catalogue.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} photos du catalogue n’ont pas été importées : LightCraft ne lit pas leurs types de fichiers.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} photos du catalogue n’ont pas été importées : LightCraft ne lit pas leurs types de fichiers ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} photos du catalogue n’ont pas été importées : leurs originaux sont sur un autre ordinateur ou un périphérique, ou leurs chemins dans le catalogue ne sont pas valides. Les avertissements les listent.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "{path_refused} photos du catalogue n’ont pas été importées : leurs originaux sont sur un autre ordinateur ou un périphérique, ou leurs chemins dans le catalogue ne sont pas valides. Les avertissements nomment chaque photo, ou son dossier quand le dossier entier n’est pas ouvert.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} images du catalogue n’ont pas été importées, car leurs entrées dans le catalogue sont incomplètes.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} originaux sont manquants. Leurs entrées de catalogue sont disponibles ; utilisez Rechercher les photos manquantes pour rétablir les liens.", "Applied {name}": "{name} appliqué", diff --git a/crates/ui-egui/locales/id-formats.json b/crates/ui-egui/locales/id-formats.json index 2cf231ee44c..bc13e559c20 100644 --- a/crates/ui-egui/locales/id-formats.json +++ b/crates/ui-egui/locales/id-formats.json @@ -313,7 +313,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} foto katalog sudah ada di pustaka ini dan diperbarui dari katalog.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} foto katalog tidak diimpor: LightCraft tidak membaca jenis file-nya.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} foto katalog tidak diimpor: LightCraft tidak membaca jenis file-nya ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} foto katalog tidak diimpor: file aslinya ada di komputer atau perangkat lain, atau jalurnya di katalog tidak valid. Peringatan mencantumkannya.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "{path_refused} foto katalog tidak diimpor: file aslinya ada di komputer atau perangkat lain, atau jalurnya di katalog tidak valid. Peringatan menyebutkan setiap foto, atau foldernya jika seluruh folder tidak dibuka.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "Listing folders — folders: {folders}, files: {files}": "Mendata folder — folder: {folders}, file: {files}", "Added {n} photo{}": "{n} foto ditambahkan{:.0}", diff --git a/crates/ui-egui/locales/it-formats.json b/crates/ui-egui/locales/it-formats.json index b1c670b988b..dd18a1eb142 100644 --- a/crates/ui-egui/locales/it-formats.json +++ b/crates/ui-egui/locales/it-formats.json @@ -268,7 +268,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "Foto del catalogo già in questa libreria, aggiornate dal catalogo: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Foto del catalogo non importate perché LightCraft non legge i loro tipi di file: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Foto del catalogo non importate perché LightCraft non legge i loro tipi di file ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Foto del catalogo non importate perché i loro originali sono su un altro computer o su un dispositivo, o i loro percorsi nel catalogo non sono validi: {path_refused}. Gli avvisi le elencano.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "Foto del catalogo non importate perché i loro originali sono su un altro computer o su un dispositivo, o i loro percorsi nel catalogo non sono validi: {path_refused}. Gli avvisi indicano ogni foto, o la sua cartella quando l'intera cartella non viene aperta.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} immagini del catalogo non sono state importate perché i loro record nel catalogo sono incompleti.", "· {in_source} identical copies": "· copie identiche: {in_source}", "{what} merge added at {mp}, the largest a panorama can be (its full size is {full})": "Unione {what} aggiunta a {mp}, la dimensione massima di un panorama (la dimensione piena è {full})", diff --git a/crates/ui-egui/locales/ja-formats.json b/crates/ui-egui/locales/ja-formats.json index 87e997bc616..de6843d1618 100644 --- a/crates/ui-egui/locales/ja-formats.json +++ b/crates/ui-egui/locales/ja-formats.json @@ -294,7 +294,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "カタログの写真 {already} 枚はすでにこのライブラリにあり、カタログの内容で更新しました。", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "カタログの写真 {not_supported} 枚は読み込まれませんでした。LightCraft はそのファイル形式を読み込めません。", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "カタログの写真 {not_supported} 枚は読み込まれませんでした。LightCraft はそのファイル形式({types})を読み込めません。", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "カタログの写真 {path_refused} 枚は読み込まれませんでした。元画像が別のコンピューターやデバイス上にあるか、カタログ内のパスが無効です。警告に一覧があります。", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "カタログの写真 {path_refused} 枚は読み込まれませんでした。元画像が別のコンピューターやデバイス上にあるか、カタログ内のパスが無効です。警告には各写真が、フォルダー全体が開かれない場合はそのフォルダーが示されます。", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "カタログ内のレコードが不完全なため、{skipped}件の画像を読み込めませんでした。", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing}件のオリジナルが見つかりません。カタログのレコードは利用できます。「見つからない写真を検索」で再リンクしてください。", "Applied {name}": "{name} を適用しました", diff --git a/crates/ui-egui/locales/ka-formats.json b/crates/ui-egui/locales/ka-formats.json index 4a9531d02a2..99671e6d42b 100644 --- a/crates/ui-egui/locales/ka-formats.json +++ b/crates/ui-egui/locales/ka-formats.json @@ -298,7 +298,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "კატალოგის ფოტოები, რომლებიც უკვე იყო ამ ბიბლიოთეკაში და განახლდა კატალოგიდან: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ფაილის ტიპებს LightCraft ვერ კითხულობს: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ფაილის ტიპებს LightCraft ვერ კითხულობს ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ორიგინალები სხვა კომპიუტერზე ან მოწყობილობაზეა, ან რომელთა ბილიკები კატალოგში არასწორია: {path_refused}. ისინი გაფრთხილებებშია ჩამოთვლილი.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "არ დაიმპორტდა კატალოგის ფოტოები, რომელთა ორიგინალები სხვა კომპიუტერზე ან მოწყობილობაზეა, ან რომელთა ბილიკები კატალოგში არასწორია: {path_refused}. გაფრთხილებებში დასახელებულია თითოეული ფოტო, ან მისი საქაღალდე, როცა მთელი საქაღალდე არ იხსნება.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "კატალოგის {skipped} სურათი არ დაიმპორტდა, რადგან მათი ჩანაწერები კატალოგში არასრულია.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "დაკარგულია ორიგინალი: {missing}. მათი კატალოგის ჩანაწერები ხელმისაწვდომია; ხელახლა დასაკავშირებლად გამოიყენეთ „დაკარგული ფოტოების მოძებნა“.", "{n} JPEG files": "JPEG ფაილი: {n}", diff --git a/crates/ui-egui/locales/pl-formats.json b/crates/ui-egui/locales/pl-formats.json index d2dd958c840..e2207630ae9 100644 --- a/crates/ui-egui/locales/pl-formats.json +++ b/crates/ui-egui/locales/pl-formats.json @@ -279,7 +279,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "Zdjęcia katalogu, które już były w tej bibliotece i zostały zaktualizowane z katalogu: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Niezaimportowane zdjęcia katalogu, których typów plików LightCraft nie odczytuje: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Niezaimportowane zdjęcia katalogu, których typów plików LightCraft nie odczytuje ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Niezaimportowane zdjęcia katalogu, których oryginały są na innym komputerze lub urządzeniu albo których ścieżki w katalogu są nieprawidłowe: {path_refused}. Ostrzeżenia je wymieniają.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "Niezaimportowane zdjęcia katalogu, których oryginały są na innym komputerze lub urządzeniu albo których ścieżki w katalogu są nieprawidłowe: {path_refused}. Ostrzeżenia wymieniają każde zdjęcie albo jego folder, gdy cały folder nie jest otwierany.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Nie zaimportowano obrazów z katalogu: {skipped}. Ich rekordy w katalogu są niekompletne.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Brakujące oryginały: {missing}. Ich rekordy w katalogu są dostępne; użyj polecenia Znajdź brakujące zdjęcia, aby je ponownie powiązać.", "Applied {name}": "Zastosowano {name}", diff --git a/crates/ui-egui/locales/pt-br-formats.json b/crates/ui-egui/locales/pt-br-formats.json index 4812e11f35d..edfc69f929c 100644 --- a/crates/ui-egui/locales/pt-br-formats.json +++ b/crates/ui-egui/locales/pt-br-formats.json @@ -294,7 +294,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} fotos do catálogo já estavam nesta biblioteca e foram atualizadas a partir do catálogo.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} fotos do catálogo não foram importadas: o LightCraft não lê seus tipos de arquivo.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} fotos do catálogo não foram importadas: o LightCraft não lê seus tipos de arquivo ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} fotos do catálogo não foram importadas: seus originais estão em outro computador ou em um dispositivo, ou seus caminhos no catálogo não são válidos. Os avisos as listam.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "{path_refused} fotos do catálogo não foram importadas: seus originais estão em outro computador ou em um dispositivo, ou seus caminhos no catálogo não são válidos. Os avisos indicam cada foto, ou a pasta dela quando a pasta inteira não é aberta.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} imagens do catálogo não foram importadas porque seus registros no catálogo estão incompletos.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "{missing} originais estão ausentes. Seus registros no catálogo estão disponíveis; use Encontrar fotos ausentes para vinculá-los novamente.", "Applied {name}": "{name} aplicado", diff --git a/crates/ui-egui/locales/ru-formats.json b/crates/ui-egui/locales/ru-formats.json index 2b0f3b5f403..78a1af53d48 100644 --- a/crates/ui-egui/locales/ru-formats.json +++ b/crates/ui-egui/locales/ru-formats.json @@ -290,7 +290,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "Фото каталога, которые уже были в этой библиотеке и обновлены из каталога: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Не импортированы фото каталога, типы файлов которых LightCraft не читает: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Не импортированы фото каталога, типы файлов которых LightCraft не читает ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Не импортированы фото каталога, оригиналы которых находятся на другом компьютере или устройстве или пути которых в каталоге недопустимы: {path_refused}. Они перечислены в предупреждениях.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "Не импортированы фото каталога, оригиналы которых находятся на другом компьютере или устройстве или пути которых в каталоге недопустимы: {path_refused}. В предупреждениях названо каждое фото или его папка, если не открыта вся папка.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Не импортированы изображения каталога: {skipped}. Их записи в каталоге неполные.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Не найдены оригиналы: {missing}. Их записи каталога доступны; используйте поиск отсутствующих фотографий, чтобы восстановить ссылки.", "Applied {name}": "Применено: {name}", diff --git a/crates/ui-egui/locales/sv-formats.json b/crates/ui-egui/locales/sv-formats.json index 1cc704a4898..a88bf2e3e98 100644 --- a/crates/ui-egui/locales/sv-formats.json +++ b/crates/ui-egui/locales/sv-formats.json @@ -313,7 +313,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} katalogfoton fanns redan i det här biblioteket och har uppdaterats från katalogen.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} katalogfoton importerades inte: LightCraft läser inte deras filtyper.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} katalogfoton importerades inte: LightCraft läser inte deras filtyper ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} katalogfoton importerades inte: deras original finns på en annan dator eller en enhet, eller så är deras sökvägar i katalogen ogiltiga. Varningarna listar dem.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "{path_refused} katalogfoton importerades inte: deras original finns på en annan dator eller en enhet, eller så är deras sökvägar i katalogen ogiltiga. Varningarna namnger varje foto, eller dess mapp när hela mappen inte öppnas.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "Listing folders — folders: {folders}, files: {files}": "Listar mappar — mappar: {folders}, filer: {files}", "Added {n} photo{}": "{n} foto tillagda{:.0}", diff --git a/crates/ui-egui/locales/uk-formats.json b/crates/ui-egui/locales/uk-formats.json index 9da6aa67bbd..aa11b72ca44 100644 --- a/crates/ui-egui/locales/uk-formats.json +++ b/crates/ui-egui/locales/uk-formats.json @@ -290,7 +290,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "Фото каталогу, які вже були в цій бібліотеці й оновлені з каталогу: {already}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "Не імпортовано фото каталогу, типи файлів яких LightCraft не читає: {not_supported}.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "Не імпортовано фото каталогу, типи файлів яких LightCraft не читає ({types}): {not_supported}.", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "Не імпортовано фото каталогу, оригінали яких на іншому комп’ютері чи пристрої або шляхи яких у каталозі недійсні: {path_refused}. Їх перелічено в попередженнях.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "Не імпортовано фото каталогу, оригінали яких на іншому комп’ютері чи пристрої або шляхи яких у каталозі недійсні: {path_refused}. Попередження називають кожне фото або його папку, якщо не відкрито всю папку.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "Не імпортовано зображення каталогу: {skipped}. Їхні записи в каталозі неповні.", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "Не знайдено оригінали: {missing}. Їхні записи каталогу доступні; скористайтеся пошуком відсутніх фотографій, щоб відновити посилання.", "Applied {name}": "Застосовано: {name}", diff --git a/crates/ui-egui/locales/vi-formats.json b/crates/ui-egui/locales/vi-formats.json index 4338e6a40be..e51a6d13bf8 100644 --- a/crates/ui-egui/locales/vi-formats.json +++ b/crates/ui-egui/locales/vi-formats.json @@ -274,7 +274,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "{already} ảnh của danh mục đã có trong thư viện này và được cập nhật từ danh mục.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "{not_supported} ảnh của danh mục không được nhập: LightCraft không đọc được loại tệp của chúng.", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "{not_supported} ảnh của danh mục không được nhập: LightCraft không đọc được loại tệp của chúng ({types}).", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "{path_refused} ảnh của danh mục không được nhập: bản gốc của chúng nằm trên máy tính hoặc thiết bị khác, hoặc đường dẫn của chúng trong danh mục không hợp lệ. Các cảnh báo liệt kê chúng.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "{path_refused} ảnh của danh mục không được nhập: bản gốc của chúng nằm trên máy tính hoặc thiết bị khác, hoặc đường dẫn của chúng trong danh mục không hợp lệ. Các cảnh báo nêu tên từng ảnh, hoặc thư mục của ảnh khi cả thư mục không được mở.", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "{skipped} catalog images were not imported because their records in the catalog are incomplete.", "{stage}… {:.0}%": "{stage}… {:.0}%", "{s} s of AV1 video": "{s} s of AV1 video", diff --git a/crates/ui-egui/locales/zh-hans-formats.json b/crates/ui-egui/locales/zh-hans-formats.json index 771d8a81e4a..d7110545fea 100644 --- a/crates/ui-egui/locales/zh-hans-formats.json +++ b/crates/ui-egui/locales/zh-hans-formats.json @@ -294,7 +294,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "目录中有 {already} 张照片已在此图库中,并已根据目录更新。", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "目录中有 {not_supported} 张照片未导入:LightCraft 无法读取其文件类型。", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "目录中有 {not_supported} 张照片未导入:LightCraft 无法读取其文件类型({types})。", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "目录中有 {path_refused} 张照片未导入:其原始文件位于其他计算机或设备上,或其在目录中的路径无效。警告中列出了它们。", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "目录中有 {path_refused} 张照片未导入:其原始文件位于其他计算机或设备上,或其在目录中的路径无效。警告中会列出每张照片;若整个文件夹未打开,则列出该文件夹。", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "有 {skipped} 张图像未导入,因为它们在目录中的记录不完整。", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "有 {missing} 个原始文件缺失。其目录记录可用;请使用“查找缺失照片”重新链接文件。", "Applied {name}": "已应用 {name}", diff --git a/crates/ui-egui/locales/zh-hant-formats.json b/crates/ui-egui/locales/zh-hant-formats.json index 9fee419608e..d369c5c3f72 100644 --- a/crates/ui-egui/locales/zh-hant-formats.json +++ b/crates/ui-egui/locales/zh-hant-formats.json @@ -294,7 +294,7 @@ "{already} catalog photos were already in this library and were updated from the catalog.": "目錄中有 {already} 張相片已在此圖庫中,並已依目錄更新。", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types.": "目錄中有 {not_supported} 張相片未匯入:LightCraft 無法讀取其檔案類型。", "{not_supported} catalog photos were not imported: LightCraft doesn't read their file types ({types}).": "目錄中有 {not_supported} 張相片未匯入:LightCraft 無法讀取其檔案類型({types})。", - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.": "目錄中有 {path_refused} 張相片未匯入:其原始檔案位於其他電腦或裝置上,或其在目錄中的路徑無效。警告中列出了它們。", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.": "目錄中有 {path_refused} 張相片未匯入:其原始檔案位於其他電腦或裝置上,或其在目錄中的路徑無效。警告中會列出每張相片;若整個資料夾未開啟,則列出該資料夾。", "{skipped} catalog images were not imported because their records in the catalog are incomplete.": "有 {skipped} 張影像未匯入,因為它們在目錄中的記錄不完整。", "{missing} originals are missing. Their catalog records are available; use Find Missing Photos to relink them.": "有 {missing} 個原始檔案遺失。其目錄記錄可用;請使用「尋找遺失相片」重新連結檔案。", "Applied {name}": "已套用 {name}", diff --git a/crates/ui-egui/src/lightroom_import.rs b/crates/ui-egui/src/lightroom_import.rs index 507a4ed80ed..7fd6ab57471 100644 --- a/crates/ui-egui/src/lightroom_import.rs +++ b/crates/ui-egui/src/lightroom_import.rs @@ -406,7 +406,7 @@ fn result_dialog(value: &Value, summary: &str, catalog: &lightcraft_catalog::Cat let path_refused = count("pathRefused"); if path_refused > 0 { details.push(crate::i18n::tr_format!( - "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.", + "{path_refused} catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.", path_refused = path_refused )); } @@ -851,7 +851,7 @@ mod tests { "1 catalog photos were already in this library and were updated from the catalog.", "1 catalog photos are in this library's Recently Deleted and stay there; restore them from Recently Deleted to see them.", "2 catalog photos were not imported: LightCraft doesn't read their file types (MOV, MP4).", - "1 catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings list them.", + "1 catalog photos were not imported: their originals are on another computer or a device, or their paths in the catalog aren't valid. The warnings name each photo, or its folder when the whole folder isn't opened.", "1 catalog images were not imported because their records in the catalog are incomplete.", "1 originals are missing. Their catalog records are available; use Find Missing Photos to relink them.", ] From 989199754739371a812ba02b7c3da137b1d12cf3 Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Wed, 4 Nov 2026 13:35:59 -0600 Subject: [PATCH 21/22] fix(engine): catalog masters at one path go on from what the earlier one staged Two catalog masters at the same path land on one record, but a later one started from the record as committed before the batch: its SetDevelop replaced the develop settings the earlier master staged, so a later master without develop text left the record with its XMP sidecar's settings (whose warnings the earlier master had already taken). At an offline path, or one whose file is a content duplicate, the record wasn't committed yet, so the later master made a second record and both counted as added. Masters at a shared path now keep the photo they staged, and a later master at that path goes on from it: on a record the batch adds, it replaces the staged AddPhoto and counts as already in the library. Whether a record has an edit to keep is what it had before the job. Found by CodeRabbit on #3751. Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/lightroom_catalog.rs | 85 +++++++++++++++++++++++--- crates/engine/src/lightroom_job.rs | 55 +++++++++++++++-- docs/lightroom-catalog-import.md | 4 +- 3 files changed, 130 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/lightroom_catalog.rs b/crates/engine/src/lightroom_catalog.rs index 34fca68853f..4bc8f978f66 100644 --- a/crates/engine/src/lightroom_catalog.rs +++ b/crates/engine/src/lightroom_catalog.rs @@ -1324,6 +1324,11 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co let copy_masters: HashSet<_> = data.photos.iter().map(|p| number(&p.image, "masterImage")).filter(|id| *id != 0).collect(); let refused: HashSet<_> = data.photos.iter().filter(|p| matches!(p.original, Original::Refused(_))).map(|p| p.source_id).collect(); let mut planned: HashMap = HashMap::new(); + // Masters that share a path land on one record: a later one goes on from what an earlier one + // staged for it, not from the record as it was before the batch (whose develop settings would + // then replace the earlier one's) or, for a record the batch adds, from no record at all + // (which made a second one). + let mut shared = SharedPaths::of(&data); for src in photos { let master = number(&src.image, "masterImage"); // A refused path must not become a library record the app would look at later; its @@ -1347,14 +1352,17 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co let mut trashed = false; // the warnings of the XMP sidecar that gave this record its develop settings, if one did let mut from_sidecar = Vec::new(); - let (mut p, origin) = if let Some(found) = existing_id.and_then(|id| s.catalog.photo(id)) { + // (what an earlier master at its path staged for the record, else the record) + let found = existing_id.and_then(|id| shared.staged(id).or_else(|| s.catalog.photo(id).map(|p| &**p))); + let (mut p, origin) = if let Some(found) = found { trashed = found.deleted; - // what the job already says of it (a record its file import made or promoted), else - // what it was before the job: browsed in Local (untouched since or changed, as for an - // offline original, which never reaches the file import) or in the library + // what the job already says of it (a record its file import made or promoted, or one + // an earlier master at its path landed on), else what it was before the job: browsed + // in Local (untouched since or changed, as for an offline original, which never + // reaches the file import) or in the library let origin = origins.record(found.id, Origin::of(found)); from_sidecar = made_from_file(&mut sidecar_warnings, origin, master, &src.path); - ((**found).clone(), origin) + (found.clone(), origin) } else if master != 0 { let master_id = ids.get(&master).copied().ok_or_else(|| error(format!("virtual copy {}: missing master", src.source_id)))?; let mut p = planned @@ -1443,7 +1451,9 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co index.photos.insert(identity(&data, src), p.id.0); // Only a record that was there before the job can hold an edit made in the library. One the // job made has what its file and XMP sidecar gave it: the catalog's settings apply (#3707). - let keep_develop = origin.was_there() && p.edited.is_some() && !update_existing; + // (whether it has an edit is what it had before the job: an earlier master at its path may + // have given it the catalog's settings) + let keep_develop = origin.was_there() && s.catalog.photo(p.id).is_some_and(|old| old.edited.is_some()) && !update_existing; let previous_develop = (p.develop.clone(), p.edited.clone()); if keep_develop { preserved += 1; @@ -1521,6 +1531,7 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co planned.insert(photo_id, p.clone()); } if let Some(old) = s.catalog.photo(p.id) { + shared.stage(master, &src.path, &p, None); if old.kind != p.kind { // Repair older imports with existing reversible operations. Removing just the // record leaves album/stack membership intact; the enclosing batch is atomic. @@ -1549,9 +1560,12 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co ]); ops.push(Op::SetDevelop { id: p.id, settings: p.develop.clone(), label: "Lightroom catalog".into(), edited: p.edited.clone() }); } else { - imported += 1; - added += 1; - ops.push(Op::AddPhoto { photo: Box::new(p) }); + // a record the batch adds, unless an earlier master at this path added it: then it is + // already there + let new = usize::from(shared.add(master, &src.path, p, &mut ops)); + imported += new; + added += new; + already += 1 - new; } by_path.entry(key(&src.path)).or_insert(photo_id); } @@ -1577,6 +1591,59 @@ pub(crate) fn apply_prepared(s: &mut crate::Session, mut data: CatalogImport, co }) } +/// The catalog masters that share a path, and what each staged for its record in a Lightroom +/// import's batch, so that a later one goes on from it (see [`apply_prepared`]). Only masters at a +/// shared path keep their photo here, with the place in the batch of the record's `AddPhoto` when +/// the batch adds it. +struct SharedPaths { + /// the paths ([`key`]) more than one master has + paths: HashSet, + staged: HashMap)>, +} + +impl SharedPaths { + fn of(data: &CatalogImport) -> Self { + let mut seen = HashSet::new(); + let paths = data + .photos + .iter() + .filter(|p| number(&p.image, "masterImage") == 0) + .map(|p| key(&p.path)) + .filter(|path| !seen.insert(path.clone())) + .collect(); + SharedPaths { paths, staged: HashMap::new() } + } + + /// What an earlier master at its path staged for record `id`. + fn staged(&self, id: PhotoId) -> Option<&Photo> { + self.staged.get(&id).map(|(p, _)| p) + } + + /// Keeps `p` as staged by a `master` at `path` (the `AddPhoto` at `added_at` in the batch, when + /// the batch adds it), if that path is shared. + fn stage(&mut self, master: i64, path: &str, p: &Photo, added_at: Option) { + if master == 0 && self.paths.contains(&key(path)) { + self.staged.insert(p.id, (p.clone(), added_at)); + } + } + + /// Adds `p`, a record a `master` at `path` lands on that isn't in the library, to the batch + /// `ops`, and says whether it is new: when an earlier master at its path added it, `p` + /// replaces that `AddPhoto` instead. + fn add(&mut self, master: i64, path: &str, p: Photo, ops: &mut Vec) -> bool { + if let Some((staged, Some(at))) = self.staged.get_mut(&p.id) { + *staged = p.clone(); + if let Some(op) = ops.get_mut(*at) { + *op = Op::AddPhoto { photo: Box::new(p) }; + } + return false; + } + self.stage(master, path, &p, Some(ops.len())); + ops.push(Op::AddPhoto { photo: Box::new(p) }); + true + } +} + /// The file import's XMP sidecar warnings, by path ([`key`]). fn warnings_by_path(warnings: Vec) -> HashMap> { let mut out: HashMap> = HashMap::new(); diff --git a/crates/engine/src/lightroom_job.rs b/crates/engine/src/lightroom_job.rs index 074933b67a4..88f91f05a8b 100644 --- a/crates/engine/src/lightroom_job.rs +++ b/crates/engine/src/lightroom_job.rs @@ -836,11 +836,12 @@ mod tests { } } - /// Two catalog photos at the same path whose file is a content duplicate: the second lands on - /// no library record (the first one's is still being made), so the job makes another one from - /// the file and its sidecar. That record is the job's own too: the catalog's settings apply and + /// Two catalog photos at the same path whose file is a content duplicate: the file import adds + /// no record for it, the first catalog photo's record is made from the file and its sidecar, + /// and the second lands on that record (the job's own): the catalog's settings apply and /// nothing counts as preserved. (Before, finding the path among the records being made read as - /// "there before", and the sidecar's develop settings were kept as an existing edit.) + /// "there before", and the sidecar's develop settings were kept as an existing edit; and the + /// second photo made a record of its own.) #[test] fn a_second_catalog_photo_at_a_path_the_job_is_adding_takes_the_catalog_develop() { let (dir, path, mut session) = file_with_develop_sidecar("lr-job-origin-same-path", "same-path-bytes"); @@ -853,6 +854,7 @@ mod tests { prepared.data.photos.push(second); prepared.data.images = 2; let report = run_job(&mut session, prepared, vec![path.clone()], false); + assert_eq!(report["mapping"]["1"], report["mapping"]["2"], "one record: {report}"); for source in ["1", "2"] { let id = lightcraft_catalog::PhotoId(report["mapping"][source].as_u64().unwrap()); let photo = session.catalog.photo(id).unwrap(); @@ -907,6 +909,51 @@ mod tests { } } + /// Two catalog masters at one path, the first with develop text and the second with none: the + /// record keeps the first one's settings. The second goes on from what the first gave the + /// record; before, it started from the record as the file import made it, and that record's + /// develop settings (its XMP sidecar's) replaced the catalog's in the same batch. + #[test] + fn a_later_master_at_a_path_keeps_what_an_earlier_one_gave_the_record() { + let (dir, path, mut session) = file_with_develop_sidecar("lr-job-shared-path-develop", "shared-path-bytes"); + let mut prepared = with_second_photo(prepared_for(&session, &path, 3), &path); + let mut job = LightroomJob::new(&mut session, PathBuf::from("fixture.lrcat"), false).unwrap(); + prepared.normal = job.import.prepare_files(vec![path.clone()], &AtomicBool::new(false)); + prepared.missing_sources.clear(); + prepared.data.photos[0].settings = "s = { Exposure2012 = -1.0 }".into(); + let report = commit_prepared(&mut session, prepared).unwrap().report; + assert_eq!(session.catalog.len(), 1, "{report}"); + assert_eq!(report["mapping"]["1"], report["mapping"]["2"], "{report}"); + let photo = session.catalog.photo(lightcraft_catalog::PhotoId(report["mapping"]["2"].as_u64().unwrap())).unwrap(); + assert_eq!(photo.develop.light.exposure, -1.0, "the first master's settings, not the sidecar's +2: {report}"); + assert_eq!(photo.develop.effects.clarity, 0.0, "not the sidecar's +30: {report}"); + assert_eq!((report["added"].as_u64(), report["alreadyInLibrary"].as_u64()), (Some(1), Some(1)), "{report}"); + std::fs::remove_dir_all(dir).unwrap(); + } + + /// Two catalog masters at one offline path land on one record, as two at a path the file + /// import read do: the second finds the record the first is adding. Before, that record wasn't + /// in the library yet, so the second made another one and both counted as added. + #[test] + fn two_offline_masters_at_one_path_share_a_record() { + let path = "/missing/lr-job-offline-twice.jpg"; + let mut session = crate::Session::new(); + let mut prepared = with_second_photo(prepared_for(&session, path, 3), path); + prepared.data.photos[0].settings = "s = { Exposure2012 = -1.0 }".into(); + prepared.data.photos[1].image.insert("rating".into(), serde_json::json!(5)); + let report = commit_prepared(&mut session, prepared).unwrap().report; + assert_eq!(session.catalog.len(), 1, "{report}"); + assert_eq!(report["mapping"]["1"], report["mapping"]["2"], "{report}"); + assert_eq!( + (report["added"].as_u64(), report["alreadyInLibrary"].as_u64(), report["imported"].as_u64()), + (Some(1), Some(1), Some(1)), + "{report}" + ); + let photo = session.catalog.photo(lightcraft_catalog::PhotoId(report["mapping"]["1"].as_u64().unwrap())).unwrap(); + assert_eq!(photo.develop.light.exposure, -1.0, "the first master's settings: {report}"); + assert_eq!(photo.rating, 5, "the second master's rating, the last one written: {report}"); + } + /// A catalog photo whose original is offline never reaches the job's file import, so the /// catalog step records the origin of the library record it finds there: a photo browsed in /// Local (Promoted) joins the library and is added, a library record (Existing) is already diff --git a/docs/lightroom-catalog-import.md b/docs/lightroom-catalog-import.md index e27babbecd3..85068066774 100644 --- a/docs/lightroom-catalog-import.md +++ b/docs/lightroom-catalog-import.md @@ -69,7 +69,9 @@ Photographs counts them), and these add up to it: | `pathRefused` | have an original the import doesn't look at (below), with their virtual copies; no record is made | | `incomplete` | have incomplete catalog records (`skipped`) | -Should the counts not add up, a warning says by how much. `imported` (records added, as before) stays in the report +Catalog photos at one path (a catalog can list a file twice) share one record: the first is counted for it and the +others as `alreadyInLibrary`, and each goes on from what the earlier ones gave the record, so one without develop +settings doesn't undo another's. Should the counts not add up, a warning says by how much. `imported` (records added, as before) stays in the report and normally equals `added`. The toast says, for example, "45091 photos in the catalog: 16521 added, 812 already in the library" (only the outcomes some photo had); then, apart, how many originals couldn't be read, since each of those is also one of the outcomes (a new one is added as a placeholder). The result window has one line per outcome. From aa3c77e04d9688af4fdc57aa4213b707f0f26ab0 Mon Sep 17 00:00:00 2001 From: THEtheChad <880190+THEtheChad@users.noreply.github.com> Date: Fri, 6 Nov 2026 17:39:39 -0600 Subject: [PATCH 22/22] Issue #3736: unit tests for a record's origin and the first origin recorded Origin::of gives Created for an untouched Local photo, Promoted once it is changed, Existing for a library record; was_there is false only for Created; Origins::record keeps the first origin recorded for a record and returns it on every later call. --- crates/engine/src/import/types.rs | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/crates/engine/src/import/types.rs b/crates/engine/src/import/types.rs index 112049db5c2..11f623364d9 100644 --- a/crates/engine/src/import/types.rs +++ b/crates/engine/src/import/types.rs @@ -335,3 +335,44 @@ pub struct Kept { pub path: String, pub reason: String, } + +#[cfg(test)] +mod tests { + use super::{Origin, Origins, Photo, PhotoId}; + + fn photo(local: bool) -> Photo { + let source = lightcraft_catalog::Source::File { path: "/photos/a.jpg".into() }; + let mut p = Photo::new(PhotoId(1), source, "a.jpg", "JPEG", 20, 10, "before"); + p.local = local; + p.set_local_baseline(); + p + } + + /// A photo browsed in Local and untouched since holds only what browsing read from its file, + /// so the job counts it as one it made (#3434); any change since browsing, a rating too, makes + /// it Promoted; a library record is Existing. Only a record the job made wasn't there before. + #[test] + fn a_record_s_origin_follows_from_what_it_was_when_the_job_found_it() { + let mut browsed = photo(true); + assert!(browsed.untouched_local()); + assert_eq!(Origin::of(&browsed), Origin::Created); + browsed.rating = 3; + assert_eq!(Origin::of(&browsed), Origin::Promoted); + assert_eq!(Origin::of(&photo(false)), Origin::Existing); + let there: Vec = [Origin::Created, Origin::Promoted, Origin::Existing].map(Origin::was_there).into(); + assert_eq!(there, [false, true, true]); + } + + /// The first origin recorded for a record stands for the whole job: a record the job made stays + /// Created when a later step finds it in the library, and every later `record` returns it. + #[test] + fn the_first_origin_recorded_for_a_record_stands() { + let mut origins = Origins::default(); + assert_eq!(origins.record(PhotoId(1), Origin::Created), Origin::Created); + assert_eq!(origins.record(PhotoId(1), Origin::Existing), Origin::Created); + assert_eq!(origins.record(PhotoId(1), Origin::Promoted), Origin::Created); + assert_eq!(origins.record(PhotoId(2), Origin::Promoted), Origin::Promoted); + assert_eq!(origins.record(PhotoId(2), Origin::Created), Origin::Promoted); + assert_eq!(origins.record(PhotoId(3), Origin::Existing), Origin::Existing); + } +}