From f512d201a61a47f7c0df2b6c975e059b85db6708 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:03:48 +1100 Subject: [PATCH 01/15] SYNC-IMMICH: Replica::rekey moves a photo's record and memberships to its SHA-1 key Co-Authored-By: Claude Opus 5.5 --- crates/sync/src/replica.rs | 70 ++++++++++++++++++++++++++++++++ crates/sync/src/replica/tests.rs | 47 +++++++++++++++++++++ 2 files changed, 117 insertions(+) diff --git a/crates/sync/src/replica.rs b/crates/sync/src/replica.rs index d29df50161..1c86518ea7 100644 --- a/crates/sync/src/replica.rs +++ b/crates/sync/src/replica.rs @@ -671,6 +671,76 @@ impl Replica { } } + /// Photo `old` is known as `new` from now on (its original's SHA-1 became known, so its key + /// moved from the content hash to `sha1:`; `docs/sync.md` ▸ Photo identity). Its record + /// and its places in collections move with it; when `new` is already known (another device + /// told of it under the new key first) the two merge field by field, each keeping its later + /// write. Both keys' items go out again under the new key. Says whether anything moved. + pub fn rekey(&mut self, old: &str, new: &str) -> bool { + if old == new || !ok_id(new) { + return false; + } + let mut moved = false; + if let Some(o) = self.photos.remove(old) { + moved = true; + self.by_seq.remove(&o.seq); + match self.photos.get_mut(new) { + None => { + self.photos.insert(new.to_string(), PhotoEntry { seq: 0, via: None, ..o }); + } + Some(n) => { + n.have = n.have.max(o.have); + for (name, f) in &o.fields { + if n.fields.get(name).is_some_and(|m| f.s <= m.s) { + continue; + } + n.fields.insert(name.clone(), *f); + match (&o.ghost, &mut n.ghost) { + (Some(og), Some(ng)) => { + if let Some(v) = og.values.get(name) { + ng.values.insert(name.clone(), v.clone()); + } + } + // the catalogue holds the later value: the told one mustn't overwrite it + (None, Some(ng)) => { + ng.values.remove(name); + } + _ => {} + } + } + if let (Some(og), Some(ng)) = (&o.ghost, &mut n.ghost) + && ng.info.is_null() + { + ng.info = og.info.clone(); + } + } + } + self.touch_photo(new, None); + } + let colls: Vec = self.members.iter().filter(|(_, m)| m.contains_key(old)).map(|(c, _)| c.clone()).collect(); + for coll in colls { + let Some(m) = self.members.get_mut(&coll) else { continue }; + let Some(o) = m.remove(old) else { continue }; + moved = true; + self.by_seq.remove(&o.seq); + let e = m.entry(new.to_string()).or_insert_with(|| MemberEntry { on: o.on.clone(), seq: 0, via: None }); + e.on.merge(&o.on); + self.touch_member(&coll, new, None); + } + for c in self.cursors.values_mut() { + let stale: Vec = + c.resend.iter().filter(|r| matches!(r, Ref::Photo(k) | Ref::Member(_, k) if k == old)).cloned().collect(); + for r in stale { + c.resend.remove(&r); + c.resend.insert(match r { + Ref::Member(coll, _) => Ref::Member(coll, new.to_string()), + _ => Ref::Photo(new.to_string()), + }); + } + } + moved + } + /// The photos told of that the catalogue doesn't hold. pub fn ghosts(&self) -> impl Iterator { self.photos.iter().filter(|(_, e)| e.ghost.is_some()).map(|(k, _)| k) diff --git a/crates/sync/src/replica/tests.rs b/crates/sync/src/replica/tests.rs index f63210b7f9..1b8d8b0d63 100644 --- a/crates/sync/src/replica/tests.rs +++ b/crates/sync/src/replica/tests.rs @@ -300,3 +300,50 @@ fn a_second_group_is_refused_and_names_are_unique() { assert!(!a.r.in_group_with("b"), "the others learn that a device left"); assert!(a.r.outgoing("b", 10).refs.iter().all(|r| *r == Ref::Group), "a device that left is told no more than that"); } + +#[test] +fn a_photo_rekeyed_to_its_sha1_keeps_its_record_and_collections() { + let (mut a, mut b) = (Dev::new("a"), Dev::new("b")); + group(Mode::Catalogue, Grant::Sync, &mut a, &mut [&mut b]); + let now = b.tick(); + b.r.set_take("c", Take::FullSync, now).unwrap(); + both(&mut a, &mut b); + both(&mut b, &mut a); + a.edit("p", "rating", json!(3)); + both(&mut a, &mut b); + // A learns the original's SHA-1 first: its key moves; B still uses the old one + let row = a.cat.remove("p").unwrap(); + a.cat.insert("sha1:x".into(), row); + assert!(a.r.rekey("p", "sha1:x")); + assert!(!a.r.photos.contains_key("p") && a.r.members_of("c").any(|k| k == "sha1:x")); + assert_eq!(a.r.collections_of("sha1:x").count(), 1); + // B edits under the old key meanwhile, and is told of the new key before it rekeys + b.edit("p", "develop", json!({"exposure": 1.0})); + send(&mut a, &mut b); + assert!(b.r.photos.get("sha1:x").is_some_and(|e| e.ghost.is_some())); + let row = b.cat.remove("p").unwrap(); + b.cat.insert("sha1:x".into(), row); + assert!(b.r.rekey("p", "sha1:x")); + // B's own later edit isn't overwritten by what it was told + let g = b.r.photos["sha1:x"].ghost.clone().unwrap(); + assert!(!g.values.contains_key("develop")); + // the catalogue takes what it was told that is later (as the engine's adopt does) + for (f, v) in &g.values { + b.cat.get_mut("sha1:x").unwrap().insert(f.clone(), v.clone()); + } + let digests: Vec<(String, u64)> = b.cat["sha1:x"].iter().map(|(n, v)| (n.clone(), crate::digest(v))).collect(); + let refs: Vec<(&str, u64)> = digests.iter().map(|(n, d)| (n.as_str(), *d)).collect(); + b.r.adopt("sha1:x", &refs, Depth::Full); + for _ in 0..3 { + both(&mut a, &mut b); + } + for d in [&a, &b] { + assert_eq!((d.value("sha1:x", "rating"), d.value("sha1:x", "develop")), (json!(3), json!({"exposure": 1.0})), "{}", d.r.device); + } + assert!(!a.r.has_outgoing("b") && !b.r.has_outgoing("a"), "settled"); + assert!(!a.r.photos.contains_key("p") && !b.r.photos.contains_key("p")); + assert!(b.r.members_of("c").any(|k| k == "sha1:x") && !b.r.members_of("c").any(|k| k == "p")); + // a rekey to nothing, to itself or of an unknown key changes nothing + assert!(!a.r.rekey("sha1:x", "sha1:x") && !a.r.rekey("nope", "sha1:y") && !a.r.rekey("sha1:x", "")); + assert!(!a.r.rekey("sha1:x", &"k".repeat(500))); +} From 4fbbd4e6f02f44f029e9c5fa385a88aee6d60a09 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:13:20 +1100 Subject: [PATCH 02/15] SYNC-IMMICH: one key rule for photos (sha1:), content-hash aliases and migration Device sync names a photo by the SHA-1 of its original (Immich's checksum for a link-only photo), falling back to the content hash until it is known. Keys move with Replica::rekey; peers still on content-hash keys are understood through an alias table, and a photo sent under its SHA-1 key gives an unhashed copy its SHA-1. Photos arriving from a peer are queued for the Immich checksum lookup. Manual: none, no user-visible change (identity only) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/device_sync/catalog.rs | 89 +++++++++++--- crates/engine/src/device_sync/mod.rs | 3 + crates/engine/src/device_sync/record.rs | 73 ++++++++++- crates/engine/src/device_sync/tests.rs | 114 ++++++++++++++++++ .../2026-11-15-immich-collections.md | 3 + docs/sync.md | 28 ++++- .../2026-11-15-immich-collections.md | 8 ++ 7 files changed, 297 insertions(+), 21 deletions(-) create mode 100644 docs/changelog/unreleased/2026-11-15-immich-collections.md create mode 100644 docs/whats-new/2026-11-15-immich-collections.md diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index e639cb9972..c05daa29e8 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -33,44 +33,97 @@ fn plain(a: &Album) -> bool { a.smart.is_none() && !a.quick } -/// The catalogue's photos by key (and back). +/// The catalogue's photos by key (and back), and the content-hash keys other devices may still +/// use for photos known here by SHA-1. A photo the replica still knows by its content hash moves +/// to its SHA-1 key (catalogues synced before photos were keyed by SHA-1, and photos hashed while +/// the catalogue was closed). pub(super) fn index(s: &Session, lib: &mut Lib) { lib.album_sig.clear(); lib.keys.clear(); lib.ids.clear(); + lib.alias.clear(); for p in s.catalog.photos() { - if let Some(k) = record::key_of(p) - && !lib.keys.contains_key(k) + if let Some(k) = record::key_of(p, &s.catalog) + && !lib.keys.contains_key(&k) { - lib.keys.insert(k.to_string(), p.id); - lib.ids.insert(p.id, k.to_string()); + if let Some(old) = record::content_key(p).filter(|c| *c != k) { + lib.alias.insert(old.to_string(), k.clone()); + lib.replica.rekey(old, &k); + } + lib.keys.insert(k.clone(), p.id); + lib.ids.insert(p.id, k); } } wanting(lib); } fn reindex(s: &Session, lib: &mut Lib, id: PhotoId) { - let key = s.catalog.photo(id).and_then(|p| record::key_of(p)).map(str::to_string); + let p = s.catalog.photo(id); + let key = p.and_then(|p| record::key_of(p, &s.catalog)); let old = lib.ids.get(&id).cloned(); if old == key { return; } // a photo got (or lost) its key: every collection's photos are looked at afresh lib.album_sig.clear(); - if let Some(o) = old { + if let Some(o) = &old { lib.ids.remove(&id); - if lib.keys.get(&o) == Some(&id) { - lib.keys.remove(&o); + if lib.keys.get(o) == Some(&id) { + lib.keys.remove(o); } } if let Some(k) = key && !lib.keys.contains_key(&k) { + // its original's SHA-1 became known: what the replica holds under the old key moves + if let Some(o) = old.as_deref().filter(|o| !o.starts_with(record::SHA1_KEY)) { + lib.replica.rekey(o, &k); + lib.alias.insert(o.to_string(), k.clone()); + } + if let Some(c) = p.and_then(|p| record::content_key(p)).filter(|c| *c != k) { + lib.alias.insert(c.to_string(), k.clone()); + } lib.keys.insert(k.clone(), id); lib.ids.insert(id, k); } } +/// The key this catalogue uses for a key another device sent (it may still name the photo by +/// its content hash, which is known here by SHA-1). +pub(super) fn local_key<'a>(lib: &'a Lib, key: &'a str) -> &'a str { + if lib.keys.contains_key(key) { + return key; + } + lib.alias.get(key).map_or(key, String::as_str) +} + +/// The key to merge an item another device sent under. Beyond [`local_key`]: a photo sent +/// under its SHA-1 key whose content hash names a photo here not hashed yet is that photo (the +/// same bytes), which takes the SHA-1 and moves to the new key; one only told of moves too. +fn incoming_key(s: &mut Session, lib: &mut Lib, key: &str, info: &Value) -> String { + let k = local_key(lib, key).to_string(); + if k != key || lib.keys.contains_key(&k) || lib.replica.photos.contains_key(&k) { + return k; + } + let (Some(sha1), Some(h)) = (record::sha1_of_key(key), info.get("content_hash").and_then(Value::as_str)) else { return k }; + if h == key || h.len() > 128 { + return k; + } + if let Some(id) = lib.keys.get(h).copied() { + let unhashed = s.catalog.photo(id).is_some_and(|p| p.sha1.is_none() && record::content_key(p) == Some(h)); + if unhashed { + match s.apply_system(Op::SetSha1 { id, sha1: Some(sha1) }) { + Ok(()) => reindex(s, lib, id), + Err(e) => log::warn!("sync: {e}"), + } + } + } else if lib.replica.photos.contains_key(h) { + lib.replica.rekey(h, key); + lib.alias.insert(h.to_string(), key.to_string()); + } + key.to_string() +} + /// The photos this device should hold more of than it does. fn wanting(lib: &mut Lib) { let r = &lib.replica; @@ -89,7 +142,7 @@ fn in_group(lib: &Lib) -> Option { /// Photos of the catalogue that can't sync yet: not hashed, or a second import of the same bytes. pub(super) fn unkeyed(s: &Session) -> usize { - s.catalog.photos().filter(|p| !p.deleted && p.copy_of.is_none() && record::key_of(p).is_none()).count() + s.catalog.photos().filter(|p| !p.deleted && p.copy_of.is_none() && record::key_of(p, &s.catalog).is_none()).count() } /// New collections of the catalogue the person hasn't said how to share. @@ -344,9 +397,12 @@ pub(super) fn apply(s: &mut Session, lib: &mut Lib, peer: &lcc_peer::Peer, batch lib.replica.merge_collection(c, from); } Item::Member { coll, key, on } => { - lib.replica.merge_member(coll, key, on, from); + let key = local_key(lib, key).to_string(); + lib.replica.merge_member(coll, &key, on, from); } - Item::Photo { key, info, fields, .. } => match lib.keys.get(key).copied() { + Item::Photo { key, info, fields, .. } => { + let key = &incoming_key(s, lib, key, info); + match lib.keys.get(key).copied() { Some(id) if lib.replica.photos.get(key).is_none_or(|e| e.ghost.is_none()) => { for (name, lww) in fields.iter().take(32) { if !record::FIELDS.contains(&name.as_str()) || !lib.replica.incoming_wins(key, name, lww) { @@ -367,7 +423,8 @@ pub(super) fn apply(s: &mut Session, lib: &mut Lib, peer: &lcc_peer::Peer, batch _ => { lib.replica.merge_ghost(key, info, fields, from); } - }, + } + } } } reconcile(s, lib); @@ -431,6 +488,8 @@ fn adopt(s: &mut Session, lib: &mut Lib, key: &str) { } lib.keys.insert(key.to_string(), id); lib.ids.insert(id, key.to_string()); + // a connected Immich server that has the same original links it (no upload, no second asset) + s.remote.link_queue.push(id); (id, Depth::None) } }; @@ -559,7 +618,8 @@ pub(super) fn wants(s: &Session, lib: &mut Lib, peer: &str) -> Vec { let Some(p) = lib.keys.get(key).and_then(|id| s.catalog.photo(*id)) else { continue }; let Source::File { path } = &p.source else { continue }; match lib.replica.depth_wanted(key) { - Depth::Full if !path.is_empty() => out.push(Want { key: key.clone(), depth: Depth::Full, dest: PathBuf::from(path) }), + // (a link-only photo's original comes from Immich, and its file here is the preview) + Depth::Full if !path.is_empty() && p.preview_only.as_deref() != Some(crate::remote::LINK_ONLY) => out.push(Want { key: key.clone(), depth: Depth::Full, dest: PathBuf::from(path) }), Depth::Preview => { if let Some(dir) = &smart_dir { out.push(Want { key: key.clone(), depth: Depth::Preview, dest: crate::smart::sharded_file_path(dir, p) }); @@ -579,6 +639,7 @@ pub(super) fn locate(s: &mut Session, lib: &mut Lib, peer: &str, wants: &[(Strin let found: Vec> = wants .iter() .map(|(key, depth)| { + let key = local_key(lib, key); if !lib.replica.may_fetch(peer, key, *depth) { return Err(false); } diff --git a/crates/engine/src/device_sync/mod.rs b/crates/engine/src/device_sync/mod.rs index 5655bae317..9d9594dc00 100644 --- a/crates/engine/src/device_sync/mod.rs +++ b/crates/engine/src/device_sync/mod.rs @@ -145,6 +145,8 @@ pub(crate) struct Lib { pub revision: Option, pub keys: HashMap, pub ids: HashMap, + /// Content-hash keys of photos known here by SHA-1 (another device may not have hashed them yet). + pub alias: HashMap, /// Each shared collection's photos as the catalogue had them when last looked at. pub base: HashMap>, /// The photos this device should hold more of than it does. @@ -662,6 +664,7 @@ pub(crate) fn ensure_lib(s: &mut Session) { revision: None, keys: HashMap::new(), ids: HashMap::new(), + alias: HashMap::new(), base: HashMap::new(), wanting: BTreeSet::new(), missing: HashMap::new(), diff --git a/crates/engine/src/device_sync/record.rs b/crates/engine/src/device_sync/record.rs index 13c5f07951..fc633dd153 100644 --- a/crates/engine/src/device_sync/record.rs +++ b/crates/engine/src/device_sync/record.rs @@ -47,13 +47,58 @@ const META: [&str; 23] = [ "gps_removed", ]; -/// The key that names the same photo on every device: the hash of the original's bytes. Virtual -/// copies, a second import of the same bytes and photos not hashed yet have none. -pub(super) fn key_of(p: &Photo) -> Option<&str> { +/// What a photo's key starts with when it is named by its original's SHA-1. +pub(crate) const SHA1_KEY: &str = "sha1:"; + +/// The key that names the same photo on every device (`docs/sync.md` ▸ Photo identity): +/// +/// - `sha1:`, the SHA-1 of the original's bytes, once it is known: hashed here (every +/// catalogue hashes its originals in the background), or, for an Immich link-only photo whose +/// original isn't here, the checksum Immich reported for it. A device holding the file and a +/// device holding only the Immich link so give the same photo the same key. +/// - otherwise the catalogue's content hash of the original (a photo not hashed yet); it moves to +/// the SHA-1 key once that is known ([`lcc_sync::Replica::rekey`]). +/// +/// Virtual copies, a second import of the same bytes and link-only photos without a checksum +/// have none. +pub(crate) fn key_of(p: &Photo, cat: &Catalog) -> Option { if p.copy_of.is_some() { return None; } - p.content_hash.as_deref().filter(|h| !h.is_empty() && h.len() <= 128 && !h.contains(":dup")) + if p.preview_only.as_deref() == Some(crate::remote::LINK_ONLY) { + // the file here is Immich's preview: only the checksum of the original names it + return cat + .remote_of(p.id) + .filter(|r| r.service == lcc_immich::link::SERVICE) + .find_map(|r| r.remote_checksum.as_deref().and_then(sha1_key)); + } + if let Some(k) = p.sha1.as_deref().and_then(sha1_key) { + return Some(k); + } + content_key(p).map(str::to_string) +} + +/// The photo's content-hash key, which another device may still use for it (`None` for a +/// link-only photo: its content hash is the preview's). +pub(crate) fn content_key(p: &Photo) -> Option<&str> { + if p.copy_of.is_some() || p.preview_only.as_deref() == Some(crate::remote::LINK_ONLY) { + return None; + } + p.content_hash.as_deref().filter(|h| ok_content_key(h)) +} + +fn ok_content_key(h: &str) -> bool { + !h.is_empty() && h.len() <= 128 && !h.contains(":dup") && !h.starts_with(SHA1_KEY) && !h.chars().any(char::is_control) +} + +/// `sha1:` of a SHA-1 given as hex or base64 (`None` if it isn't one). +pub(crate) fn sha1_key(checksum: &str) -> Option { + lcc_hash::Sha1Digest::parse(checksum).map(|d| format!("{SHA1_KEY}{}", d.to_hex())) +} + +/// The SHA-1 (hex) a key names, if it is a SHA-1 key. +pub(crate) fn sha1_of_key(key: &str) -> Option { + key.strip_prefix(SHA1_KEY).and_then(lcc_hash::Sha1Digest::parse).map(|d| d.to_hex()) } fn develop_is_default(d: &DevelopSettings) -> bool { @@ -142,6 +187,12 @@ pub(super) fn info(p: &Photo) -> Value { q.rating = 0; q.flag = lcc_catalog::Flag::None; q.label = None; + if q.preview_only.as_deref() == Some(crate::remote::LINK_ONLY) { + // what is here is Immich's preview: its hash, size and SHA-1 aren't the original's + q.content_hash = None; + q.sha1 = None; + q.preview_only = None; + } serde_json::to_value(&q).unwrap_or(Value::Null) } @@ -162,7 +213,19 @@ pub(super) fn photo_from(info: &Value, key: &str, id: PhotoId, path: &str, impor p.id = id; p.source = lcc_catalog::Source::File { path: path.to_string() }; p.imported = imported.to_string(); - p.content_hash = Some(key.to_string()); + match sha1_of_key(key) { + // named by its SHA-1: the original's content hash comes with it when the sender knows it + Some(sha1) => { + p.sha1 = Some(sha1); + p.content_hash = p.content_hash.take().filter(|h| ok_content_key(h)); + } + None => { + p.content_hash = Some(key.to_string()); + p.sha1 = p.sha1.take().and_then(|h| lcc_hash::Sha1Digest::parse(&h)).map(|d| d.to_hex()); + } + } + // (what the other device shows of it is no business of this one) + p.preview_only = None; p.copy_of = None; p.copy_name = None; p.local = false; diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 0317698134..e4ca31f48f 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -198,3 +198,117 @@ fn cancel_pairing_without_a_pairing_is_harmless() { let v = a.execute("sync.cancelPairing", &json!({})).unwrap(); assert!(v["pairing"].is_null()); } + +// ── in-process exchanges (no network): the catalogue side of sync ───────────────────────────── + +/// A session with a sync identity and its catalogue's replica loaded, without starting the service. +fn offline(dir: &std::path::Path, name: &str) -> (Session, lcc_peer::Peer) { + let mut s = Session::new().with_fs(); + let store = dir.join(format!("{name}.json")); + let st = lcc_peer::Store::load_or_create(&store, name).unwrap(); + st.save(&store).unwrap(); + s.device_sync.store_path = Some(store); + s.open_library(dir.join(format!("{name}-lib")), false).unwrap(); + super::ensure_lib(&mut s); + let peer = lcc_peer::Peer { device_id: st.identity.device_id, name: name.into(), public_key: String::new(), paired_at: 0 }; + (s, peer) +} + +/// Everything `from` has for `to`, through JSON as on the wire. +fn hand_over(from: &mut Session, fp: &lcc_peer::Peer, to: &mut Session, tp: &lcc_peer::Peer) { + for _ in 0..50 { + let mut lf = from.device_sync.lib.take().unwrap(); + super::catalog::scan(from, &mut lf); + let (batch, out) = super::catalog::prepare(from, &lf, &tp.device_id); + from.device_sync.lib = Some(lf); + let batch: lcc_sync::proto::Batch = serde_json::from_slice(&serde_json::to_vec(&batch).unwrap()).unwrap(); + let mut lt = to.device_sync.lib.take().unwrap(); + super::catalog::scan(to, &mut lt); + super::catalog::apply(to, &mut lt, fp, &batch).unwrap(); + to.device_sync.lib = Some(lt); + from.device_sync.lib.as_mut().unwrap().replica.confirmed(&tp.device_id, &out); + if !out.more { + return; + } + } +} + +fn swap(a: &mut Session, ap: &lcc_peer::Peer, b: &mut Session, bp: &lcc_peer::Peer) { + for _ in 0..3 { + hand_over(a, ap, b, bp); + hand_over(b, bp, a, ap); + } +} + +/// `a` starts a whole-catalogue group that `b` joins. +fn offline_group(a: &mut Session, ap: &lcc_peer::Peer, b: &mut Session, bp: &lcc_peer::Peer) { + let la = a.device_sync.lib.as_mut().unwrap(); + la.replica.start_group("g", lcc_sync::Mode::Catalogue, Some(ap.device_id.clone()), &ap.name, super::now_ms()).unwrap(); + la.replica.invited.insert(bp.device_id.clone()); + let g = la.replica.group.clone().unwrap(); + let lb = b.device_sync.lib.as_mut().unwrap(); + lb.replica.join_group(&g, &bp.name, super::now_ms()).unwrap(); + for s in [&mut *a, &mut *b] { + let mut l = s.device_sync.lib.take().unwrap(); + super::catalog::register_all(s, &mut l); + s.device_sync.lib = Some(l); + } + swap(a, ap, b, bp); +} + +fn key_of(s: &Session, id: u64) -> Option { + s.device_sync.lib.as_ref().unwrap().ids.get(&lcc_catalog::PhotoId(id)).cloned() +} + +/// The same original on two devices, one of which hasn't hashed it (or synced before photos were +/// keyed by SHA-1): it ends as one photo with one key on both, the edits of both kept, and a +/// replica that still knew it by its content hash moves to the new key. +#[test] +fn one_original_has_one_key_whichever_device_hashed_it() { + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-identity"); + let src = dir.join("one.png"); + write_png(&src, 5); + let (mut a, ap) = offline(&dir, "a"); + let (mut b, bp) = offline(&dir, "b"); + let ia = a.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap(); + let ib = b.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap(); + let sha1 = a.catalog.photo(lcc_catalog::PhotoId(ia)).unwrap().sha1.clone().expect("import hashes the original"); + // B hasn't hashed its copy + b.apply_system(lcc_catalog::Op::SetSha1 { id: lcc_catalog::PhotoId(ib), sha1: None }).unwrap(); + let trip = a.execute("album.create", &json!({"name": "Trip"})).unwrap()["id"].as_u64().unwrap(); + a.selection = crate::Selection::single(lcc_catalog::PhotoId(ia)); + a.execute("album.addPhotos", &json!({"id": trip, "ids": [ia]})).unwrap(); + for s in [&mut a, &mut b] { + let mut l = s.device_sync.lib.take().unwrap(); + super::catalog::index(s, &mut l); + s.device_sync.lib = Some(l); + } + assert_eq!(key_of(&a, ia), Some(format!("sha1:{sha1}"))); + let old_key = key_of(&b, ib).unwrap(); + assert!(!old_key.starts_with("sha1:"), "an unhashed photo is known by its content hash"); + offline_group(&mut a, &ap, &mut b, &bp); + a.execute("sync.allow", &json!({"album": trip, "allow": "sync"})).unwrap(); + let cid = a.device_sync.lib.as_ref().unwrap().replica.collection_of_album(trip).unwrap().to_string(); + swap(&mut a, &ap, &mut b, &bp); + b.execute("sync.take", &json!({"collection": cid, "take": "fullSync"})).unwrap(); + // B edits under the old key before it learns the SHA-1 + b.execute("photo.rate", &json!({"ids": [ib], "rating": 3})).unwrap(); + a.execute("photo.rate", &json!({"ids": [ia], "rating": 1})).unwrap(); + let mut d = (*a.catalog.photo(lcc_catalog::PhotoId(ia)).unwrap().develop).clone(); + d.light.exposure = 0.7; + a.set_develop(lcc_catalog::PhotoId(ia), d, "test").unwrap(); + swap(&mut a, &ap, &mut b, &bp); + for s in [&a, &b] { + assert_eq!(s.catalog.photos().count(), 1, "one photo, not a second one for the other key"); + } + let pb = b.catalog.photo(lcc_catalog::PhotoId(ib)).unwrap(); + assert_eq!(pb.sha1.as_deref(), Some(sha1.as_str()), "B takes the SHA-1 of the same bytes"); + assert_eq!(key_of(&b, ib), key_of(&a, ia)); + assert_eq!(pb.develop.light.exposure, 0.7); + let (ra, rb) = (a.catalog.photo(lcc_catalog::PhotoId(ia)).unwrap().rating, pb.rating); + assert_eq!(ra, rb, "both end with the later rating"); + assert!(b.catalog.albums().any(|al| al.name == "Trip" && al.photos == vec![lcc_catalog::PhotoId(ib)])); + let rb = &b.device_sync.lib.as_ref().unwrap().replica; + assert!(!rb.photos.contains_key(&old_key), "nothing is left under the old key"); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/docs/changelog/unreleased/2026-11-15-immich-collections.md b/docs/changelog/unreleased/2026-11-15-immich-collections.md new file mode 100644 index 0000000000..fe39710fd5 --- /dev/null +++ b/docs/changelog/unreleased/2026-11-15-immich-collections.md @@ -0,0 +1,3 @@ +## Sync + +- **Device sync keys photos by the SHA-1 of the original:** the same checksum Immich reports, so a device with the file and a device with only an Immich link-only photo agree on the photo. Photos not hashed yet keep their content-hash key until the SHA-1 is known; their record and collection memberships then move to the new key (`Replica::rekey`), and replicas made before this change migrate when the catalog opens. A photo arriving from another device is looked up on connected Immich servers by checksum, so it is linked rather than uploaded twice. diff --git a/docs/sync.md b/docs/sync.md index 1eb6ec5eb1..9ada7201d7 100644 --- a/docs/sync.md +++ b/docs/sync.md @@ -29,8 +29,32 @@ between. This page describes what is built, how it works, and its known limits. `fullQuality` (originals; edits go back), `fullSync` (photos added there go to the others too). - A collection created while the whole catalog syncs is *undecided* until the person answers (`sync.allow` or `sync.skip`); the UI asks at once. -- Photos are keyed by the hash of the original's bytes. A photo's record (develop settings, rating, flag, label, - metadata) merges field by field, the later change winning by a hybrid logical clock. +- A photo's record (develop settings, rating, flag, label, metadata) merges field by field, the later change + winning by a hybrid logical clock. + +## Photo identity + +One rule names a photo on every device (`device_sync::record::key_of`): + +- `sha1:`, the SHA-1 of the original's bytes, as soon as it is known. Imports hash the original, and every + catalog back-fills the SHA-1 of older photos in the background. An Immich link-only photo, whose original isn't + on the device, uses the checksum Immich reports for the asset, which is the same SHA-1. So a device holding the + file and a device holding only the Immich link give the same photo the same key, and Immich and device sync + agree on what "the same photo" is. +- Until then, the catalog's content hash of the original (older replicas used only this). +- Virtual copies, a second import of the same bytes and link-only photos without a checksum have no key. + +When a photo's SHA-1 becomes known its key moves (`Replica::rekey`): its record, its places in collections and +what is queued for each device move to the new key, and if another device already told of the new key, the two +merge field by field. Opening a catalog whose replica still uses content-hash keys moves them the same way. +Each catalog keeps a table of content-hash keys of photos it knows by SHA-1, so a device that hasn't hashed a +photo yet is still understood. A photo sent under its SHA-1 key carries its content hash; a device that has +that content hash but no SHA-1 takes the SHA-1 (the same bytes) and moves to the new key, so the two never +become two photos. A link-only photo is sent without its content hash, SHA-1 or size, which are the preview's. + +A photo that arrives from another device and has a SHA-1 key is looked up on the connected Immich servers by +checksum straight away (the same lookup as for a new import), so an original Immich already has is linked, not +uploaded again. A link-only photo doesn't ask other devices for its original: it comes from Immich. ## Pills diff --git a/docs/whats-new/2026-11-15-immich-collections.md b/docs/whats-new/2026-11-15-immich-collections.md new file mode 100644 index 0000000000..9787904efd --- /dev/null +++ b/docs/whats-new/2026-11-15-immich-collections.md @@ -0,0 +1,8 @@ +### One photo, one identity across devices and Immich + +- Device sync now names a photo by the SHA-1 of its original, the same checksum Immich uses. A device that holds + the file and a device that holds only an Immich link see the same photo, never two. +- A device that hasn't hashed a photo yet still matches it with the other devices; synced catalogs move to the new + names on their own, keeping every edit. +- A photo that arrives from another device is looked up on your Immich server first, so an original Immich + already has is linked instead of uploaded again. From d29d5b9bbba938e7a7273ca29353543e4915cf2b Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:18:34 +1100 Subject: [PATCH 03/15] SYNC-IMMICH: link-only/file identity tests, SHA-1 check of synced originals, docs and notes An original fetched from another device under a sha1: key is checked by its SHA-1. Tests: a link-only Immich photo and the phone's file are one photo on both devices (no original asked of the phone), hostile keys change nothing. Manual: none, no user-visible change (identity only) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/device_sync/tests.rs | 126 ++++++++++++++++++++++++- crates/engine/src/device_sync/wire.rs | 12 ++- 2 files changed, 135 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index e4ca31f48f..3fdbac6601 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -257,7 +257,7 @@ fn offline_group(a: &mut Session, ap: &lcc_peer::Peer, b: &mut Session, bp: &lcc } fn key_of(s: &Session, id: u64) -> Option { - s.device_sync.lib.as_ref().unwrap().ids.get(&lcc_catalog::PhotoId(id)).cloned() + super::record::key_of(s.catalog.photo(lcc_catalog::PhotoId(id))?, &s.catalog) } /// The same original on two devices, one of which hasn't hashed it (or synced before photos were @@ -312,3 +312,127 @@ fn one_original_has_one_key_whichever_device_hashed_it() { assert!(!rb.photos.contains_key(&old_key), "nothing is left under the old key"); let _ = std::fs::remove_dir_all(&dir); } + +/// A link-only Immich photo (made here as `immich.import` with `mode: link` makes it) of `src`'s +/// bytes, on account `account`, the checksum given as Immich gives it (base64). +fn link_only(s: &mut Session, src: &std::path::Path, account: &str) -> lcc_catalog::PhotoId { + let preview = src.with_file_name(format!("preview-{}.png", s.catalog.photos().count())); + write_png(&preview, 99); + let id = s.execute("library.import", &json!({"paths": [preview.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap(); + let id = lcc_catalog::PhotoId(id); + let ph = s.catalog.photo(id).unwrap().clone(); + let sha1 = lcc_hash::sha1_file(src).unwrap(); + let ops = vec![ + lcc_catalog::Op::SetSha1 { id, sha1: None }, + lcc_catalog::Op::SetContent { + id, + width: ph.width, + height: ph.height, + file_size: ph.file_size, + content_hash: ph.content_hash.clone(), + preview_only: Some(crate::remote::LINK_ONLY.into()), + preview_checked: lcc_catalog::APP_VERSION.to_string(), + }, + lcc_catalog::Catalog::link_remote_op(lcc_catalog::RemoteIdentity { + photo_id: id, + service: "immich".into(), + account_id: account.into(), + remote_id: "asset-1".into(), + remote_checksum: Some(sha1.to_base64()), + remote_updated_at: None, + last_synced_at: None, + sync_state: lcc_catalog::SyncState::Synced, + }), + ]; + s.apply_system(lcc_catalog::Op::Batch { ops }).unwrap(); + let mut l = s.device_sync.lib.take().unwrap(); + super::catalog::index(s, &mut l); + s.device_sync.lib = Some(l); + id +} + +/// The phone's camera roll uploaded straight to Immich by the Immich app, a desktop that has only +/// Immich's link-only photo of it, and the phone itself with the file: device sync sees one +/// photo, keyed alike on both, and never asks the phone for an original Immich serves. +#[test] +fn a_link_only_immich_photo_and_the_file_are_one_photo() { + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-linkonly"); + let src = dir.join("roll.png"); + write_png(&src, 7); + let (mut phone, pp) = offline(&dir, "phone"); + let (mut desk, dp) = offline(&dir, "desk"); + let ip = lcc_catalog::PhotoId(phone.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap()); + let idk = link_only(&mut desk, &src, "http://immich#u1"); + assert_eq!(key_of(&phone, ip.0), key_of(&desk, idk.0), "the same key from the file and from Immich's checksum"); + assert!(key_of(&desk, idk.0).is_some_and(|k| k.starts_with("sha1:"))); + // the link-only photo's record carries none of the preview's identity + let info = super::record::info(desk.catalog.photo(idk).unwrap()); + assert!(info["content_hash"].is_null() && info["sha1"].is_null() && info["preview_only"].is_null()); + + let roll = phone.execute("album.create", &json!({"name": "Roll"})).unwrap()["id"].as_u64().unwrap(); + phone.selection = crate::Selection::single(ip); + phone.execute("album.addPhotos", &json!({"id": roll, "ids": [ip.0]})).unwrap(); + phone.execute("photo.rate", &json!({"ids": [ip.0], "rating": 5})).unwrap(); + offline_group(&mut phone, &pp, &mut desk, &dp); + phone.execute("sync.allow", &json!({"album": roll, "allow": "sync"})).unwrap(); + let cid = phone.device_sync.lib.as_ref().unwrap().replica.collection_of_album(roll).unwrap().to_string(); + swap(&mut phone, &pp, &mut desk, &dp); + desk.execute("sync.take", &json!({"collection": cid, "take": "fullQuality"})).unwrap(); + swap(&mut phone, &pp, &mut desk, &dp); + assert_eq!(desk.catalog.photos().count(), 1, "no second photo for the phone's copy"); + assert_eq!(desk.catalog.photo(idk).unwrap().rating, 5); + assert!(desk.catalog.albums().any(|a| a.name == "Roll" && a.photos == vec![idk])); + // the desktop's edit goes back to the phone's photo + desk.execute("photo.rate", &json!({"ids": [idk.0], "rating": 2})).unwrap(); + swap(&mut phone, &pp, &mut desk, &dp); + assert_eq!(phone.catalog.photo(ip).unwrap().rating, 2); + assert_eq!(phone.catalog.photos().count(), 1); + // its original comes from Immich, not from the phone + let mut l = desk.device_sync.lib.take().unwrap(); + let wants = super::catalog::wants(&desk, &mut l, &pp.device_id); + desk.device_sync.lib = Some(l); + assert!(wants.iter().all(|w| w.depth != lcc_sync::pill::Depth::Full), "{:?}", wants.iter().map(|w| &w.key).collect::>()); + let _ = std::fs::remove_dir_all(&dir); +} + +/// Keys from another device are hostile: a bad SHA-1 key, a content hash naming nothing, an +/// oversized or empty one change nothing here and never panic. +#[test] +fn hostile_photo_keys_change_nothing() { + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-hostile-keys"); + let src = dir.join("x.png"); + write_png(&src, 3); + let (mut a, ap) = offline(&dir, "a"); + let (mut b, bp) = offline(&dir, "b"); + b.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap(); + offline_group(&mut a, &ap, &mut b, &bp); + let long = "k".repeat(10_000); + for (key, info) in [ + ("sha1:zz", json!({"content_hash": "nothing"})), + ("sha1:", json!({})), + (long.as_str(), json!({"content_hash": long})), + ("", json!(null)), + ("sha1:a9993e364706816aba3e25717850c26c9cd0d89d", json!({"content_hash": "sha1:a9993e364706816aba3e25717850c26c9cd0d89d"})), + ("sha1:a9993e364706816aba3e25717850c26c9cd0d89d", json!({"content_hash": 5})), + ] { + let batch = lcc_sync::proto::Batch { + items: vec![ + lcc_sync::replica::Item::Photo { key: key.into(), info, fields: Default::default(), here: Default::default() }, + lcc_sync::replica::Item::Member { + coll: "c".into(), + key: key.into(), + on: lcc_sync::clock::Lww::new(true, lcc_sync::clock::Stamp::ZERO), + }, + ], + upto: 1, + more: false, + ack: None, + }; + let mut l = b.device_sync.lib.take().unwrap(); + let _ = super::catalog::apply(&mut b, &mut l, &ap, &batch); + b.device_sync.lib = Some(l); + } + assert_eq!(b.catalog.photos().count(), 1); + assert!(b.catalog.photos().all(|p| p.sha1.as_deref().is_some_and(|h| h.len() == 40))); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/engine/src/device_sync/wire.rs b/crates/engine/src/device_sync/wire.rs index 2fca6bd117..8c285ef155 100644 --- a/crates/engine/src/device_sync/wire.rs +++ b/crates/engine/src/device_sync/wire.rs @@ -265,7 +265,15 @@ fn part_of(dest: &Path) -> PathBuf { dest.with_file_name(name) } -/// The hash of a file's bytes as the catalogue keys photos by it. +/// Whether a file's bytes are the original photo `key` names (its SHA-1, or its content hash). +fn matches_key(path: &Path, key: &str) -> std::io::Result { + match super::record::sha1_of_key(key) { + Some(sha1) => Ok(lcc_hash::sha1_file(path)?.to_hex() == sha1), + None => Ok(hash_file(path)? == key), + } +} + +/// The content hash of a file's bytes, as the catalogue keys photos not hashed by SHA-1 yet. fn hash_file(path: &Path) -> std::io::Result { let mut f = File::open(path)?; let mut h = lcc_preview::Hasher128::new(); @@ -351,7 +359,7 @@ fn receive(ch: &mut Channel, w: &Want, size: u64, offset: u64, cancel: &AtomicBo f.sync_all().map_err(io)?; drop(f); let good = match w.depth { - Depth::Full => hash_file(&part).map_err(io)? == w.key, + Depth::Full => matches_key(&part, &w.key).map_err(io)?, Depth::Preview => crate::smart::is_valid(&part), Depth::None => false, }; From 5527c19b289135ec07d259e640c7859394d692d2 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:25:24 +1100 Subject: [PATCH 04/15] SYNC-IMMICH: cargo fmt (including code merged from the Immich fixes) Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/immich.rs | 7 +---- crates/engine/src/cmd/immich_publish.rs | 23 +++++++------- crates/engine/src/cmd/immich_sync.rs | 13 ++++---- crates/engine/src/device_sync/catalog.rs | 40 +++++++++++++----------- crates/engine/src/device_sync/record.rs | 5 +-- crates/engine/src/device_sync/tests.rs | 3 +- crates/engine/src/tests_immich.rs | 7 ++--- crates/immich/src/tests.rs | 4 ++- crates/sync/src/replica.rs | 3 +- crates/ui-egui/src/panels/connections.rs | 10 ++---- 10 files changed, 52 insertions(+), 63 deletions(-) diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index 274bdcaaa8..e75fee2bfa 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -57,12 +57,7 @@ pub(crate) fn ask_key(command: &str, account: &str) -> String { /// a worker under an activity row (`label`), and its result waits under `key` until /// `immich.answer {key}` takes it. One call per key at a time. The window never waits for the /// network: these calls block for up to the connection timeouts when a server is slow or gone. -pub(crate) fn ask( - s: &mut Session, - key: String, - label: &str, - work: impl FnOnce(&crate::activity::TaskGuard) -> Value + Send + 'static, -) -> Value { +pub(crate) fn ask(s: &mut Session, key: String, label: &str, work: impl FnOnce(&crate::activity::TaskGuard) -> Value + Send + 'static) -> Value { if !s.remote.asking.insert(key.clone()) { return json!({"started": false, "key": key, "reason": "already running"}); } diff --git a/crates/engine/src/cmd/immich_publish.rs b/crates/engine/src/cmd/immich_publish.rs index b0234e96d6..2ff33d334d 100644 --- a/crates/engine/src/cmd/immich_publish.rs +++ b/crates/engine/src/cmd/immich_publish.rs @@ -376,18 +376,16 @@ fn album_work(c: &lcc_immich::Client, job: AlbumJob) -> AlbumsDone { let mut not_added: HashMap> = HashMap::new(); let mut not_removed: HashMap> = HashMap::new(); // the assets of `asked` a checked add/remove left undone (all of them when the call failed) - let undone = |r: std::result::Result, lcc_immich::ImmichError>, asked: &[String], errors: &mut Vec| { - match r { - Ok(refused) => { - if let Some((_, why)) = refused.first() { - errors.push(format!("Immich album: {} of {} photos were refused ({why})", refused.len(), asked.len())); - } - refused.into_iter().map(|(id, _)| id).collect::>() - } - Err(e) => { - errors.push(format!("Immich album: {e}")); - asked.iter().cloned().collect() + let undone = |r: std::result::Result, lcc_immich::ImmichError>, asked: &[String], errors: &mut Vec| match r { + Ok(refused) => { + if let Some((_, why)) = refused.first() { + errors.push(format!("Immich album: {} of {} photos were refused ({why})", refused.len(), asked.len())); } + refused.into_iter().map(|(id, _)| id).collect::>() + } + Err(e) => { + errors.push(format!("Immich album: {e}")); + asked.iter().cloned().collect() } }; for op in &plan.remote { @@ -487,7 +485,8 @@ pub(crate) fn finish_albums(s: &mut Session, d: AlbumsDone) -> Value { s.execute("album.addPhotos", &json!({"id": id, "ids": ph}))?; } // the base: only the assets whose photos are in the new album - plan.links.insert(id, AlbumLink { immich: immich.clone(), base: Some(ids.into_iter().collect()), name: Some(name.clone()) }); + plan.links + .insert(id, AlbumLink { immich: immich.clone(), base: Some(ids.into_iter().collect()), name: Some(name.clone()) }); Ok(Value::Null) }) } diff --git a/crates/engine/src/cmd/immich_sync.rs b/crates/engine/src/cmd/immich_sync.rs index 854229701c..bef3fe3236 100644 --- a/crates/engine/src/cmd/immich_sync.rs +++ b/crates/engine/src/cmd/immich_sync.rs @@ -226,7 +226,9 @@ fn start(s: &mut Session, account: &str, dry_run: bool, full: bool, background: let st = state_of(s, account); snaps .iter() - .filter(|(_, asset, local, ..)| st.items.get(asset).is_some_and(|i| i.local_changed_at.is_none() && i.base.as_ref().is_some_and(|b| b != local))) + .filter(|(_, asset, local, ..)| { + st.items.get(asset).is_some_and(|i| i.local_changed_at.is_none() && i.base.as_ref().is_some_and(|b| b != local)) + }) .map(|(photo, ..)| *photo) .collect() }; @@ -668,10 +670,8 @@ pub(crate) fn finish(s: &mut Session, d: SyncDone) -> Value { // not (fully) sent: the old base stays, so the next run sends the change again. // A pair the next run would not look at by itself (the catalog still equals the // base, nothing decided or in conflict) is found again through the listing - unsent |= st - .items - .get(&p.asset) - .is_some_and(|i| i.base.as_ref() == Some(&p.local_used) && i.forced.is_empty() && i.conflicts.is_empty()); + unsent |= + st.items.get(&p.asset).is_some_and(|i| i.base.as_ref() == Some(&p.local_used) && i.forced.is_empty() && i.conflicts.is_empty()); continue; } let Some(photo) = s.catalog.photo(p.photo) else { continue }; @@ -1072,7 +1072,8 @@ fn resolve_deletion(s: &mut Session, p: &Value) -> Result { None => {} } } - let local: Vec = go.iter().filter(|d| d.side == "immich").map(|d| d.photo).filter(|ph| s.catalog.photo(PhotoId(*ph)).is_some()).collect(); + let local: Vec = + go.iter().filter(|d| d.side == "immich").map(|d| d.photo).filter(|ph| s.catalog.photo(PhotoId(*ph)).is_some()).collect(); if !local.is_empty() { s.execute("photo.delete", &json!({"ids": local}))?; } diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index c05daa29e8..e311a17498 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -403,27 +403,27 @@ pub(super) fn apply(s: &mut Session, lib: &mut Lib, peer: &lcc_peer::Peer, batch Item::Photo { key, info, fields, .. } => { let key = &incoming_key(s, lib, key, info); match lib.keys.get(key).copied() { - Some(id) if lib.replica.photos.get(key).is_none_or(|e| e.ghost.is_none()) => { - for (name, lww) in fields.iter().take(32) { - if !record::FIELDS.contains(&name.as_str()) || !lib.replica.incoming_wins(key, name, lww) { - continue; + Some(id) if lib.replica.photos.get(key).is_none_or(|e| e.ghost.is_none()) => { + for (name, lww) in fields.iter().take(32) { + if !record::FIELDS.contains(&name.as_str()) || !lib.replica.incoming_wins(key, name, lww) { + continue; + } + if name == "develop" && lib.replica.owes(from, key) { + record::keep_version(s, id, &peer.name); + } + if let Err(e) = record::apply(s, id, name, &lww.v) { + // this field stays as it is here (and is not confirmed as taken over) + log::warn!("sync: {e}"); + continue; + } + let d = s.catalog.photo(id).map_or(0, |p| record::digest(p, &s.catalog, name)); + lib.replica.accept_field(key, name, d, lww.s, from); } - if name == "develop" && lib.replica.owes(from, key) { - record::keep_version(s, id, &peer.name); - } - if let Err(e) = record::apply(s, id, name, &lww.v) { - // this field stays as it is here (and is not confirmed as taken over) - log::warn!("sync: {e}"); - continue; - } - let d = s.catalog.photo(id).map_or(0, |p| record::digest(p, &s.catalog, name)); - lib.replica.accept_field(key, name, d, lww.s, from); + } + _ => { + lib.replica.merge_ghost(key, info, fields, from); } } - _ => { - lib.replica.merge_ghost(key, info, fields, from); - } - } } } } @@ -619,7 +619,9 @@ pub(super) fn wants(s: &Session, lib: &mut Lib, peer: &str) -> Vec { let Source::File { path } = &p.source else { continue }; match lib.replica.depth_wanted(key) { // (a link-only photo's original comes from Immich, and its file here is the preview) - Depth::Full if !path.is_empty() && p.preview_only.as_deref() != Some(crate::remote::LINK_ONLY) => out.push(Want { key: key.clone(), depth: Depth::Full, dest: PathBuf::from(path) }), + Depth::Full if !path.is_empty() && p.preview_only.as_deref() != Some(crate::remote::LINK_ONLY) => { + out.push(Want { key: key.clone(), depth: Depth::Full, dest: PathBuf::from(path) }) + } Depth::Preview => { if let Some(dir) = &smart_dir { out.push(Want { key: key.clone(), depth: Depth::Preview, dest: crate::smart::sharded_file_path(dir, p) }); diff --git a/crates/engine/src/device_sync/record.rs b/crates/engine/src/device_sync/record.rs index fc633dd153..c2aaf33082 100644 --- a/crates/engine/src/device_sync/record.rs +++ b/crates/engine/src/device_sync/record.rs @@ -67,10 +67,7 @@ pub(crate) fn key_of(p: &Photo, cat: &Catalog) -> Option { } if p.preview_only.as_deref() == Some(crate::remote::LINK_ONLY) { // the file here is Immich's preview: only the checksum of the original names it - return cat - .remote_of(p.id) - .filter(|r| r.service == lcc_immich::link::SERVICE) - .find_map(|r| r.remote_checksum.as_deref().and_then(sha1_key)); + return cat.remote_of(p.id).filter(|r| r.service == lcc_immich::link::SERVICE).find_map(|r| r.remote_checksum.as_deref().and_then(sha1_key)); } if let Some(k) = p.sha1.as_deref().and_then(sha1_key) { return Some(k); diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 3fdbac6601..17bd0e3d21 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -361,7 +361,8 @@ fn a_link_only_immich_photo_and_the_file_are_one_photo() { write_png(&src, 7); let (mut phone, pp) = offline(&dir, "phone"); let (mut desk, dp) = offline(&dir, "desk"); - let ip = lcc_catalog::PhotoId(phone.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap()); + let ip = + lcc_catalog::PhotoId(phone.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap()); let idk = link_only(&mut desk, &src, "http://immich#u1"); assert_eq!(key_of(&phone, ip.0), key_of(&desk, idk.0), "the same key from the file and from Immich's checksum"); assert!(key_of(&desk, idk.0).is_some_and(|k| k.starts_with("sha1:"))); diff --git a/crates/engine/src/tests_immich.rs b/crates/engine/src/tests_immich.rs index f8e7539b3e..8eaa063d41 100644 --- a/crates/engine/src/tests_immich.rs +++ b/crates/engine/src/tests_immich.rs @@ -450,11 +450,8 @@ fn import_copies_maps_metadata_and_skips_duplicates() { assert!(album.photos.contains(&had.id)); assert_eq!(s.catalog.albums().filter(|al| al.name == "From Immich").count(), 1); // importing an album whose assets are all here already still makes the album and fills it - s.execute( - "immich.import", - &json!({"assets": ["a-1", "c-3"], "mode": "copy", "destination": dest.to_string_lossy(), "albumName": "Again"}), - ) - .unwrap(); + s.execute("immich.import", &json!({"assets": ["a-1", "c-3"], "mode": "copy", "destination": dest.to_string_lossy(), "albumName": "Again"})) + .unwrap(); let v = pump_until(&mut s, |_, v| v["import"]["active"] == false); assert_eq!((v["import"]["imported"].as_u64(), v["import"]["present"].as_u64()), (Some(0), Some(2)), "{v}"); assert_eq!(s.catalog.albums().find(|al| al.name == "Again").map(|al| al.photos.len()), Some(2)); diff --git a/crates/immich/src/tests.rs b/crates/immich/src/tests.rs index b0a0119aec..3e19bef9d6 100644 --- a/crates/immich/src/tests.rs +++ b/crates/immich/src/tests.rs @@ -992,7 +992,8 @@ fn hostile_activity_answers_are_bounded_and_never_panic() { /// results decide. A `duplicate` add and a `not_found` remove leave the album as asked. #[test] fn album_add_and_remove_read_the_per_asset_results() { - let (url, _) = serve(|req| match (req.method.as_str(), req.target.as_str()) { + let (url, _) = serve(|req| { + match (req.method.as_str(), req.target.as_str()) { ("PUT", "/api/albums/al-1/assets") => response( "200 OK", br#"[{"id":"as-1","success":true},{"id":"as-2","success":false,"error":"duplicate"},{"id":"as-3","success":false,"error":"no_permission"},{"id":"other","success":false,"error":"unknown"}]"#, @@ -1003,6 +1004,7 @@ fn album_add_and_remove_read_the_per_asset_results() { // a server that answers with something else than the list: the status decides ("PUT", "/api/albums/al-2/assets") => response("200 OK", br#"{"id":"al-2","albumName":"x"}"#), _ => response("404 Not Found", br#"{"message":"Not found"}"#), + } }); let c = client(&url, KEY); let ids: Vec = ["as-1", "as-2", "as-3"].iter().map(|s| s.to_string()).collect(); diff --git a/crates/sync/src/replica.rs b/crates/sync/src/replica.rs index 1c86518ea7..1b639b8bc1 100644 --- a/crates/sync/src/replica.rs +++ b/crates/sync/src/replica.rs @@ -728,8 +728,7 @@ impl Replica { self.touch_member(&coll, new, None); } for c in self.cursors.values_mut() { - let stale: Vec = - c.resend.iter().filter(|r| matches!(r, Ref::Photo(k) | Ref::Member(_, k) if k == old)).cloned().collect(); + let stale: Vec = c.resend.iter().filter(|r| matches!(r, Ref::Photo(k) | Ref::Member(_, k) if k == old)).cloned().collect(); for r in stale { c.resend.remove(&r); c.resend.insert(match r { diff --git a/crates/ui-egui/src/panels/connections.rs b/crates/ui-egui/src/panels/connections.rs index 58d6e6ecd2..202b904169 100644 --- a/crates/ui-egui/src/panels/connections.rs +++ b/crates/ui-egui/src/panels/connections.rs @@ -350,8 +350,7 @@ fn report(app: &mut LccApp, ctx: &egui::Context, r: Result) -> bo /// The question of a pending [`Confirm`] of this account and place, with its button and Cancel. /// → true when the action was carried out. fn confirm_box(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: &str, place: &str) -> bool { - let Some((text, button)) = app.immich.confirm.as_ref().filter(|c| c.account == id && c.place == place).map(|c| (c.text.clone(), c.button)) - else { + let Some((text, button)) = app.immich.confirm.as_ref().filter(|c| c.account == id && c.place == place).map(|c| (c.text.clone(), c.button)) else { return false; }; let (mut go, mut cancel) = (false, false); @@ -1797,11 +1796,8 @@ fn preview_list(app: &LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, pv: &Valu }; egui::ScrollArea::vertical().id_salt(("immich-preview", i)).max_height(140.0).show(ui, |ui| { for c in &changes { - let name = c["photo"] - .as_u64() - .and_then(|p| app.session.catalog.photo(lcc_catalog::PhotoId(p))) - .map(|p| p.file_name.clone()) - .unwrap_or_default(); + let name = + c["photo"].as_u64().and_then(|p| app.session.catalog.photo(lcc_catalog::PhotoId(p))).map(|p| p.file_name.clone()).unwrap_or_default(); let mut parts = vec![name]; for (key, label) in [("toImmich", "To Immich"), ("toCatalog", "From Immich")] { let f = fields(&c[key]); From 7796fb8c77396a5d7df82ac88a1a772f1fb4ce1d Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:33:01 +1100 Subject: [PATCH 05/15] SYNC-IMMICH: keep the Immich checksum queue off wasm builds Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/library.rs | 1 + crates/engine/src/device_sync/catalog.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/crates/engine/src/cmd/library.rs b/crates/engine/src/cmd/library.rs index 9098a62211..e694454796 100644 --- a/crates/engine/src/cmd/library.rs +++ b/crates/engine/src/cmd/library.rs @@ -215,6 +215,7 @@ pub fn import_batch_done(s: &mut Session, report: crate::import::ImportReport, m // the previews the library builds at import (library.previewSettings atImport) let ids: Vec = imported.iter().map(|i| PhotoId(*i)).collect(); // connected Immich servers are asked whether they have these photos already (`remote.pump`) + #[cfg(not(target_arch = "wasm32"))] s.remote.link_queue.extend(ids.iter().copied()); crate::cmd::previews::build_after_import(s, &ids); Ok(report) diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index e311a17498..095c3c2ae2 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -489,6 +489,7 @@ fn adopt(s: &mut Session, lib: &mut Lib, key: &str) { lib.keys.insert(key.to_string(), id); lib.ids.insert(id, key.to_string()); // a connected Immich server that has the same original links it (no upload, no second asset) + #[cfg(not(target_arch = "wasm32"))] s.remote.link_queue.push(id); (id, Depth::None) } From 3a30c2ddb6ba0e9c366c79e334049a9fac186ca2 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:38:20 +1100 Subject: [PATCH 06/15] SYNC-IMMICH: a peer's SHA-1 is only a hint; the photo is hashed here first Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/immich.rs | 1 + crates/engine/src/device_sync/catalog.rs | 25 +++++++---- crates/engine/src/device_sync/mod.rs | 4 ++ crates/engine/src/device_sync/tests.rs | 57 +++++++++++++++++++++++- crates/engine/src/remote.rs | 10 ++++- docs/sync.md | 7 +-- 6 files changed, 90 insertions(+), 14 deletions(-) diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index e75fee2bfa..c8e6c85e43 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -840,6 +840,7 @@ pub fn pump(s: &mut Session, p: &Value) -> Result { Msg::Sha1(done) => { s.remote.sha1_busy = false; for (id, path, h) in done { + s.remote.sha1_first.remove(&id); // the photo may have moved or been relinked meanwhile let same = s.catalog.photo(id).is_some_and(|ph| matches!(&ph.source, Source::File { path: x } if *x == path) && ph.sha1.is_none()); diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index 095c3c2ae2..949afc99a0 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -42,6 +42,7 @@ pub(super) fn index(s: &Session, lib: &mut Lib) { lib.keys.clear(); lib.ids.clear(); lib.alias.clear(); + lib.hints.clear(); for p in s.catalog.photos() { if let Some(k) = record::key_of(p, &s.catalog) && !lib.keys.contains_key(&k) @@ -67,6 +68,8 @@ fn reindex(s: &Session, lib: &mut Lib, id: PhotoId) { // a photo got (or lost) its key: every collection's photos are looked at afresh lib.album_sig.clear(); if let Some(o) = &old { + // (another device's claim about it is settled by the hash made here) + lib.hints.retain(|_, v| v != o); lib.ids.remove(&id); if lib.keys.get(o) == Some(&id) { lib.keys.remove(o); @@ -94,28 +97,34 @@ pub(super) fn local_key<'a>(lib: &'a Lib, key: &'a str) -> &'a str { if lib.keys.contains_key(key) { return key; } - lib.alias.get(key).map_or(key, String::as_str) + lib.alias.get(key).or_else(|| lib.hints.get(key)).map_or(key, String::as_str) } -/// The key to merge an item another device sent under. Beyond [`local_key`]: a photo sent -/// under its SHA-1 key whose content hash names a photo here not hashed yet is that photo (the -/// same bytes), which takes the SHA-1 and moves to the new key; one only told of moves too. +/// The key to merge an item another device sent under. Beyond [`local_key`]: a photo sent under +/// its SHA-1 key whose content hash names a photo here that isn't hashed yet is merged under +/// that photo's key for now, and the photo is hashed next (`remote::State::sha1_first`). The +/// other device's SHA-1 is only a hint: the key moves when this device's own hash is done, and +/// only to what it computed (a wrong claim leaves the photo as it is). A photo only told of +/// (no file here to hash) moves to the key the other device uses. fn incoming_key(s: &mut Session, lib: &mut Lib, key: &str, info: &Value) -> String { let k = local_key(lib, key).to_string(); if k != key || lib.keys.contains_key(&k) || lib.replica.photos.contains_key(&k) { return k; } - let (Some(sha1), Some(h)) = (record::sha1_of_key(key), info.get("content_hash").and_then(Value::as_str)) else { return k }; + let (Some(_), Some(h)) = (record::sha1_of_key(key), info.get("content_hash").and_then(Value::as_str)) else { return k }; if h == key || h.len() > 128 { return k; } if let Some(id) = lib.keys.get(h).copied() { let unhashed = s.catalog.photo(id).is_some_and(|p| p.sha1.is_none() && record::content_key(p) == Some(h)); if unhashed { - match s.apply_system(Op::SetSha1 { id, sha1: Some(sha1) }) { - Ok(()) => reindex(s, lib, id), - Err(e) => log::warn!("sync: {e}"), + lib.hints.insert(key.to_string(), h.to_string()); + #[cfg(not(target_arch = "wasm32"))] + { + s.remote.sha1_first.insert(id); + s.remote.sha1_idle_at = None; } + return h.to_string(); } } else if lib.replica.photos.contains_key(h) { lib.replica.rekey(h, key); diff --git a/crates/engine/src/device_sync/mod.rs b/crates/engine/src/device_sync/mod.rs index 9d9594dc00..9da31da912 100644 --- a/crates/engine/src/device_sync/mod.rs +++ b/crates/engine/src/device_sync/mod.rs @@ -147,6 +147,9 @@ pub(crate) struct Lib { pub ids: HashMap, /// Content-hash keys of photos known here by SHA-1 (another device may not have hashed them yet). pub alias: HashMap, + /// SHA-1 keys another device uses for a photo here that isn't hashed yet (a hint until this + /// device's own hash is done) → this catalogue's key for it. + pub hints: HashMap, /// Each shared collection's photos as the catalogue had them when last looked at. pub base: HashMap>, /// The photos this device should hold more of than it does. @@ -665,6 +668,7 @@ pub(crate) fn ensure_lib(s: &mut Session) { keys: HashMap::new(), ids: HashMap::new(), alias: HashMap::new(), + hints: HashMap::new(), base: HashMap::new(), wanting: BTreeSet::new(), missing: HashMap::new(), diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 17bd0e3d21..95824231da 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -260,6 +260,19 @@ fn key_of(s: &Session, id: u64) -> Option { super::record::key_of(s.catalog.photo(lcc_catalog::PhotoId(id))?, &s.catalog) } +/// Runs the SHA-1 back-fill until nothing is left to hash. +fn hash_all(s: &mut Session) { + let t = Instant::now(); + loop { + s.execute("remote.pump", &json!({"sync": false})).unwrap(); + if !s.remote.sha1_busy && super::super::remote::sha1_pending(s, 1).is_empty() { + return; + } + assert!(t.elapsed() < Duration::from_secs(20), "hashing timed out"); + std::thread::sleep(Duration::from_millis(20)); + } +} + /// The same original on two devices, one of which hasn't hashed it (or synced before photos were /// keyed by SHA-1): it ends as one photo with one key on both, the edits of both kept, and a /// replica that still knew it by its content hash moves to the new key. @@ -301,8 +314,12 @@ fn one_original_has_one_key_whichever_device_hashed_it() { for s in [&a, &b] { assert_eq!(s.catalog.photos().count(), 1, "one photo, not a second one for the other key"); } + assert_eq!(b.catalog.photo(lcc_catalog::PhotoId(ib)).unwrap().sha1, None, "another device's SHA-1 is only a hint"); + // B hashes the photo itself (first in line), and then moves to the key + hash_all(&mut b); + swap(&mut a, &ap, &mut b, &bp); let pb = b.catalog.photo(lcc_catalog::PhotoId(ib)).unwrap(); - assert_eq!(pb.sha1.as_deref(), Some(sha1.as_str()), "B takes the SHA-1 of the same bytes"); + assert_eq!(pb.sha1.as_deref(), Some(sha1.as_str()), "B's own hash of the same bytes"); assert_eq!(key_of(&b, ib), key_of(&a, ia)); assert_eq!(pb.develop.light.exposure, 0.7); let (ra, rb) = (a.catalog.photo(lcc_catalog::PhotoId(ia)).unwrap().rating, pb.rating); @@ -437,3 +454,41 @@ fn hostile_photo_keys_change_nothing() { assert!(b.catalog.photos().all(|p| p.sha1.as_deref().is_some_and(|h| h.len() == 40))); let _ = std::fs::remove_dir_all(&dir); } + +/// Another device claims a wrong SHA-1 for a photo here that isn't hashed: the photo is hashed +/// here, keeps what it computed, and the claim changes nothing in the catalogue. +#[test] +fn a_wrong_claimed_sha1_changes_nothing() { + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-wrong-sha1"); + let src = dir.join("x.png"); + write_png(&src, 11); + let (mut a, ap) = offline(&dir, "a"); + let (mut b, bp) = offline(&dir, "b"); + let ib = lcc_catalog::PhotoId(b.execute("library.import", &json!({"paths": [src.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap()); + let real = b.catalog.photo(ib).unwrap().sha1.clone().unwrap(); + b.apply_system(lcc_catalog::Op::SetSha1 { id: ib, sha1: None }).unwrap(); + offline_group(&mut a, &ap, &mut b, &bp); + let h = b.catalog.photo(ib).unwrap().content_hash.clone().unwrap(); + let wrong = "sha1:a9993e364706816aba3e25717850c26c9cd0d89d".to_string(); + let batch = lcc_sync::proto::Batch { + items: vec![lcc_sync::replica::Item::Photo { key: wrong.clone(), info: json!({"content_hash": h}), fields: Default::default(), here: Default::default() }], + upto: 1, + more: false, + ack: None, + }; + let mut l = b.device_sync.lib.take().unwrap(); + super::catalog::apply(&mut b, &mut l, &ap, &batch).unwrap(); + b.device_sync.lib = Some(l); + assert_eq!(b.catalog.photo(ib).unwrap().sha1, None, "the claim isn't written"); + assert!(b.remote.sha1_first.contains(&ib), "but the photo is hashed next"); + hash_all(&mut b); + let mut l = b.device_sync.lib.take().unwrap(); + super::catalog::scan(&b, &mut l); + b.device_sync.lib = Some(l); + assert_eq!(b.catalog.photo(ib).unwrap().sha1.as_deref(), Some(real.as_str())); + assert_eq!(key_of(&b, ib.0), Some(format!("sha1:{real}"))); + let l = b.device_sync.lib.as_ref().unwrap(); + assert!(!l.keys.contains_key(&wrong) && l.hints.is_empty(), "the claimed key names nothing here"); + assert_eq!(b.catalog.photos().count(), 1); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/engine/src/remote.rs b/crates/engine/src/remote.rs index d900ad124b..d2d238284e 100644 --- a/crates/engine/src/remote.rs +++ b/crates/engine/src/remote.rs @@ -260,6 +260,8 @@ pub struct State { /// The SHA-1 back-fill: a batch in flight; files that could not be read (not retried this session). pub(crate) sha1_busy: bool, pub(crate) sha1_failed: HashSet, + /// Photos to hash before the rest (device sync was told their SHA-1 and checks it here). + pub(crate) sha1_first: std::collections::BTreeSet, pub(crate) sha1_done: u64, /// Catalog revision when nothing was left to hash (skip the scan until it changes). pub(crate) sha1_idle_at: Option, @@ -319,6 +321,7 @@ impl Default for State { rx, sha1_busy: false, sha1_failed: HashSet::new(), + sha1_first: Default::default(), sha1_done: 0, sha1_idle_at: None, connections_path: None, @@ -363,8 +366,11 @@ impl State { /// their master's file and are skipped), minus those that failed this session; at most `limit` /// (one batch: a large library is not copied path by path for every batch). pub(crate) fn sha1_pending(s: &crate::Session, limit: usize) -> Vec<(PhotoId, String)> { - s.catalog - .photos() + let first = s.remote.sha1_first.iter().filter_map(|id| s.catalog.photo(*id)); + let mut seen = std::collections::HashSet::new(); + first + .chain(s.catalog.photos()) + .filter(|p| seen.insert(p.id)) .filter(|p| p.sha1.is_none() && p.copy_of.is_none() && !p.local && !s.remote.sha1_failed.contains(&p.id)) .filter(|p| p.preview_only.as_deref() != Some(LINK_ONLY)) .filter_map(|p| match &p.source { diff --git a/docs/sync.md b/docs/sync.md index 9ada7201d7..59f006e39a 100644 --- a/docs/sync.md +++ b/docs/sync.md @@ -48,9 +48,10 @@ When a photo's SHA-1 becomes known its key moves (`Replica::rekey`): its record, what is queued for each device move to the new key, and if another device already told of the new key, the two merge field by field. Opening a catalog whose replica still uses content-hash keys moves them the same way. Each catalog keeps a table of content-hash keys of photos it knows by SHA-1, so a device that hasn't hashed a -photo yet is still understood. A photo sent under its SHA-1 key carries its content hash; a device that has -that content hash but no SHA-1 takes the SHA-1 (the same bytes) and moves to the new key, so the two never -become two photos. A link-only photo is sent without its content hash, SHA-1 or size, which are the preview's. +photo yet is still understood. A photo sent under its SHA-1 key carries its content hash. A device that has +a photo with that content hash but no SHA-1 does not take the other device's word for it: it merges the record +under its own key for now, hashes that photo next, and moves to the key it computed. A wrong claim so changes +nothing; a right one ends as one photo with one key on both. A link-only photo is sent without its content hash, SHA-1 or size, which are the preview's. A photo that arrives from another device and has a SHA-1 key is looked up on the connected Immich servers by checksum straight away (the same lookup as for a new import), so an original Immich already has is linked, not From e44470803efb2d8b6e25ac1f452bd59a812dbf75 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:40:08 +1100 Subject: [PATCH 07/15] IMM-IMPORT: importing a link-only photo's original keeps one photo Manual: sync/immich Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/immich.rs | 45 +++++++++++++++++++ crates/engine/src/cmd/library.rs | 19 +++++++- crates/engine/src/device_sync/tests.rs | 23 ++++++++++ docs/immich.md | 4 ++ .../src/content/docs/sync/immich.mdx | 2 +- .../2026-11-15-immich-collections.md | 2 + 6 files changed, 93 insertions(+), 2 deletions(-) diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index c8e6c85e43..754ea3c8d2 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -1070,6 +1070,51 @@ fn finish_import(s: &mut Session, d: Downloaded, now: &str) { remote::ImportProgress { active: false, requested: s.remote.import.requested, imported, skipped: d.skipped, present: have.len(), failed }; } +/// Newly imported photos whose original an Immich link-only photo already stands for: the +/// link-only photo takes the file (as when its original is downloaded) and the new entry goes, +/// so the catalog holds the photo once. → `(new id, the link-only photo that took its file)`. +pub(crate) fn merge_into_link_only(s: &mut Session, ids: &[PhotoId]) -> Vec<(PhotoId, PhotoId)> { + let mut by_sha1: std::collections::HashMap = std::collections::HashMap::new(); + for p in s.catalog.photos().filter(|p| p.preview_only.as_deref() == Some(LINK_ONLY) && !p.deleted) { + for r in s.catalog.remote_of(p.id).filter(|r| r.service == SERVICE) { + if let Some(d) = r.remote_checksum.as_deref().and_then(lcc_hash::Sha1Digest::parse) { + by_sha1.entry(d.to_hex()).or_insert((p.id, r.account_id.clone())); + } + } + } + if by_sha1.is_empty() { + return Vec::new(); + } + let mut out = Vec::new(); + for id in ids { + let Some(ph) = s.catalog.photo(*id) else { continue }; + if ph.preview_only.is_some() || ph.copy_of.is_some() { + continue; + } + let (Some(sha1), Source::File { path }) = (ph.sha1.clone(), ph.source.clone()) else { continue }; + let Some((keep, account)) = by_sha1.remove(&sha1) else { continue }; + let albums = s.catalog.albums_of(*id); + if let Err(e) = adopt_original(s, keep, &account, Path::new(&path)) { + log::warn!("import: the Immich photo couldn't take `{path}`: {e}"); + continue; + } + for a in albums { + if let Some(al) = s.catalog.album(a) { + let mut photos: Vec = al.photos.iter().copied().filter(|p| p != id).collect(); + if !photos.contains(&keep) { + photos.push(keep); + } + let _ = s.apply_system(Op::SetAlbumPhotos { id: a, photos }); + } + } + if let Err(e) = s.apply_system(Op::RemovePhoto { id: *id }) { + log::warn!("import: {e}"); + } + out.push((*id, keep)); + } + out +} + /// A link-only photo's original arrived: point the photo at it. fn adopt_original(s: &mut Session, id: PhotoId, account: &str, path: &Path) -> Result<()> { let abs = path.to_string_lossy().to_string(); diff --git a/crates/engine/src/cmd/library.rs b/crates/engine/src/cmd/library.rs index e694454796..978c58fb18 100644 --- a/crates/engine/src/cmd/library.rs +++ b/crates/engine/src/cmd/library.rs @@ -195,8 +195,25 @@ fn not_browsed(s: &Session, ids: Vec, c: &str) -> Result> pub fn import_batch_done(s: &mut Session, report: crate::import::ImportReport, mut album: Option, album_name: Option<&str>) -> Result { let mut report = serde_json::to_value(report).unwrap_or_default(); // photos an import restored from Recently Deleted take part like new ones (album, selection) - let imported: Vec = + let mut imported: Vec = ["imported", "restored"].iter().flat_map(|k| report[*k].as_array().into_iter().flatten().filter_map(Value::as_u64)).collect(); + // a file an Immich link-only photo stands for: that photo takes it, no second entry + #[cfg(not(target_arch = "wasm32"))] + { + let ids: Vec = imported.iter().map(|i| PhotoId(*i)).collect(); + let merged = crate::cmd::immich::merge_into_link_only(s, &ids); + if !merged.is_empty() { + for (new, keep) in &merged { + for i in imported.iter_mut().filter(|i| **i == new.0) { + *i = keep.0; + } + } + let swap = |v: u64| merged.iter().find(|(n, _)| n.0 == v).map_or(v, |(_, k)| k.0); + let only: Vec = report["imported"].as_array().into_iter().flatten().filter_map(Value::as_u64).map(swap).collect(); + report["imported"] = json!(only); + report["mergedIntoImmich"] = json!(merged.iter().map(|(_, k)| k.0).collect::>()); + } + } if album.is_none() && let Some(name) = album_name && !imported.is_empty() diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 95824231da..9521136218 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -492,3 +492,26 @@ fn a_wrong_claimed_sha1_changes_nothing() { assert_eq!(b.catalog.photos().count(), 1); let _ = std::fs::remove_dir_all(&dir); } + +/// Importing a file an Immich link-only photo already stands for leaves one photo: the link-only +/// one takes the file, keeps its link and edits, and joins the import's collection. +#[test] +fn importing_the_original_of_a_link_only_photo_keeps_one_photo() { + let dir = lcc_testkit::TempDir::new("lcc-engine-linkonly-import"); + let src = dir.join("roll.png"); + write_png(&src, 21); + let (mut s, _) = offline(&dir, "d"); + let keep = link_only(&mut s, &src, "http://immich#u1"); + s.execute("photo.rate", &json!({"ids": [keep.0], "rating": 4})).unwrap(); + let r = s.execute("library.import", &json!({"paths": [src.to_string_lossy()], "albumName": "Import"})).unwrap(); + assert_eq!(s.catalog.photos().count(), 1, "{r}"); + assert_eq!(r["imported"], json!([keep.0])); + let p = s.catalog.photo(keep).unwrap(); + assert_eq!(p.preview_only, None); + assert_eq!(p.rating, 4); + assert!(matches!(&p.source, lcc_catalog::Source::File { path } if std::path::Path::new(path) == src.as_path())); + assert_eq!(p.sha1.as_deref(), Some(lcc_hash::sha1_file(&src).unwrap().to_hex().as_str())); + assert!(s.catalog.remote_of(keep).any(|r| r.remote_id == "asset-1")); + assert!(s.catalog.albums().any(|a| a.name == "Import" && a.photos == vec![keep])); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/docs/immich.md b/docs/immich.md index 045d4e23f9..3541706ae4 100644 --- a/docs/immich.md +++ b/docs/immich.md @@ -79,6 +79,10 @@ counts them). The import and the download of a link-only original hold an activi cancelled (what was downloaded before the stop is still imported); a failed original download is reported, and opening the photo in Develop again tries again. +A file imported from disk whose SHA-1 is the checksum of a link-only photo's asset doesn't stay a second +photo: the link-only photo takes the file as `immich.fetchOriginal` would (`cmd::immich::merge_into_link_only`, +called from `library.import`), the new entry is removed, and it joins the import's collection in its place. + ## External libraries (IMM-EXTLIB) When Immich indexes the same folders as the catalog as an *external library*, nothing is uploaded. Immich does not diff --git a/docs/manual-site/src/content/docs/sync/immich.mdx b/docs/manual-site/src/content/docs/sync/immich.mdx index 98a96ee411..824312e95a 100644 --- a/docs/manual-site/src/content/docs/sync/immich.mdx +++ b/docs/manual-site/src/content/docs/sync/immich.mdx @@ -25,7 +25,7 @@ Works with [Immich](https://immich.app) servers, version 3.0 or later. Older ser ## What it does - **Link**: each Immich asset is matched to a library photo by checksum (SHA-1), else as a *probable* match by file name, capture time and size. Probable links show a dashed badge and a **Confirm** button in Info. **Link Now** looks at what changed on the server since the last pass; **Full Link Pass** looks at everything again. Photos you import later are looked up on the server by checksum and linked by themselves. - **Badge and filter**: grid badge "Immich", an Immich filter (linked, not linked, probable), and **Open in Immich** in Info. -- **Import from Immich**: browse timeline, favourites, albums and people; **Copy** downloads originals, **Link only** keeps a preview and fetches the original when you open the photo in Develop. Rating, favourite, caption, tags and GPS come across; albums become albums. Photos the library already has are not downloaded again: they are linked and added to the album too. +- **Import from Immich**: browse timeline, favourites, albums and people; **Copy** downloads originals, **Link only** keeps a preview and fetches the original when you open the photo in Develop. Rating, favourite, caption, tags and GPS come across; albums become albums. Photos the library already has are not downloaded again: they are linked and added to the album too. Importing the original of a *Link only* photo from disk later doesn't make a second photo: the Immich photo takes the file and keeps its edits. - **Sync**: ratings, picks/favourites, captions, keywords/tags, GPS and capture time, both ways. A change on one side flows to the other; when both changed, a per-field policy decides (catalog, Immich, newest, or ask). Reject to archived is off by default. **Preview Changes** lists what a sync would do, without doing it. - A location or capture time you clear here stays cleared (Immich cannot clear one, so its copy keeps the old value). - **Deletions never sync on their own**: they wait in a queue for you to apply or keep; Immich gets them in its trash. A deletion that was undone (the photo restored from Immich's trash) leaves the queue by itself. **Delete Here Too**, **Trash in Immich**, **Delete in Immich Too** and **Disconnect** ask before they act. diff --git a/docs/whats-new/2026-11-15-immich-collections.md b/docs/whats-new/2026-11-15-immich-collections.md index 9787904efd..3527c3ebab 100644 --- a/docs/whats-new/2026-11-15-immich-collections.md +++ b/docs/whats-new/2026-11-15-immich-collections.md @@ -6,3 +6,5 @@ names on their own, keeping every edit. - A photo that arrives from another device is looked up on your Immich server first, so an original Immich already has is linked instead of uploaded again. +- Importing a file you already have as an Immich link-only photo no longer makes a second photo: the Immich photo + takes the file and keeps its edits. From 64ea22fa8521963c7b5b443465e3938b6f438516 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:42:17 +1100 Subject: [PATCH 08/15] SYNC-IMMICH: Immich albums as replica collections (fixed Sync grant, take up to Full Quality, server-side members, private accounts) Co-Authored-By: Claude Opus 5.5 --- crates/sync/src/replica.rs | 64 +++++++++++++++++++++++++++++--- crates/sync/src/replica/tests.rs | 40 ++++++++++++++++++++ 2 files changed, 98 insertions(+), 6 deletions(-) diff --git a/crates/sync/src/replica.rs b/crates/sync/src/replica.rs index 1b639b8bc1..46bc59b7b0 100644 --- a/crates/sync/src/replica.rs +++ b/crates/sync/src/replica.rs @@ -179,6 +179,10 @@ pub struct Replica { pub photos: HashMap, #[serde(default)] pub cursors: BTreeMap, + /// Immich accounts (user ids) whose connection this device keeps to itself: their + /// collections are never told to another device. Local state; it doesn't travel. + #[serde(default)] + pub private_immich: BTreeSet, #[serde(default)] pub clock: Clock, #[serde(default)] @@ -410,6 +414,44 @@ impl Replica { Ok(changed) } + /// An Immich album (or the account's set holding them, `album: None`) as this device sees + /// it on the server. Every device with the account writes the same id, so their copies merge; + /// the name follows the server. Grant is fixed at Sync: every device that takes it may add. + #[allow(clippy::too_many_arguments)] + pub fn immich_collection(&mut self, id: &str, account: &str, album: Option<&str>, name: &str, parent: Option, now_ms: u64) -> bool { + if !ok_id(id) || !ok_id(account) { + return false; + } + let meta = crate::model::CollectionMeta { name: clean(name), parent }; + match self.collections.get(id) { + Some(e) if e.c.meta.v == meta => false, + Some(_) => { + let before = self.collection(id).cloned(); + let s = self.stamp(now_ms); + if let Some(e) = self.collections.get_mut(id) { + e.c.meta = Lww::new(meta, s); + } + self.touch_collection(id, None, before.as_ref()); + true + } + None => { + let s = self.stamp(now_ms); + let kind = if album.is_some() { CollectionKind::Album } else { CollectionKind::Set }; + let owner = format!("{}{account}", crate::model::IMMICH_OWNER); + let mut c = Collection::new(id, &owner, kind, &meta.name, meta.parent, Grant::Sync, s); + c.immich = Some(crate::model::ImmichRef { account: account.to_string(), album: album.unwrap_or_default().to_string() }); + self.collections.insert(id.to_string(), CollEntry { c, seq: 0, via: None }); + self.touch_collection(id, None, None); + true + } + } + } + + /// Whether collection `c` is an Immich one this device keeps to itself. + pub fn is_private(&self, c: &Collection) -> bool { + c.is_immich() && c.immich.as_ref().is_some_and(|r| self.private_immich.contains(&r.account)) + } + /// The owner says what the other devices may have. pub fn set_grant(&mut self, id: &str, grant: Grant, now_ms: u64) -> Result { self.edit_collection(id, now_ms, |c, s, me| { @@ -430,7 +472,7 @@ impl Replica { if c.owner == me { return Err(Refused::Owner); } - if take > c.grant.v.most() { + if take > c.grant.v.most() || (c.is_immich() && take > Take::FullQuality) { return Err(Refused::NotAllowed); } let changed = c.takes.get(me).is_none_or(|t| t.v != take); @@ -760,7 +802,15 @@ impl Replica { /// Whether `peer` may be sent photo `key` at `depth`. pub fn may_fetch(&self, peer: &str, key: &str, depth: Depth) -> bool { - self.in_group_with(peer) && self.collections_of(key).any(|c| c.may_fetch(peer, depth)) + // (an Immich album's files come from the server) + self.in_group_with(peer) && self.collections_of(key).any(|c| !c.is_immich() && c.may_fetch(peer, depth)) + } + + /// How much of photo `key` this device should get from other devices: as + /// [`Replica::depth_wanted`], without Immich albums (their files come from the server). + pub fn depth_from_peers(&self, key: &str) -> Depth { + let me = self.device.as_str(); + self.collections_of(key).filter(|c| !c.is_immich()).map(|c| c.depth_for(me)).max().unwrap_or(Depth::None) } // ── what to tell a device ────────────────────────────────────────────────────────────── @@ -773,9 +823,10 @@ impl Replica { } match r { Ref::Group => true, - Ref::Coll(id) => self.collection(id).is_some_and(|c| c.listed_for(peer, g.mode)), - Ref::Member(coll, _) => self.collection(coll).is_some_and(|c| c.shares_with(peer)), - Ref::Photo(key) => self.collections_of(key).any(|c| c.shares_with(peer)), + Ref::Coll(id) => self.collection(id).is_some_and(|c| !self.is_private(c) && c.listed_for(peer, g.mode)), + // (each device learns an Immich album's photos from the server, not from another device) + Ref::Member(coll, _) => self.collection(coll).is_some_and(|c| !c.is_immich() && c.shares_with(peer)), + Ref::Photo(key) => self.collections_of(key).any(|c| !self.is_private(c) && c.shares_with(peer)), } } @@ -887,7 +938,8 @@ impl Replica { pub fn reset(&mut self) { let device = std::mem::take(&mut self.device); let clock = self.clock.clone(); - *self = Replica { device, clock, ..Default::default() }; + let private_immich = std::mem::take(&mut self.private_immich); + *self = Replica { device, clock, private_immich, ..Default::default() }; } } diff --git a/crates/sync/src/replica/tests.rs b/crates/sync/src/replica/tests.rs index 1b8d8b0d63..7ccb6e12f5 100644 --- a/crates/sync/src/replica/tests.rs +++ b/crates/sync/src/replica/tests.rs @@ -347,3 +347,43 @@ fn a_photo_rekeyed_to_its_sha1_keeps_its_record_and_collections() { assert!(!a.r.rekey("sha1:x", "sha1:x") && !a.r.rekey("nope", "sha1:y") && !a.r.rekey("sha1:x", "")); assert!(!a.r.rekey("sha1:x", &"k".repeat(500))); } + +#[test] +fn immich_albums_are_collections_every_device_shares_but_members_come_from_the_server() { + let (mut a, mut b) = (Dev::new("a"), Dev::new("b")); + group(Mode::Collections, Grant::None, &mut a, &mut [&mut b]); + // both devices see the same album on the server: the same ids, one collection + for d in [&mut a, &mut b] { + let now = d.tick(); + assert!(d.r.immich_collection("immich:u1", "u1", None, "Immich", None, now)); + assert!(d.r.immich_collection("immich:u1:al1", "u1", Some("al1"), "Holiday", Some("immich:u1".into()), now)); + assert!(!d.r.immich_collection("immich:u1:al1", "u1", Some("al1"), "Holiday", Some("immich:u1".into()), now), "nothing new"); + } + both(&mut a, &mut b); + let c = b.r.collection("immich:u1:al1").unwrap().clone(); + assert!(c.is_immich() && c.grant.v == Grant::Sync && c.kind == CollectionKind::Album); + assert!(b.r.collection("immich:u1").is_some_and(|c| c.kind == CollectionKind::Set)); + // takes: none, previews or full quality; never full sync + let now = b.tick(); + assert_eq!(b.r.set_take("immich:u1:al1", Take::FullSync, now), Err(Refused::NotAllowed)); + b.r.set_take("immich:u1:al1", Take::Previews, now).unwrap(); + // A's membership (from its own listing) isn't told; the photo's record is, and no file is served + let now = a.tick(); + a.r.set_member("immich:u1:al1", "p", true, now); + both(&mut a, &mut b); + assert!(b.r.members_of("immich:u1:al1").next().is_none(), "B lists the album's photos itself"); + assert!(a.r.tells("b", &Ref::Photo("p".into())), "the record travels to a device that takes it"); + assert!(!a.r.may_fetch("b", "p", Depth::Preview), "files come from Immich"); + assert_eq!(a.r.depth_from_peers("p"), Depth::Full, "p is also in A's own collection c"); + // a private connection's collections are never told + a.r.private_immich.insert("u1".into()); + let now = a.tick(); + a.r.immich_collection("immich:u1:al2", "u1", Some("al2"), "Secret", Some("immich:u1".into()), now); + both(&mut a, &mut b); + assert!(b.r.collection("immich:u1:al2").is_none()); + assert!(!a.r.tells("b", &Ref::Coll("immich:u1:al1".into()))); + // hostile ids change nothing + assert!(!a.r.immich_collection("", "u1", None, "x", None, now)); + assert!(!a.r.immich_collection(&"x".repeat(500), "u1", None, "x", None, now)); + assert!(!a.r.immich_collection("immich:x", "u\u{0}", None, "x", None, now)); +} From 5f67677ea19826d7447b84cb018b26fbdc3de5f0 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:50:20 +1100 Subject: [PATCH 09/15] SYNC-IMMICH: Immich albums as collections under an Immich set, per-device take, add-from-any-device uploads once Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/device_sync.rs | 9 + crates/engine/src/cmd/immich.rs | 15 + crates/engine/src/cmd/immich_collections.rs | 423 ++++++++++++++++++++ crates/engine/src/device_sync/catalog.rs | 50 ++- crates/engine/src/device_sync/mod.rs | 7 + crates/engine/src/device_sync/tests.rs | 114 ++++++ crates/engine/src/remote.rs | 8 + crates/engine/src/tests_immich.rs | 8 +- crates/engine/src/tests_immich_sync.rs | 47 ++- crates/immich/src/accounts.rs | 10 + crates/immich/src/publish.rs | 3 +- crates/sync/src/replica.rs | 14 + 12 files changed, 682 insertions(+), 26 deletions(-) create mode 100644 crates/engine/src/cmd/immich_collections.rs diff --git a/crates/engine/src/cmd/device_sync.rs b/crates/engine/src/cmd/device_sync.rs index c84e00437b..597d8992fa 100644 --- a/crates/engine/src/cmd/device_sync.rs +++ b/crates/engine/src/cmd/device_sync.rs @@ -81,6 +81,15 @@ pub fn specs() -> Vec { let album = p.get("album").and_then(Value::as_u64).ok_or_else(|| bad("sync.skip", "missing `album`"))?; sync::skip(s, album) }), + cmd!(query "sync.immichRefresh", "List Immich Albums Now", [], None, "{}: list the albums of the Immich accounts shown as collections now (also done about once a minute) → {listing, errors}", always, |s, _p| { + #[cfg(not(target_arch = "wasm32"))] + return Ok(crate::cmd::immich::collections::refresh(s)); + #[cfg(target_arch = "wasm32")] + { + let _ = s; + Ok(json!({"listing": 0, "errors": {}})) + } + }), cmd!(query "sync.now", "Sync Now", [], None, "{}: exchange with every device now → sync.status", always, |s, _p| { sync::sync_now(s); sync::status(s) diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index 754ea3c8d2..fe69705ee8 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -26,6 +26,8 @@ use crate::{Result, Session}; const LINK_PAGES: u32 = 10_000; const PAGE_SIZE: u32 = 1000; +#[path = "immich_collections.rs"] +pub(crate) mod collections; #[path = "immich_publish.rs"] pub mod publish; #[path = "immich_sidecars.rs"] @@ -910,6 +912,9 @@ pub fn pump(s: &mut Session, p: &Value) -> Result { } } Msg::Downloaded(d) => finish_import(s, *d, &now), + Msg::ImmichAlbums(l) => collections::finish_listing(s, *l), + Msg::ImmichPushed(p) => collections::finish_push(s, *p), + Msg::ImmichPushDone => s.remote.coll.pushing = false, Msg::Synced(d) => { sync::finish(s, *d); } @@ -941,6 +946,7 @@ pub fn pump(s: &mut Session, p: &Value) -> Result { sync::tick(s); } start_link_check(s); + collections::tick(s); // the next SHA-1 batch if bool_or(p, "sha1", true) && !s.remote.sha1_busy && s.remote.sha1_idle_at != Some(s.catalog.revision) { let todo = remote::sha1_pending(s, remote::SHA1_BATCH); @@ -1326,6 +1332,15 @@ fn base_specs() -> Vec { always, disconnect ), + cmd!( + "immich.collections", + "Show Immich Albums as Collections", + [], + None, + "{account?, on: bool}: the account's albums show as collections in device sync (Settings ▸ Sync, under \"Immich\"); each device then picks per album none, previews or fullQuality → {account, collections}", + always, + collections::set_shown + ), cmd!(query "immich.status", "Immich Status", [], None, "{check?: bool (also contact each server), background?: bool (do that on workers; results in later calls' `server`)} → {accounts: [{id, url, userName, version, permissions, linked, probable, link, server?, checking}], secretStore, connecting, connected?}", always, status), cmd!(query "immich.answer", "Immich Background Result", [], None, "{key, keep?: bool}: the result of a call made with background: true (immich.libraries, immich.authStatus, immich.unlockSession, immich.scanLibraries, immich.importPeople, immich.pushPeople; they return {started, key}); taken once unless keep → {done: true, result} or {done: false, running}; remote.pump lists the waiting keys in `answers`", always, answer), cmd!(query "immich.authStatus", "Immich Auth Status", [], None, "{account?, background?: bool (on a worker: {started, key}, the result through immich.answer)}: whether this app's server session is elevated (locked folders visible to its listings), and the unlock secrets the account has → {ok, account, isElevated, password, pinCode, expiresAt?, pinExpiresAt?} or {ok: false, error}", always, auth_status), diff --git a/crates/engine/src/cmd/immich_collections.rs b/crates/engine/src/cmd/immich_collections.rs new file mode 100644 index 0000000000..a3f8fcb143 --- /dev/null +++ b/crates/engine/src/cmd/immich_collections.rs @@ -0,0 +1,423 @@ +//! Immich albums as device-sync collections (`docs/sync.md` ▸ Immich collections). +//! +//! For every connected account shown as collections (`immich.collections`), each device that +//! holds the account's key lists the account's albums on a worker, about once a minute +//! (`sync.immichRefresh` at once). Each album becomes a shared collection with the id +//! `immich::` inside the set `immich:` ("Immich"): the same ids on +//! every device, so their copies merge. Which photos are in an album comes from the server on +//! each device; what a device takes decides what it brings in: link-only previews +//! (`previews`) or originals (`fullQuality`), through the ordinary Immich import. A photo added +//! to such a collection here is uploaded (unless Immich has it already, by checksum) and put +//! into the album; one taken out here is taken out of the album. + +use std::collections::{BTreeMap, BTreeSet}; +use std::path::PathBuf; +use std::time::{Duration, Instant}; + +use lcc_catalog::{Op, PhotoId, Source}; +use lcc_immich::link::SERVICE; +use lcc_immich::{Asset, ImmichError}; +use lcc_sync::model::Take; +use serde_json::{Value, json}; + +use crate::Session; +use crate::device_sync::{catalog, now_ms, record, touched}; +use crate::remote::{LINK_ONLY, Msg}; + +/// How often each account's albums are listed again. +const EVERY: Duration = Duration::from_secs(60); +/// The most albums, and photos per album, taken from one listing. +const MAX_ALBUMS: usize = 2000; +const MAX_ASSETS: usize = 50_000; +/// Originals downloaded per pass for collections taken in full quality. +const FETCH_PER_PASS: usize = 4; + +/// The set holding an account's albums. +pub(crate) fn set_id(user: &str) -> String { + format!("immich:{user}") +} + +pub(crate) fn collection_id(user: &str, album: &str) -> String { + format!("immich:{user}:{album}") +} + +/// One account's albums, as a worker listed them. +pub(crate) struct Listing { + pub account: String, + pub user: String, + pub albums: Result)>, ImmichError>, +} + +/// What an upload run did: links to write (photo, asset, checksum) and the first error. +pub(crate) struct Pushed { + pub account: String, + pub links: Vec<(PhotoId, String, String)>, + pub error: Option, +} + +/// What one upload run is asked to do for one album. +struct Push { + album: String, + add: Vec<(PhotoId, Option, PathBuf, Option, String, String)>, + remove: Vec, +} + +/// The session's side: running workers and when each account was last listed. +#[derive(Default)] +pub(crate) struct CollState { + pub listing: usize, + pub pushing: bool, + pub at: BTreeMap, + pub force: bool, + pub errors: BTreeMap, +} + +fn in_group(s: &Session) -> bool { + s.device_sync.lib.as_ref().is_some_and(|l| l.replica.group.as_ref().is_some_and(|g| g.has(&l.replica.device))) +} + +/// The accounts shown as collections here: `(local id, user id)`. +fn shown(s: &mut Session) -> Vec<(String, String)> { + s.immich_accounts().map(|a| a.immich.iter().filter(|x| x.collections && !x.user_id.is_empty()).map(|x| (x.id.clone(), x.user_id.clone())).collect()).unwrap_or_default() +} + +/// Every frame from `remote.pump`: starts the listings that are due and the uploads waiting. +pub(crate) fn tick(s: &mut Session) { + if !in_group(s) { + return; + } + let accounts = shown(s); + if let Some(lib) = &mut s.device_sync.lib { + let here: BTreeSet = accounts.iter().map(|(_, u)| u.clone()).collect(); + if lib.immich_here != here { + lib.immich_here = here; + lib.generation = lib.generation.wrapping_add(1); + } + } + let force = std::mem::take(&mut s.remote.coll.force); + if s.remote.coll.listing == 0 { + for (account, user) in &accounts { + let due = force || s.remote.coll.at.get(account).is_none_or(|t| t.elapsed() >= EVERY); + if !due { + continue; + } + s.remote.coll.at.insert(account.clone(), Instant::now()); + let Ok((_, client)) = s.immich_client(account) else { continue }; + s.remote.coll.listing += 1; + let task = s.activity.start("immich", "Listing Immich albums", crate::activity::Cancel::Yes); + let tx = s.remote.sender(); + let (account, user) = (account.clone(), user.clone()); + std::thread::spawn(move || { + let albums = list(&client, &task); + drop(task); + let _ = tx.send(Msg::ImmichAlbums(Box::new(Listing { account, user, albums }))); + }); + } + } + if !s.remote.coll.pushing { + start_push(s, &accounts); + } +} + +fn list(client: &lcc_immich::Client, task: &crate::activity::TaskGuard) -> Result)>, ImmichError> { + let mut out = Vec::new(); + let albums = client.albums()?; + let total = albums.len().min(MAX_ALBUMS) as u64; + for (n, a) in albums.into_iter().take(MAX_ALBUMS).enumerate() { + if task.is_cancelled() { + return Err(ImmichError::Cancelled); + } + task.progress(n as u64, total); + let q = lcc_immich::types::MetadataSearch { size: Some(1000), album_ids: Some(vec![a.id.clone()]), ..Default::default() }; + let mut assets = Vec::new(); + client.search_all(&q, (MAX_ASSETS / 1000) as u32, |page| { + assets.extend(page.iter().filter(|x| !x.is_trashed).cloned()); + assets.len() < MAX_ASSETS + })?; + out.push((a, assets)); + } + Ok(out) +} + +/// The key a listed asset has in device sync: its photo's key when it is linked here, else the +/// SHA-1 Immich reports. +fn asset_key(s: &Session, account: &str, a: &Asset) -> Option { + match s.catalog.photo_of_remote(SERVICE, account, &a.id).and_then(|id| s.catalog.photo(id)) { + Some(p) => record::key_of(p, &s.catalog), + None => record::sha1_key(&a.checksum), + } +} + +/// A listing came back: the collections and which photos are in them, then what this device +/// takes of each is brought in. +pub(crate) fn finish_listing(s: &mut Session, l: Listing) { + s.remote.coll.listing = s.remote.coll.listing.saturating_sub(1); + let albums = match l.albums { + Ok(a) => { + s.remote.coll.errors.remove(&l.account); + a + } + Err(e) => { + s.remote.coll.errors.insert(l.account.clone(), e.to_string()); + return; + } + }; + if !in_group(s) { + return; + } + let keyed: Vec<(String, String, Vec<(String, Asset)>)> = albums + .into_iter() + .map(|(a, assets)| { + let keyed = assets.into_iter().filter_map(|x| asset_key(s, &l.account, &x).map(|k| (k, x))).collect(); + (a.id, a.album_name, keyed) + }) + .collect(); + let Some(mut lib) = s.device_sync.lib.take() else { return }; + let now = now_ms(); + let me = lib.replica.device.clone(); + let set = set_id(&l.user); + lib.replica.immich_collection(&set, &l.user, None, "Immich", None, now); + let mut link: Vec = Vec::new(); + let mut copy: Vec = Vec::new(); + let mut fetch: Vec = Vec::new(); + let mut seen: BTreeSet = BTreeSet::new(); + for (album, name, assets) in &keyed { + let id = collection_id(&l.user, album); + if !lib.replica.immich_collection(&id, &l.user, Some(album), name, Some(set.clone()), now) && lib.replica.collection(&id).is_none() { + continue; + } + seen.insert(id.clone()); + // an album that was removed on the server and is back + let _ = lib.replica.set_immich_gone(&id, false, now); + let keys: BTreeSet<&String> = assets.iter().map(|(k, _)| k).collect(); + // (what this device is still to send to the album isn't taken out again meanwhile) + let waiting: BTreeSet = lib.immich_out.iter().filter(|(c, _, _)| *c == id).map(|(_, k, _)| k.clone()).collect(); + for k in &keys { + if !waiting.contains(*k) { + lib.replica.set_member(&id, k, true, now); + } + } + let gone: Vec = lib.replica.members_of(&id).filter(|k| !keys.contains(k) && !waiting.contains(*k)).cloned().collect(); + for k in gone { + lib.replica.set_member(&id, &k, false, now); + } + let take = lib.replica.collection(&id).map_or(Take::None, |c| c.take_of(&me)); + if take == Take::None { + continue; + } + for (k, a) in assets { + match lib.keys.get(k).and_then(|p| s.catalog.photo(*p)) { + None if take == Take::FullQuality => copy.push(a.id.clone()), + None => link.push(a.id.clone()), + Some(p) if take == Take::FullQuality && p.preview_only.as_deref() == Some(LINK_ONLY) && fetch.len() < FETCH_PER_PASS => { + fetch.push(p.id.0); + } + Some(_) => {} + } + } + } + // albums gone from the server + let stale: Vec = lib + .replica + .collections + .iter() + .filter(|(id, e)| e.c.immich.as_ref().is_some_and(|r| r.account == l.user && !r.album.is_empty()) && !seen.contains(*id) && !e.c.gone()) + .map(|(id, _)| id.clone()) + .collect(); + for id in stale { + let _ = lib.replica.set_immich_gone(&id, true, now); + } + touched(&mut lib); + catalog::reconcile(s, &mut lib); + s.device_sync.lib = Some(lib); + link.sort(); + link.dedup(); + copy.sort(); + copy.dedup(); + if !s.remote.import.active { + let r = if !link.is_empty() { + Some(s.execute("immich.import", &json!({"account": l.account, "assets": link, "mode": "link"}))) + } else if !copy.is_empty() { + let dest = s.immich_dir().map(|d| d.join("originals").to_string_lossy().to_string()); + dest.map(|d| s.execute("immich.import", &json!({"account": l.account, "assets": copy, "mode": "copy", "destination": d}))) + } else { + None + }; + if let Some(Err(e)) = r { + log::warn!("Immich collections: {e}"); + } + } + for id in fetch { + if let Err(e) = s.execute("immich.fetchOriginal", &json!({"ids": [id]})) { + log::info!("Immich collections: {e}"); + } + } +} + +/// Uploads (or finds by checksum) the photos added here to Immich collections, and takes out of +/// the albums the photos taken out here. +fn start_push(s: &mut Session, accounts: &[(String, String)]) { + let Some(lib) = &mut s.device_sync.lib else { return }; + if lib.immich_out.is_empty() { + return; + } + let device = lib.replica.device.clone(); + let out = std::mem::take(&mut lib.immich_out); + let mut jobs: BTreeMap> = BTreeMap::new(); + let mut by_album: BTreeMap<(String, String), Push> = BTreeMap::new(); + for (coll, key, on) in out { + let Some(r) = lib.replica.collection(&coll).and_then(|c| c.immich.clone()) else { continue }; + let Some((account, _)) = accounts.iter().find(|(_, u)| *u == r.account) else { continue }; + let Some(p) = lib.keys.get(&key).and_then(|id| s.catalog.photo(*id)) else { continue }; + let linked = s.catalog.remote_of(p.id).find(|x| x.service == SERVICE && x.account_id == *account).map(|x| x.remote_id.clone()); + let push = by_album.entry((account.clone(), r.album.clone())).or_insert_with(|| Push { album: r.album.clone(), add: Vec::new(), remove: Vec::new() }); + if on { + let path = match &p.source { + Source::File { path } if p.preview_only.is_none() => PathBuf::from(path), + // (a link-only photo is on the server already: it is only put into the album) + _ if linked.is_some() => PathBuf::new(), + _ => continue, + }; + let created = p.captured.clone().unwrap_or_else(|| p.imported.clone()); + push.add.push((p.id, linked, path, p.sha1.clone(), p.file_name.clone(), created)); + } else if let Some(a) = linked { + push.remove.push(a); + } + } + for ((account, _), push) in by_album { + jobs.entry(account).or_default().push(push); + } + let mut runs = Vec::new(); + for (account, pushes) in jobs { + let Ok((_, client)) = s.immich_client(&account) else { continue }; + runs.push((account, client, pushes)); + } + if runs.is_empty() { + return; + } + s.remote.coll.pushing = true; + let task = s.activity.start("immich", "Adding photos to Immich albums", crate::activity::Cancel::Yes); + let tx = s.remote.sender(); + std::thread::spawn(move || { + for (account, client, pushes) in runs { + let (links, error) = push(&client, &device, pushes, &task); + let _ = tx.send(Msg::ImmichPushed(Box::new(Pushed { account, links, error }))); + } + drop(task); + let _ = tx.send(Msg::ImmichPushDone); + }); +} + +fn push(client: &lcc_immich::Client, device: &str, pushes: Vec, task: &crate::activity::TaskGuard) -> (Vec<(PhotoId, String, String)>, Option) { + let mut links = Vec::new(); + let mut error = None; + for p in pushes { + let mut ids = Vec::new(); + for (photo, linked, path, sha1, name, created) in p.add { + if task.is_cancelled() { + return (links, error.or(Some("stopped".into()))); + } + if let Some(a) = linked { + ids.push(a); + continue; + } + // Immich may have it already (the phone's own upload, another device's): linked, not stored twice + let found = sha1.as_ref().and_then(|h| { + client + .upload_check(&[lcc_immich::types::UploadCheck { id: photo.0.to_string(), checksum: h.clone() }]) + .ok()? + .into_iter() + .find_map(|r| r.asset_id.filter(|a| !a.is_empty())) + }); + let asset = match found { + Some(a) => Ok(a), + None => client + .upload(&lcc_immich::client::NewAsset { + data: lcc_immich::client::UploadData::File(&path), + file_name: &name, + mime: lcc_immich::publish::mime_of(&name), + device_asset_id: &format!("{device}-{}", photo.0), + device_id: device, + created: &created, + favorite: false, + sidecar: None, + }) + .map(|(id, _)| id), + }; + match asset { + Ok(a) => { + links.push((photo, a.clone(), sha1.unwrap_or_default())); + ids.push(a); + } + Err(e) => { + error.get_or_insert(e.to_string()); + } + } + } + if !ids.is_empty() + && let Err(e) = client.album_add_checked(&p.album, &ids) + { + error.get_or_insert(e.to_string()); + } + if !p.remove.is_empty() + && let Err(e) = client.album_remove(&p.album, &p.remove) + { + error.get_or_insert(e.to_string()); + } + } + (links, error) +} + +/// An upload run came back: the photos are linked to their assets. +pub(crate) fn finish_push(s: &mut Session, p: Pushed) { + let now = (s.clock)(); + let ops: Vec = p + .links + .into_iter() + .filter(|(photo, _, _)| s.catalog.photo(*photo).is_some() && !s.catalog.remote_of(*photo).any(|r| r.service == SERVICE && r.account_id == p.account)) + .map(|(photo, asset, sha1)| { + lcc_catalog::Catalog::link_remote_op(lcc_catalog::RemoteIdentity { + photo_id: photo, + service: SERVICE.into(), + account_id: p.account.clone(), + remote_id: asset, + remote_checksum: (!sha1.is_empty()).then_some(sha1), + remote_updated_at: None, + last_synced_at: Some(now.clone()), + sync_state: lcc_catalog::SyncState::Synced, + }) + }) + .collect(); + if !ops.is_empty() + && let Err(e) = s.apply_system(Op::Batch { ops }) + { + log::warn!("Immich collections: {e}"); + } + match p.error { + Some(e) => s.remote.coll.errors.insert(p.account, e), + None => s.remote.coll.errors.remove(&p.account), + }; +} + +/// `immich.collections {account?, on}`: show (or stop showing) the account's albums as +/// collections in device sync. +pub(crate) fn set_shown(s: &mut Session, p: &Value) -> crate::Result { + const C: &str = "immich.collections"; + let id = super::account_param(s, p, C)?; + let on = p.get("on").and_then(Value::as_bool).ok_or_else(|| super::bad(C, "missing `on` (true or false)"))?; + let accounts = s.immich_accounts().map_err(|e| super::bad(C, e))?; + let acc = accounts.get_mut(&id).ok_or_else(|| super::bad(C, "no such account"))?; + acc.collections = on; + s.save_accounts().map_err(|e| super::bad(C, e))?; + if on { + s.remote.coll.force = true; + } + Ok(json!({"account": id, "collections": on})) +} + +/// `sync.immichRefresh`: list the Immich albums shown as collections now. +pub(crate) fn refresh(s: &mut Session) -> Value { + s.remote.coll.force = true; + tick(s); + json!({"listing": s.remote.coll.listing, "errors": s.remote.coll.errors}) +} diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index 949afc99a0..177c196727 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -206,8 +206,9 @@ fn scan_photo(s: &Session, lib: &mut Lib, key: &str, now: u64) -> bool { // told of before it was imported here: `reconcile` joins the two return false; } - // a photo imported here holds its original - let have = known.map_or(Depth::Full, |e| e.have); + // a photo imported here holds its original (a link-only one, Immich's preview) + let link_only = p.preview_only.as_deref() == Some(crate::remote::LINK_ONLY); + let have = if link_only { Depth::Preview } else { known.map_or(Depth::Full, |e| e.have) }; lib.replica.local_photo(key, &record::digests(p, &s.catalog), have, now) } @@ -225,12 +226,20 @@ fn scan_members(s: &Session, lib: &mut Lib, id: &str, cur: BTreeSet, now (cur.iter().filter(|k| !known.contains(k)).cloned().collect(), Vec::new()) } }; + let immich = lib.replica.collection(id).is_some_and(|c| c.is_immich()); for k in adds { changed |= scan_photo(s, lib, &k, now); changed |= lib.replica.set_member(id, &k, true, now); + if immich { + // to the server: uploaded unless Immich has it, then put into the album + lib.immich_out.push((id.to_string(), k, true)); + } } for k in removes { changed |= lib.replica.set_member(id, &k, false, now); + if immich { + lib.immich_out.push((id.to_string(), k, false)); + } } } lib.base.insert(id.to_string(), cur); @@ -334,15 +343,18 @@ pub(super) fn scan(s: &Session, lib: &mut Lib) -> bool { match touched { Some(ids) => { for id in ids { + // (a photo an Immich album lists comes into the replica when it is imported here) if let Some(key) = lib.ids.get(&id).cloned() - && lib.replica.photos.contains_key(&key) + && (lib.replica.photos.contains_key(&key) || lib.replica.collections_of(&key).next().is_some()) { changed |= scan_photo(s, lib, &key, now); } } } None => { - let keys: BTreeSet = lib.replica.photos.keys().filter(|k| lib.keys.contains_key(*k)).cloned().collect(); + let members: BTreeSet<&String> = lib.replica.members.values().flat_map(|m| m.iter().filter(|(_, e)| e.on.v).map(|(k, _)| k)).collect(); + let keys: BTreeSet = + lib.replica.photos.keys().chain(members).filter(|k| lib.keys.contains_key(*k)).cloned().collect(); for key in keys { changed |= scan_photo(s, lib, &key, now); } @@ -517,7 +529,7 @@ fn adopt(s: &mut Session, lib: &mut Lib, key: &str) { /// Brings the catalogue in line with the replica: the collections other devices own, the photos /// they told of that this device takes, and which photos are in each shared collection. -pub(super) fn reconcile(s: &mut Session, lib: &mut Lib) { +pub(crate) fn reconcile(s: &mut Session, lib: &mut Lib) { let Some(mode) = in_group(lib) else { return }; let me = lib.replica.device.clone(); // collections of other devices → collections of the catalogue (sets first) @@ -530,17 +542,31 @@ pub(super) fn reconcile(s: &mut Session, lib: &mut Lib) { } let mapped = lib.replica.albums.get(&id).copied().filter(|a| s.catalog.album(AlbumId(*a)).is_some()); let listed = !c.gone() && c.listed_for(&me, mode) && (mode == Mode::Catalogue || c.grant.v != Grant::None); - let want = listed - && match mode { - Mode::Catalogue => true, - Mode::Collections => c.kind != CollectionKind::Set && c.take_of(&me) != Take::None, - }; + let want = if c.is_immich() { + // an Immich album is in the catalogue where the account is and the device takes it; + // its set ("Immich") as long as one of its albums is + let here = c.immich.as_ref().is_some_and(|r| lib.immich_here.contains(&r.account)); + !c.gone() + && here + && match c.kind { + CollectionKind::Set => lib.replica.collections.values().any(|e| { + e.c.meta.v.parent.as_deref() == Some(id.as_str()) && !e.c.gone() && e.c.take_of(&me) != Take::None + }), + _ => c.take_of(&me) != Take::None, + } + } else { + listed + && match mode { + Mode::Catalogue => true, + Mode::Collections => c.kind != CollectionKind::Set && c.take_of(&me) != Take::None, + } + }; match (want, mapped) { (true, None) => { let aid = s.catalog.alloc_album_id(); let mut a = Album::new(aid, display_name(lib, &c)); a.folder = c.kind == CollectionKind::Set; - if mode == Mode::Catalogue { + if mode == Mode::Catalogue || c.is_immich() { a.parent = c .meta .v @@ -627,7 +653,7 @@ pub(super) fn wants(s: &Session, lib: &mut Lib, peer: &str) -> Vec { } let Some(p) = lib.keys.get(key).and_then(|id| s.catalog.photo(*id)) else { continue }; let Source::File { path } = &p.source else { continue }; - match lib.replica.depth_wanted(key) { + match lib.replica.depth_from_peers(key) { // (a link-only photo's original comes from Immich, and its file here is the preview) Depth::Full if !path.is_empty() && p.preview_only.as_deref() != Some(crate::remote::LINK_ONLY) => { out.push(Want { key: key.clone(), depth: Depth::Full, dest: PathBuf::from(path) }) diff --git a/crates/engine/src/device_sync/mod.rs b/crates/engine/src/device_sync/mod.rs index 9da31da912..8d78df5226 100644 --- a/crates/engine/src/device_sync/mod.rs +++ b/crates/engine/src/device_sync/mod.rs @@ -150,6 +150,11 @@ pub(crate) struct Lib { /// SHA-1 keys another device uses for a photo here that isn't hashed yet (a hint until this /// device's own hash is done) → this catalogue's key for it. pub hints: HashMap, + /// The Immich accounts (user ids) shown as collections on this device. + pub immich_here: BTreeSet, + /// Photos added to (true) or taken out of (false) Immich collections here, still to send to + /// the server: (collection, key, in). + pub immich_out: Vec<(String, String, bool)>, /// Each shared collection's photos as the catalogue had them when last looked at. pub base: HashMap>, /// The photos this device should hold more of than it does. @@ -669,6 +674,8 @@ pub(crate) fn ensure_lib(s: &mut Session) { ids: HashMap::new(), alias: HashMap::new(), hints: HashMap::new(), + immich_here: BTreeSet::new(), + immich_out: Vec::new(), base: HashMap::new(), wanting: BTreeSet::new(), missing: HashMap::new(), diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 9521136218..25068c99cc 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -204,6 +204,7 @@ fn cancel_pairing_without_a_pairing_is_harmless() { /// A session with a sync identity and its catalogue's replica loaded, without starting the service. fn offline(dir: &std::path::Path, name: &str) -> (Session, lcc_peer::Peer) { let mut s = Session::new().with_fs(); + s.set_secret_store(std::sync::Arc::new(crate::remote::MemorySecrets::default())); let store = dir.join(format!("{name}.json")); let st = lcc_peer::Store::load_or_create(&store, name).unwrap(); st.save(&store).unwrap(); @@ -515,3 +516,116 @@ fn importing_the_original_of_a_link_only_photo_keeps_one_photo() { assert!(s.catalog.albums().any(|a| a.name == "Import" && a.photos == vec![keep])); let _ = std::fs::remove_dir_all(&dir); } + +// ── Immich albums as collections ────────────────────────────────────────────────────────────── + +/// Pumps both sessions' remote work (Immich workers) and the exchanges between them until `done`. +fn pump_both(a: &mut Session, ap: &lcc_peer::Peer, b: &mut Session, bp: &lcc_peer::Peer, what: &str, done: impl Fn(&Session, &Session) -> bool) { + let t = Instant::now(); + while !done(a, b) { + for s in [&mut *a, &mut *b] { + s.execute("remote.pump", &json!({"sync": false})).unwrap(); + } + swap(a, ap, b, bp); + assert!(t.elapsed() < Duration::from_secs(30), "timed out waiting for {what}"); + std::thread::sleep(Duration::from_millis(10)); + } +} + +fn immich_collection<'a>(v: &'a Value, name: &str) -> Option<&'a Value> { + v["catalogue"]["collections"].as_array()?.iter().find(|c| c["name"] == name && c["immich"] == true) +} + +fn album_photos(s: &Session, name: &str) -> Vec { + s.catalog.albums().find(|a| a.name == name && !a.folder).map(|a| a.photos.clone()).unwrap_or_default() +} + +/// Two devices with the same Immich account: its album is one collection under "Immich" on both; +/// each takes what it chose (link-only previews, originals, nothing); the photo has one key and +/// its edits travel; a photo added on either device is uploaded once. +#[test] +fn immich_albums_are_collections_each_device_takes_as_it_chose() { + use crate::tests_immich::sync_tests::{Server, serve_state}; + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-immich-colls"); + let x = crate::tests_immich::png(50); + let mut server = Server::default(); + server.real_uploads = true; + server.check_checksums = true; + server.assets.push(crate::tests_immich::asset("as-1", "beach.png", &x, json!({"visibility": "timeline"}))); + server.bytes.insert("as-1".into(), x.clone()); + server.albums.push(("al-1".into(), "Holiday".into(), vec!["as-1".into()])); + let state = std::sync::Arc::new(std::sync::Mutex::new(server)); + let url = serve_state(state.clone(), Default::default(), Default::default()); + let (mut a, ap) = offline(&dir, "a"); + let (mut b, bp) = offline(&dir, "b"); + for s in [&mut a, &mut b] { + assert_eq!(s.execute("immich.connect", &json!({"url": url, "apiKey": crate::tests_immich::KEY})).unwrap()["ok"], true); + } + offline_group(&mut a, &ap, &mut b, &bp); + for s in [&mut a, &mut b] { + s.execute("immich.collections", &json!({"on": true})).unwrap(); + s.execute("sync.immichRefresh", &json!({})).unwrap(); + } + pump_both(&mut a, &ap, &mut b, &bp, "the album as a collection", |a, b| { + let names = |s: &Session| s.device_sync.lib.as_ref().is_some_and(|l| l.replica.collections.values().any(|e| e.c.is_immich() && e.c.meta.v.name == "Holiday")); + names(a) && names(b) + }); + let v = status(&mut a); + let c = immich_collection(&v, "Holiday").unwrap().clone(); + assert_eq!(c["photos"], 1, "{c}"); + assert_eq!(a.catalog.photos().count(), 0, "nothing comes before it is taken"); + a.execute("sync.take", &json!({"collection": c["id"], "take": "previews"})).unwrap(); + b.execute("sync.take", &json!({"collection": c["id"], "take": "fullQuality"})).unwrap(); + assert!(a.execute("sync.take", &json!({"collection": c["id"], "take": "fullSync"})).is_err(), "Immich albums go up to full quality"); + for s in [&mut a, &mut b] { + s.execute("sync.immichRefresh", &json!({})).unwrap(); + } + pump_both(&mut a, &ap, &mut b, &bp, "the photo on both", |a, b| album_photos(a, "Holiday").len() == 1 && album_photos(b, "Holiday").len() == 1); + let pa = a.catalog.photo(album_photos(&a, "Holiday")[0]).unwrap().clone(); + let pb = b.catalog.photo(album_photos(&b, "Holiday")[0]).unwrap().clone(); + assert_eq!(pa.preview_only.as_deref(), Some(crate::remote::LINK_ONLY), "previews: a link-only photo"); + assert_eq!(pb.preview_only, None, "full quality: the original"); + assert_eq!(key_of(&a, pa.id.0), key_of(&b, pb.id.0)); + for s in [&a, &b] { + let folder = s.catalog.albums().find(|al| al.folder && al.name == "Immich").expect("an Immich set"); + assert!(s.catalog.albums().any(|al| al.name == "Holiday" && al.parent == Some(folder.id))); + assert_eq!(s.catalog.photos().count(), 1); + } + // the record travels between the devices + a.execute("photo.rate", &json!({"ids": [pa.id.0], "rating": 4})).unwrap(); + swap(&mut a, &ap, &mut b, &bp); + assert_eq!(b.catalog.photo(pb.id).unwrap().rating, 4); + + // the same new photo added on both devices: uploaded once, then in the album + let y = dir.join("new.png"); + std::fs::write(&y, crate::tests_immich::png(51)).unwrap(); + for s in [&mut a, &mut b] { + let id = s.execute("library.import", &json!({"paths": [y.to_string_lossy()]})).unwrap()["imported"][0].as_u64().unwrap(); + let al = s.catalog.albums().find(|al| al.name == "Holiday" && !al.folder).unwrap().id.0; + s.selection = crate::Selection::single(lcc_catalog::PhotoId(id)); + s.execute("album.addPhotos", &json!({"id": al, "ids": [id]})).unwrap(); + let t = Instant::now(); + let pid = lcc_catalog::PhotoId(id); + while !s.catalog.remote_of(pid).any(|r| r.service == "immich") || s.remote.coll.pushing { + let mut l = s.device_sync.lib.take().unwrap(); + super::catalog::scan(s, &mut l); + s.device_sync.lib = Some(l); + s.execute("remote.pump", &json!({"sync": false})).unwrap(); + assert!(t.elapsed() < Duration::from_secs(20), "timed out uploading"); + std::thread::sleep(Duration::from_millis(10)); + } + } + let st = state.lock().unwrap(); + assert_eq!(st.uploads, 1, "the second device found it by checksum"); + assert_eq!(st.albums[0].2.len(), 2); + drop(st); + for s in [&a, &b] { + let p = s.catalog.photos().find(|p| p.file_name == "new.png").unwrap(); + assert!(s.catalog.remote_of(p.id).any(|r| r.service == "immich"), "linked to the one asset"); + } + // taking nothing removes the collection from the catalogue; its photos stay + a.execute("sync.take", &json!({"collection": c["id"], "take": "none"})).unwrap(); + assert!(album_photos(&a, "Holiday").is_empty() && !a.catalog.albums().any(|al| al.name == "Holiday")); + assert_eq!(a.catalog.photos().count(), 2); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/engine/src/remote.rs b/crates/engine/src/remote.rs index d2d238284e..56cae3a764 100644 --- a/crates/engine/src/remote.rs +++ b/crates/engine/src/remote.rs @@ -64,6 +64,11 @@ pub(crate) enum Msg { AlbumsSynced(Box), /// `immich.pullSidecars` / `immich.pushSidecars` {background}: a sidecar run finished. Sidecars(Box), + /// The Immich albums shown as collections were listed (device sync). + ImmichAlbums(Box), + /// Photos added to Immich collections here were uploaded (or found) and put into the albums. + ImmichPushed(Box), + ImmichPushDone, /// `credentials.unlock {background}`: the encrypted file opened (or not). FileUnlocked(Result), /// `credentials.unlockSystem`: the keychain's own unlock prompt was answered. @@ -311,6 +316,8 @@ pub struct State { pub(crate) sidecars: SidecarProgress, /// Finished Edit In version uploads not yet shown (`immich.versionResults`). pub(crate) versions: Vec, + /// Immich albums as device-sync collections: workers and schedule. + pub(crate) coll: crate::cmd::immich::collections::CollState, } impl Default for State { @@ -322,6 +329,7 @@ impl Default for State { sha1_busy: false, sha1_failed: HashSet::new(), sha1_first: Default::default(), + coll: Default::default(), sha1_done: 0, sha1_idle_at: None, connections_path: None, diff --git a/crates/engine/src/tests_immich.rs b/crates/engine/src/tests_immich.rs index 8eaa063d41..8f9d62e5d7 100644 --- a/crates/engine/src/tests_immich.rs +++ b/crates/engine/src/tests_immich.rs @@ -14,7 +14,7 @@ use serde_json::{Value, json}; use crate::Session; use crate::remote::{LINK_ONLY, MemorySecrets}; -const KEY: &str = "engine-test-key-42"; +pub(crate) const KEY: &str = "engine-test-key-42"; /// A folder in Temp that stays (the sync tests keep its path in their `Setup`). fn temp_dir(tag: &str) -> PathBuf { @@ -29,7 +29,7 @@ fn scratch(tag: &str) -> lcc_testkit::TempDir { lcc_testkit::TempDir::new(&format!("lcc-immich-{tag}")) } -fn png(seed: u8) -> Vec { +pub(crate) fn png(seed: u8) -> Vec { let (w, h) = (40usize, 30usize); let data: Vec<[u8; 4]> = (0..w * h).map(|i| [(i % w * 5) as u8, (i / w * 7) as u8, seed, 255]).collect(); let img = lcc_raster::Rgba8 { width: w, height: h, data }; @@ -204,7 +204,7 @@ fn serve(fake: Fake) -> (String, Arc>>) { (format!("http://127.0.0.1:{port}"), seen) } -fn asset(id: &str, name: &str, bytes: &[u8], extra: Value) -> Value { +pub(crate) fn asset(id: &str, name: &str, bytes: &[u8], extra: Value) -> Value { let mut a = json!({ "id": id, "type": "IMAGE", @@ -842,4 +842,4 @@ fn pulling_sidecars_needs_a_server_that_lists_them() { } #[path = "tests_immich_sync.rs"] -mod sync_tests; +pub(crate) mod sync_tests; diff --git a/crates/engine/src/tests_immich_sync.rs b/crates/engine/src/tests_immich_sync.rs index 0f348dced1..5ee610fef0 100644 --- a/crates/engine/src/tests_immich_sync.rs +++ b/crates/engine/src/tests_immich_sync.rs @@ -6,17 +6,21 @@ use std::sync::atomic::{AtomicBool, AtomicU32, Ordering}; use super::*; #[derive(Default)] -struct Server { - assets: Vec, +pub(crate) struct Server { + /// Asset id → its bytes (`/assets/{id}/original` and `/thumbnail`). + pub(crate) bytes: std::collections::HashMap>, + /// Uploads keep their bytes and the SHA-1 of them as checksum (as a real server does). + pub(crate) real_uploads: bool, + pub(crate) assets: Vec, faces: Vec<(String, Value)>, people: Vec, renamed: Vec, merged: Vec, clock: u32, /// (id, name, asset ids) - albums: Vec<(String, String, Vec)>, + pub(crate) albums: Vec<(String, String, Vec)>, stacks: Vec>, - uploads: u32, + pub(crate) uploads: u32, /// Uploads whose multipart body carried a `sidecarData` part (IMM-SIDECARS). sidecar_uploads: u32, /// Asset id → the XMP sidecar the server holds for it. @@ -33,7 +37,7 @@ struct Server { /// `POST /assets/bulk-upload-check` answers like a real server: a checksum it has is rejected /// as a duplicate, with the asset's id. (Off by default: the publish tests upload files the /// server "has" and count on every upload being accepted.) - check_checksums: bool, + pub(crate) check_checksums: bool, } impl Server { @@ -46,9 +50,9 @@ impl Server { } } -type Shared = Arc>; +pub(crate) type Shared = Arc>; -fn serve_state(state: Shared, down: Arc, hits: Arc) -> String { +pub(crate) fn serve_state(state: Shared, down: Arc, hits: Arc) -> String { let listener = TcpListener::bind("127.0.0.1:0").unwrap(); let port = listener.local_addr().unwrap().port(); std::thread::spawn(move || { @@ -74,6 +78,17 @@ fn sidecar_part(body: &[u8]) -> Option { Some(rest[..end].to_string()) } +/// The bytes of the `assetData` part of a multipart upload. +fn file_part(body: &[u8]) -> Option> { + let marker = b"name=\"assetData\""; + let i = body.windows(marker.len()).position(|w| w == marker)?; + let after = body.get(i..)?; + let start = after.windows(4).position(|w| w == b"\r\n\r\n")? + 4; + let rest = after.get(start..)?; + let end = rest.windows(4).position(|w| w == b"\r\n--")?; + rest.get(..end).map(<[u8]>::to_vec) +} + fn handle(state: &Shared, down: &AtomicBool, m: &str, t: &str, key: Option<&str>, body: &[u8]) -> Vec { let json = |v: Value| resp("200 OK", "application/json", v.to_string().as_bytes()); let not_found = || resp("404 Not Found", "application/json", b"{}"); @@ -97,7 +112,7 @@ fn handle(state: &Shared, down: &AtomicBool, m: &str, t: &str, key: Option<&str> let album: Option> = b["albumIds"][0].as_str().map(|a| st.albums.iter().find(|x| x.0 == a).map(|x| x.2.clone()).unwrap_or_default()); let items: Vec = if let Some(ids) = album { - ids.iter().map(|i| json!({"id": i})).collect() + ids.iter().map(|i| st.assets.iter().find(|a| a["id"] == i.as_str()).cloned().unwrap_or_else(|| json!({"id": i}))).collect() } else if b["page"].as_u64().unwrap_or(1) == 1 { st.assets.iter().filter(|a| a["updatedAt"].as_str().unwrap_or("") > after).cloned().collect() } else { @@ -137,7 +152,14 @@ fn handle(state: &Shared, down: &AtomicBool, m: &str, t: &str, key: Option<&str> } // like the real server, the asset remembers the uploading device (`deviceId` form field) let device = text.split("name=\"deviceId\"").nth(1).and_then(|x| x.trim_start().lines().next()).unwrap_or("").trim().to_string(); - st.assets.push(json!({"id": id, "type": "IMAGE", "deviceId": device, "originalFileName": name, "updatedAt": now, "checksum": format!("name:{name}"), "exifInfo": {}, "tags": []})); + let mut checksum = format!("name:{name}"); + if st.real_uploads + && let Some(data) = file_part(body) + { + checksum = lcc_hash::sha1_bytes(&data).to_base64(); + st.bytes.insert(id.clone(), data); + } + st.assets.push(json!({"id": id, "type": "IMAGE", "deviceId": device, "originalFileName": name, "updatedAt": now, "checksum": checksum, "exifInfo": {}, "tags": []})); resp("201 Created", "application/json", json!({"id": id, "status": "created"}).to_string().as_bytes()) } ("POST", "/api/assets/bulk-upload-check") => { @@ -308,6 +330,13 @@ fn handle(state: &Shared, down: &AtomicBool, m: &str, t: &str, key: Option<&str> st.merged.push(p.to_string()); json(json!([])) } + ("GET", p) if p.starts_with("/api/assets/") && (p.ends_with("/original") || p.ends_with("/thumbnail")) => { + let id = p.trim_start_matches("/api/assets/").split('/').next().unwrap_or_default(); + match st.bytes.get(id) { + Some(b) => resp("200 OK", "image/png", b), + None => not_found(), + } + } (_, p) if p.starts_with("/api/assets/") => { let id = p.trim_start_matches("/api/assets/").to_string(); if m == "PUT" && st.fail_update.contains(&id) { diff --git a/crates/immich/src/accounts.rs b/crates/immich/src/accounts.rs index d74a4de2ca..6966d29236 100644 --- a/crates/immich/src/accounts.rs +++ b/crates/immich/src/accounts.rs @@ -32,6 +32,13 @@ pub struct Account { /// (`/Immich/link/.json`); old files still parse. #[serde(skip_serializing)] pub linked_until: Option, + /// Its albums show as collections in device sync (under a collection set "Immich"). + #[serde(skip_serializing_if = "std::ops::Not::not")] + pub collections: bool, + /// The connection is shared with the devices this catalog syncs with (its key travels to + /// them over the encrypted peer channel); otherwise it stays on this device. + #[serde(skip_serializing_if = "std::ops::Not::not")] + pub shared: bool, /// Two-way metadata sync settings (IMM-SYNC). #[serde(skip_serializing_if = "is_default_sync")] pub sync: crate::sync::SyncConfig, @@ -78,6 +85,9 @@ impl Accounts { if is_default_sync(&a.sync) { a.sync = std::mem::take(&mut old.sync); } + // (connecting again keeps how the account is shown and shared) + a.collections |= old.collections; + a.shared |= old.shared; *old = a; } else { self.immich.push(a); diff --git a/crates/immich/src/publish.rs b/crates/immich/src/publish.rs index b9dee0ec85..2001a0a4a0 100644 --- a/crates/immich/src/publish.rs +++ b/crates/immich/src/publish.rs @@ -99,7 +99,8 @@ fn err(e: ImmichError) -> PublishError { } } -fn mime_of(name: &str) -> &'static str { +/// The media type an upload of a file called `name` is sent as. +pub fn mime_of(name: &str) -> &'static str { let ext = name.rsplit('.').next().unwrap_or_default().to_ascii_lowercase(); match ext.as_str() { "jpg" | "jpeg" => "image/jpeg", diff --git a/crates/sync/src/replica.rs b/crates/sync/src/replica.rs index 46bc59b7b0..a380323638 100644 --- a/crates/sync/src/replica.rs +++ b/crates/sync/src/replica.rs @@ -447,6 +447,20 @@ impl Replica { } } + /// An Immich album was removed on the server (or is back): any device with the account says so. + pub fn set_immich_gone(&mut self, id: &str, gone: bool, now_ms: u64) -> Result { + self.edit_collection(id, now_ms, |c, s, _| { + if !c.is_immich() { + return Err(Refused::NotOwner); + } + let changed = c.deleted.v != gone; + if changed { + c.deleted = Lww::new(gone, s); + } + Ok(changed) + }) + } + /// Whether collection `c` is an Immich one this device keeps to itself. pub fn is_private(&self, c: &Collection) -> bool { c.is_immich() && c.immich.as_ref().is_some_and(|r| self.private_immich.contains(&r.account)) From 8934741f3bee0d4668a62016320480df3594bb68 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 12:54:31 +1100 Subject: [PATCH 10/15] SYNC-IMMICH: Settings UI, docs, manual and notes for Immich collections Manual: sync/devices, sync/immich Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/immich.rs | 2 ++ crates/engine/src/device_sync/mod.rs | 4 ++- crates/immich/src/tests.rs | 2 ++ crates/sync/src/model.rs | 9 +++++-- crates/ui-egui/locales/fork/cs.json | 6 +++++ crates/ui-egui/locales/fork/de.json | 6 +++++ crates/ui-egui/locales/fork/es.json | 6 +++++ crates/ui-egui/locales/fork/fi.json | 6 +++++ crates/ui-egui/locales/fork/fr.json | 6 +++++ crates/ui-egui/locales/fork/id.json | 6 +++++ crates/ui-egui/locales/fork/it.json | 6 +++++ crates/ui-egui/locales/fork/ja.json | 6 +++++ crates/ui-egui/locales/fork/ka.json | 6 +++++ crates/ui-egui/locales/fork/pl.json | 6 +++++ crates/ui-egui/locales/fork/pt-br.json | 6 +++++ crates/ui-egui/locales/fork/ru.json | 6 +++++ crates/ui-egui/locales/fork/sv.json | 6 +++++ crates/ui-egui/locales/fork/uk.json | 6 +++++ crates/ui-egui/locales/fork/vi.json | 6 +++++ crates/ui-egui/locales/fork/zh-hans.json | 6 +++++ crates/ui-egui/locales/fork/zh-hant.json | 6 +++++ crates/ui-egui/src/panels/connections.rs | 27 +++++++++++++++++++ crates/ui-egui/src/panels/peer_sync.rs | 23 +++++++++++++++- .../2026-11-15-immich-collections.md | 1 + docs/immich.md | 7 +++++ .../src/content/docs/sync/devices.mdx | 10 ++++++- .../src/content/docs/sync/immich.mdx | 1 + docs/sync.md | 25 ++++++++++++++++- .../2026-11-15-immich-collections.md | 5 +++- 29 files changed, 211 insertions(+), 7 deletions(-) diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index fe69705ee8..0bcf9bb501 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -110,6 +110,8 @@ fn account_json(s: &Session, a: &Account) -> Value { "permissions": a.permissions, "missingPermissions": missing.iter().map(|(f, p)| json!({"feature": f, "permissions": p})).collect::>(), "pinned": a.pinned, + "collections": a.collections, + "shared": a.shared, "pathMaps": a.path_maps, "linked": linked, "probable": probable, diff --git a/crates/engine/src/device_sync/mod.rs b/crates/engine/src/device_sync/mod.rs index 8d78df5226..4ce0fa8d81 100644 --- a/crates/engine/src/device_sync/mod.rs +++ b/crates/engine/src/device_sync/mod.rs @@ -432,7 +432,9 @@ fn catalogue_status(s: &Session, online: &HashSet, paired: &[lcc_peer::P "immich": c.is_immich(), "grant": c.grant.v, "take": c.take_of(me), - "most": c.grant.v.most(), + // (an Immich album is taken up to full quality: its files come from the server) + "most": if c.is_immich() { c.grant.v.most().min(Take::FullQuality) } else { c.grant.v.most() }, + "private": r.is_private(c), "takes": takes, "photos": r.members_of(id).count(), "letters": format!("{}{}", location.letter(), depth.letter()), diff --git a/crates/immich/src/tests.rs b/crates/immich/src/tests.rs index 3e19bef9d6..56049915fe 100644 --- a/crates/immich/src/tests.rs +++ b/crates/immich/src/tests.rs @@ -759,6 +759,8 @@ fn damaged_connections_file_never_panics() { pinned: None, path_maps: vec![PathMap { container: "/usr/src/app/upload".into(), local: "/pics".into() }], linked_until: None, + collections: true, + shared: true, sync: Default::default(), }); a.save(&path).unwrap(); diff --git a/crates/sync/src/model.rs b/crates/sync/src/model.rs index 0906bb86a3..8d17717b38 100644 --- a/crates/sync/src/model.rs +++ b/crates/sync/src/model.rs @@ -257,8 +257,11 @@ impl Collection { None => {} } } - if self.immich.is_none() && other.immich.is_some() { - self.immich = other.immich.clone(); + let ok = |s: &str| s.len() <= 128 && !s.chars().any(char::is_control); + if self.immich.is_none() + && let Some(r) = other.immich.as_ref().filter(|r| ok(&r.account) && ok(&r.album) && !r.account.is_empty()) + { + self.immich = Some(r.clone()); changed = true; } changed @@ -408,8 +411,10 @@ mod tests { other.takes.insert(format!("d{i}"), Lww::new(Take::FullSync, Stamp { t: 9, c: 0, d: 0 })); } other.meta = Lww::new(CollectionMeta { name: "x\u{0}".repeat(5000), parent: None }, Stamp { t: 9, c: 0, d: 0 }); + other.immich = Some(ImmichRef { account: "u".repeat(10_000), album: "a\u{0}".into() }); c.merge(&other); assert!(c.takes.len() <= MAX_DEVICES); + assert!(c.immich.is_none(), "an oversized Immich reference is dropped"); assert!(c.meta.v.name.chars().count() <= MAX_NAME && !c.meta.v.name.contains('\u{0}')); } } diff --git a/crates/ui-egui/locales/fork/cs.json b/crates/ui-egui/locales/fork/cs.json index b0a5cbdb62..776f318a83 100644 --- a/crates/ui-egui/locales/fork/cs.json +++ b/crates/ui-egui/locales/fork/cs.json @@ -130,6 +130,7 @@ "Agree and Generate": "Souhlasit a generovat", "Album name (blank: the collection title)": "Název alba (prázdné: název kolekce)", "Albums deleted on one side ({})": "Alba odstraněná na jedné straně ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Alba na vašem serveru Immich: zvolte, co si z každého toto zařízení ponechá.", "Albums ↔ albums": "Alba ↔ alba", "Albums: {}": "Alba: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Alba: propojeno {}, vytvořeno {}, přejmenováno {}, změněno {}, odstraněno {}", @@ -417,6 +418,7 @@ "Choose a plug-in module (.wasm) first": "Nejprve vyberte soubor zásuvného modulu (.wasm)", "Choose a preset…": "Vybrat přednastavení…", "Choose folder later": "Vybrat složku později", + "Choose in Sync…": "Vybrat v Synchronizaci…", "Choose the catalog to open.": "Vyberte katalog, který chcete otevřít.", "Choose where to import from": "Vyberte, odkud importovat", "City contains": "Město obsahuje", @@ -770,6 +772,7 @@ "Duplicates": "Duplikáty", "Duration (seconds)": "Délka (sekundy)", "E: every device keeps the original and can add photos": "E: každé zařízení uchovává originál a může přidávat fotky", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Každé album je sbírkou v sadě Immich; v Nastavení ▸ Synchronizace každé zařízení volí Nic, Náhledy nebo Plnou kvalitu.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Každé zařízení má vlastní katalog a vidí jen kolekce, které smí a chce převzít.", "Each of the {n} selected photos gets the reference that fits it": "Každá z {n} vybraných fotografií dostane referenci, která jí odpovídá", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Ostřejší oko každé osoby ve 100 % přes horní okraj lupy. Přepíná ho i lišta rychlých nastavení (najeďte ukazatelem na prázdné místo vedle názvů modulů).", @@ -2011,6 +2014,7 @@ "Preview in Browser…": "Náhled v prohlížeči…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Náhled: zkontrolováno {}, z Immich {}, do Immich {}, konfliktů {}", "Previewing the Immich sync": "Náhled synchronizace Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Náhledy z Immich k vyvolání zde; úpravy jdou na vaše další zařízení.", "Previews to develop here; edits go back.": "Náhledy k vyvolání zde; úpravy se vracejí.", "Previous": "Předchozí", "Previous / Next Page": "Předchozí / další stránka", @@ -2497,6 +2501,7 @@ "Show HSL Color Values": "Zobrazit hodnoty barev HSL", "Show Header Bar": "Zobrazit záhlaví", "Show Hidden Favorites": "Zobrazit skryté oblíbené", + "Show Immich albums as collections": "Zobrazit alba Immich jako sbírky", "Show Import Tab Settings": "Zobrazit nastavení karty Import", "Show Index Numbers": "Zobrazit pořadová čísla", "Show Info Card": "Zobrazit informační kartu", @@ -2759,6 +2764,7 @@ "The key needs asset.read, asset.view and asset.download to link and import, album.read and person.read to browse, library.read for external libraries. It is kept in the key storage above, never in settings.": "Klíč potřebuje asset.read, asset.view a asset.download pro propojení a import, album.read a person.read pro procházení a library.read pro externí knihovny. Uchovává se v úložišti klíčů výše, nikdy v nastavení.", "The mask's effect on / off": "Účinek masky zapnout / vypnout", "The new reference covers its image area too.": "Nová reference pokrývá i její obrazovou plochu.", + "The originals come from Immich; edits go to your other devices.": "Originály přicházejí z Immich; úpravy jdou na vaše další zařízení.", "The originals come here; edits go back.": "Originály přicházejí sem; úpravy se vracejí.", "The originals, and photos added here go to the other devices.": "Originály, a fotky přidané zde jdou do ostatních zařízení.", "The passphrases differ.": "Hesla se liší.", diff --git a/crates/ui-egui/locales/fork/de.json b/crates/ui-egui/locales/fork/de.json index 713cd08824..b2c6290717 100644 --- a/crates/ui-egui/locales/fork/de.json +++ b/crates/ui-egui/locales/fork/de.json @@ -119,6 +119,7 @@ "After the Import": "Nach dem Import", "Album name (blank: the collection title)": "Albumname (leer: der Titel der Sammlung)", "Albums deleted on one side ({})": "Auf einer Seite gelöschte Alben ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Alben auf deinem Immich-Server: Wähle, was dieses Gerät von jedem behält.", "Albums ↔ albums": "Alben ↔ Alben", "Albums: {}": "Alben: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Alben: {} verknüpft, {} angelegt, {} umbenannt, {} geändert, {} gelöscht", @@ -403,6 +404,7 @@ "Choose a plug-in module (.wasm) first": "Wählen Sie zuerst ein Zusatzmodul (.wasm)", "Choose a preset…": "Vorgabe wählen…", "Choose folder later": "Ordner später auswählen", + "Choose in Sync…": "In Synchronisierung wählen …", "Choose the catalog to open.": "Wählen Sie den Katalog zum Öffnen.", "Choose where to import from": "Importquelle wählen", "City contains": "Stadt enthält", @@ -739,6 +741,7 @@ "Duration": "Dauer", "Duration (seconds)": "Dauer (Sekunden)", "E: every device keeps the original and can add photos": "E: Jedes Gerät behält das Original und kann Fotos hinzufügen", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Jedes Album ist eine Sammlung im Satz „Immich“; unter Einstellungen ▸ Synchronisierung wählt jedes Gerät Keine, Vorschauen oder Volle Qualität.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Jedes Gerät behält seinen eigenen Katalog und sieht nur die Sammlungen, die es übernehmen darf und will.", "Each of the {n} selected photos gets the reference that fits it": "Jedes der {n} ausgewählten Fotos erhält die Referenz, die zu ihm passt", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Das schärfere Auge jeder Person bei 100 % oben in der Lupe. Die Schnelleinstellungsleiste (Zeiger auf die freie Fläche neben den Modulnamen) schaltet sie ebenfalls.", @@ -1915,6 +1918,7 @@ "Preview in Browser…": "Vorschau im Browser …", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Vorschau: {} geprüft, {} von Immich, {} zu Immich, {} Konflikte", "Previewing the Immich sync": "Vorschau der Immich-Synchronisierung", + "Previews from Immich to develop here; edits go to your other devices.": "Vorschauen von Immich zum Entwickeln hier; Bearbeitungen gehen an deine anderen Geräte.", "Previews to develop here; edits go back.": "Vorschauen zum Entwickeln hier; Bearbeitungen gehen zurück.", "Previous": "Vorherige", "Previous / Next Page": "Vorherige/Nächste Seite", @@ -2369,6 +2373,7 @@ "Show HSL Color Values": "HSL-Farbwerte anzeigen", "Show Header Bar": "Kopfleiste anzeigen", "Show Hidden Favorites": "Ausgeblendete Favoriten anzeigen", + "Show Immich albums as collections": "Immich-Alben als Sammlungen zeigen", "Show Import Tab Settings": "Einstellungen des Import-Registers anzeigen", "Show Index Numbers": "Indexnummern anzeigen", "Show Info Card": "Infokarte anzeigen", @@ -2630,6 +2635,7 @@ "The mask's effect on / off": "Wirkung der Maske an / aus", "The model is kept on this computer only. {app} never uploads or shares it.": "Das Modell bleibt nur auf diesem Computer. {app} lädt es nie hoch und gibt es nie weiter.", "The new reference covers its image area too.": "Die neue Referenz deckt auch ihren Bildbereich ab.", + "The originals come from Immich; edits go to your other devices.": "Die Originale kommen von Immich; Bearbeitungen gehen an deine anderen Geräte.", "The originals come here; edits go back.": "Die Originale kommen hierher; Bearbeitungen gehen zurück.", "The originals, and photos added here go to the other devices.": "Die Originale, und hier hinzugefügte Fotos gehen an die anderen Geräte.", "The passphrases differ.": "Die Passphrasen stimmen nicht überein.", diff --git a/crates/ui-egui/locales/fork/es.json b/crates/ui-egui/locales/fork/es.json index 7e6456f619..c3d8c77bed 100644 --- a/crates/ui-egui/locales/fork/es.json +++ b/crates/ui-egui/locales/fork/es.json @@ -137,6 +137,7 @@ "After the Import": "Después de la importación", "Album name (blank: the collection title)": "Nombre del álbum (vacío: el título de la colección)", "Albums deleted on one side ({})": "Álbumes eliminados en un lado ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Álbumes de tu servidor Immich: elige qué guarda este dispositivo de cada uno.", "Albums ↔ albums": "Álbumes ↔ álbumes", "Albums: {}": "Álbumes: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Álbumes: {} vinculados, {} creados, {} renombrados, {} cambiados, {} eliminados", @@ -443,6 +444,7 @@ "Choose a preset…": "Elegir un ajuste preestablecido…", "Choose at least one setting to include": "Elige al menos un ajuste para incluir", "Choose folder later": "Elegir carpeta más tarde", + "Choose in Sync…": "Elegir en Sincronización…", "Choose the catalog to open.": "Elige el catálogo que abrir.", "Choose where to import from": "Elija desde dónde importar", "City contains": "La ciudad contiene", @@ -811,6 +813,7 @@ "Duration": "Duración", "Duration (seconds)": "Duración (segundos)", "E: every device keeps the original and can add photos": "E: cada dispositivo conserva el original y puede añadir fotos", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Cada álbum es una colección del conjunto Immich; en Ajustes ▸ Sincronización cada dispositivo elige Nada, Vistas previas o Calidad completa.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Cada dispositivo conserva su propio catálogo y solo ve las colecciones que puede y elige tomar.", "Each of the {n} selected photos gets the reference that fits it": "Cada una de las {n} fotos seleccionadas recibe la referencia que le corresponde", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "El ojo más nítido de cada persona al 100 % en la parte superior de la lupa. La barra de ajustes rápidos (señale el espacio junto a los nombres de los módulos) también la activa.", @@ -2084,6 +2087,7 @@ "Preview in Browser…": "Previsualizar en el navegador…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Vista previa: {} revisados, {} desde Immich, {} hacia Immich, {} conflictos", "Previewing the Immich sync": "Vista previa de la sincronización con Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Vistas previas de Immich para revelar aquí; las ediciones van a tus otros dispositivos.", "Previews to develop here; edits go back.": "Vistas previas para revelar aquí; las ediciones vuelven.", "Previous": "Anterior", "Previous / Next Page": "Página anterior/siguiente", @@ -2592,6 +2596,7 @@ "Show HSL Color Values": "Mostrar valores de color HSL", "Show Header Bar": "Mostrar barra de encabezado", "Show Hidden Favorites": "Mostrar favoritos ocultos", + "Show Immich albums as collections": "Mostrar los álbumes de Immich como colecciones", "Show Import Tab Settings": "Mostrar ajustes de la pestaña Importar", "Show Index Numbers": "Mostrar números de índice", "Show Info Card": "Mostrar tarjeta de información", @@ -2878,6 +2883,7 @@ "The mask's effect on / off": "Efecto de la máscara activado / desactivado", "The model is kept on this computer only. {app} never uploads or shares it.": "El modelo se guarda solo en este equipo. {app} nunca lo sube ni lo comparte.", "The new reference covers its image area too.": "La nueva referencia también cubre su área de imagen.", + "The originals come from Immich; edits go to your other devices.": "Los originales vienen de Immich; las ediciones van a tus otros dispositivos.", "The originals come here; edits go back.": "Los originales vienen aquí; las ediciones vuelven.", "The originals, and photos added here go to the other devices.": "Los originales, y las fotos añadidas aquí van a los demás dispositivos.", "The passphrases differ.": "Las frases de contraseña no coinciden.", diff --git a/crates/ui-egui/locales/fork/fi.json b/crates/ui-egui/locales/fork/fi.json index 2fc7085a38..f6784e3b1b 100644 --- a/crates/ui-egui/locales/fork/fi.json +++ b/crates/ui-egui/locales/fork/fi.json @@ -141,6 +141,7 @@ "Agree and Generate": "Hyväksy ja luo", "Album name (blank: the collection title)": "Albumin nimi (tyhjä: kokoelman otsikko)", "Albums deleted on one side ({})": "Toisella puolella poistetut albumit ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Immich-palvelimesi albumit: valitse, mitä tämä laite pitää kustakin.", "Albums ↔ albums": "Albumit ↔ albumit", "Albums: {}": "Albumit: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Albumit: {} linkitetty, {} luotu, {} nimetty uudelleen, {} muutettu, {} poistettu", @@ -441,6 +442,7 @@ "Choose a plug-in module (.wasm) first": "Valitse ensin laajennusmoduuli (.wasm)", "Choose a preset…": "Valitse esiasetus…", "Choose folder later": "Valitse kansio myöhemmin", + "Choose in Sync…": "Valitse Synkronoinnissa…", "Choose the catalog to open.": "Valitse avattava katalogi.", "Choose where to import from": "Valitse, mistä tuodaan", "Chroma": "Kroma", @@ -819,6 +821,7 @@ "Duplicates": "Kaksoiskappaleet", "Duration (seconds)": "Kesto (sekuntia)", "E: every device keeps the original and can add photos": "E: jokainen laite säilyttää alkuperäisen ja voi lisätä kuvia", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Jokainen albumi on kokoelma Immich-joukossa; kohdassa Asetukset ▸ Synkronointi kukin laite valitsee Ei mitään, Esikatselut tai Täysi laatu.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Jokainen laite säilyttää oman katalogin ja näkee vain kokoelmat, jotka se saa ja valitsee ottaa.", "Each of the {n} selected photos gets the reference that fits it": "Jokainen {n} valitusta kuvasta saa siihen sopivan viitekuvan", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Kunkin henkilön terävämpi silmä 100 %:ssa luupin yläreunassa. Myös pika-asetusten palkki (osoita moduulien nimien vieressä olevaa tyhjää kohtaa) kytkee sen.", @@ -2119,6 +2122,7 @@ "Preview in Browser…": "Esikatsele selaimessa…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Esikatselu: {} tarkistettu, {} Immichistä, {} Immichiin, {} ristiriitaa", "Previewing the Immich sync": "Esikatsellaan Immich-synkronointia", + "Previews from Immich to develop here; edits go to your other devices.": "Esikatselut Immichistä kehitettäviksi täällä; muokkaukset menevät muille laitteillesi.", "Previews to develop here; edits go back.": "Esikatselukuvat kehitettäviksi täällä; muokkaukset palaavat.", "Previous": "Edellinen", "Previous / Next Page": "Edellinen/seuraava sivu", @@ -2664,6 +2668,7 @@ "Show HSL Color Values": "Näytä HSL-väriarvot", "Show Header Bar": "Näytä otsikkopalkki", "Show Hidden Favorites": "Näytä piilotetut suosikit", + "Show Immich albums as collections": "Näytä Immich-albumit kokoelmina", "Show Import Tab Settings": "Näytä Tuo-välilehden asetukset", "Show Index Numbers": "Näytä järjestysnumerot", "Show Info Card": "Näytä tietokortti", @@ -2947,6 +2952,7 @@ "The mask's effect on / off": "Maskin vaikutus päälle / pois", "The model can't take an area this large. Please select a smaller area.": "Malli ei pysty käsittelemään näin suurta aluetta. Valitse pienempi alue.", "The new reference covers its image area too.": "Uusi viitekuva kattaa myös sen kuva-alan.", + "The originals come from Immich; edits go to your other devices.": "Alkuperäiset tulevat Immichistä; muokkaukset menevät muille laitteillesi.", "The originals come here; edits go back.": "Alkuperäiset tulevat tänne; muokkaukset palaavat.", "The originals, and photos added here go to the other devices.": "Alkuperäiset, ja täällä lisätyt kuvat menevät muille laitteille.", "The passphrases differ.": "Tunnuslauseet eroavat.", diff --git a/crates/ui-egui/locales/fork/fr.json b/crates/ui-egui/locales/fork/fr.json index 316eb633bd..86032d7c2f 100644 --- a/crates/ui-egui/locales/fork/fr.json +++ b/crates/ui-egui/locales/fork/fr.json @@ -130,6 +130,7 @@ "After the Import": "Après l'importation", "Album name (blank: the collection title)": "Nom de l'album (vide : le titre de la collection)", "Albums deleted on one side ({})": "Albums supprimés d’un côté ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Albums de votre serveur Immich : choisissez ce que cet appareil garde de chacun.", "Albums ↔ albums": "Albums ↔ albums", "Albums: {}": "Albums : {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Albums : {} liés, {} créés, {} renommés, {} modifiés, {} supprimés", @@ -403,6 +404,7 @@ "Choose a plug-in module (.wasm) first": "Choisissez d’abord un module (.wasm)", "Choose a preset…": "Choisir un préréglage…", "Choose folder later": "Choisir le dossier plus tard", + "Choose in Sync…": "Choisir dans Synchronisation…", "Choose where to import from": "Choisissez la source de l'importation", "City contains": "La ville contient", "Classic (4:3)": "Classique (4:3)", @@ -727,6 +729,7 @@ "Duration": "Durée", "Duration (seconds)": "Durée (secondes)", "E: every device keeps the original and can add photos": "E: chaque appareil garde l’original et peut ajouter des photos", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Chaque album est une collection de l’ensemble Immich ; dans Réglages ▸ Synchronisation, chaque appareil choisit Aucun, Aperçus ou Qualité complète.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Chaque appareil garde son propre catalogue et ne voit que les collections qu’il est autorisé et choisit à prendre.", "Each of the {n} selected photos gets the reference that fits it": "Chacune des {n} photos sélectionnées reçoit la référence qui lui correspond", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "L'œil le plus net de chaque personne à 100 % en haut de la loupe. La barre de réglages rapides (pointez l'espace à côté des noms des modules) l'active aussi.", @@ -1878,6 +1881,7 @@ "Preview in Browser…": "Aperçu dans le navigateur…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Aperçu : {} vérifiés, {} depuis Immich, {} vers Immich, {} conflits", "Previewing the Immich sync": "Aperçu de la synchronisation Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Aperçus d’Immich à développer ici ; les retouches vont à vos autres appareils.", "Previews to develop here; edits go back.": "Aperçus à développer ici ; les retouches repartent.", "Previous": "Précédente", "Previous / Next Page": "Page précédente/suivante", @@ -2336,6 +2340,7 @@ "Show HSL Color Values": "Afficher les valeurs TSL", "Show Header Bar": "Afficher la barre d'en-tête", "Show Hidden Favorites": "Afficher les favoris masqués", + "Show Immich albums as collections": "Afficher les albums Immich comme collections", "Show Import Tab Settings": "Afficher les réglages de l’onglet Importation", "Show Index Numbers": "Afficher les numéros d’index", "Show Info Card": "Afficher la fiche d’infos", @@ -2591,6 +2596,7 @@ "The mask's effect on / off": "Effet du masque activé / désactivé", "The model is kept on this computer only. {app} never uploads or shares it.": "Le modèle est conservé uniquement sur cet ordinateur. {app} ne le téléverse ni ne le partage jamais.", "The new reference covers its image area too.": "La nouvelle référence couvre aussi sa zone d’image.", + "The originals come from Immich; edits go to your other devices.": "Les originaux viennent d’Immich ; les retouches vont à vos autres appareils.", "The originals come here; edits go back.": "Les originaux viennent ici ; les retouches repartent.", "The originals, and photos added here go to the other devices.": "Les originaux, et les photos ajoutées ici vont aux autres appareils.", "The passphrases differ.": "Les phrases secrètes diffèrent.", diff --git a/crates/ui-egui/locales/fork/id.json b/crates/ui-egui/locales/fork/id.json index b9fdc4f24b..f50b04b5ec 100644 --- a/crates/ui-egui/locales/fork/id.json +++ b/crates/ui-egui/locales/fork/id.json @@ -141,6 +141,7 @@ "Agree and Generate": "Setuju dan buat", "Album name (blank: the collection title)": "Nama album (kosong: judul koleksi)", "Albums deleted on one side ({})": "Album yang dihapus di satu sisi ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Album di server Immich Anda: pilih apa yang disimpan perangkat ini dari masing-masing.", "Albums ↔ albums": "Album ↔ album", "Albums: {}": "Album: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Album: {} ditautkan, {} dibuat, {} diganti namanya, {} diubah, {} dihapus", @@ -440,6 +441,7 @@ "Choose a preset…": "Pilih preset…", "Choose at least one setting to include": "Pilih minimal satu pengaturan untuk disertakan", "Choose folder later": "Pilih folder nanti", + "Choose in Sync…": "Pilih di Sinkronisasi…", "Choose the catalog to open.": "Pilih katalog yang akan dibuka.", "Choose where to import from": "Pilih sumber impor", "Chroma": "Kroma", @@ -817,6 +819,7 @@ "Duplicates": "Duplikat", "Duration (seconds)": "Durasi (detik)", "E: every device keeps the original and can add photos": "E: setiap perangkat menyimpan aslinya dan dapat menambahkan foto", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Setiap album adalah koleksi dalam set Immich; di Pengaturan ▸ Sinkronisasi setiap perangkat memilih Tidak ada, Pratinjau, atau Kualitas Penuh.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Setiap perangkat menyimpan katalognya sendiri dan hanya melihat koleksi yang diizinkan dan dipilih untuk diambil.", "Each of the {n} selected photos gets the reference that fits it": "Setiap {n} foto yang dipilih mendapat referensi yang cocok untuknya", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Mata yang lebih tajam dari setiap orang pada 100 % di bagian atas loupe. Bilah pengaturan cepat (arahkan penunjuk ke ruang di samping nama modul) juga mengalihkannya.", @@ -2138,6 +2141,7 @@ "Preview in Browser…": "Pratinjau di peramban…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Pratinjau: {} diperiksa, {} dari Immich, {} ke Immich, {} konflik", "Previewing the Immich sync": "Mempratinjau sinkronisasi Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Pratinjau dari Immich untuk dikembangkan di sini; suntingan dikirim ke perangkat Anda yang lain.", "Previews to develop here; edits go back.": "Pratinjau untuk diolah di sini; editan dikirim kembali.", "Previous": "Sebelumnya", "Previous / Next Page": "Halaman sebelumnya/berikutnya", @@ -2672,6 +2676,7 @@ "Show HSL Color Values": "Tampilkan nilai warna HSL", "Show Header Bar": "Tampilkan bilah header", "Show Hidden Favorites": "Tampilkan favorit yang disembunyikan", + "Show Immich albums as collections": "Tampilkan album Immich sebagai koleksi", "Show Import Tab Settings": "Tampilkan pengaturan tab Impor", "Show Index Numbers": "Tampilkan nomor indeks", "Show Info Card": "Tampilkan kartu info", @@ -2955,6 +2960,7 @@ "The mask's effect on / off": "Efek masker aktif / nonaktif", "The model can't take an area this large. Please select a smaller area.": "Model tidak dapat memproses area sebesar ini. Silakan pilih area yang lebih kecil.", "The new reference covers its image area too.": "Referensi baru juga mencakup area gambarnya.", + "The originals come from Immich; edits go to your other devices.": "File asli datang dari Immich; suntingan dikirim ke perangkat Anda yang lain.", "The originals come here; edits go back.": "Aslinya datang ke sini; editan dikirim kembali.", "The originals, and photos added here go to the other devices.": "Aslinya, dan foto yang ditambahkan di sini dikirim ke perangkat lain.", "The passphrases differ.": "Frasa sandi tidak sama.", diff --git a/crates/ui-egui/locales/fork/it.json b/crates/ui-egui/locales/fork/it.json index 14434708f0..1a87698e4d 100644 --- a/crates/ui-egui/locales/fork/it.json +++ b/crates/ui-egui/locales/fork/it.json @@ -132,6 +132,7 @@ "Agree and Generate": "Accetta e genera", "Album name (blank: the collection title)": "Nome dell'album (vuoto: il titolo della raccolta)", "Albums deleted on one side ({})": "Album eliminati da un lato ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Album sul tuo server Immich: scegli cosa tiene questo dispositivo di ciascuno.", "Albums ↔ albums": "Album ↔ album", "Albums: {}": "Album: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Album: {} collegati, {} creati, {} rinominati, {} modificati, {} eliminati", @@ -414,6 +415,7 @@ "Choose a preset…": "Scegli un preset…", "Choose at least one setting to include": "Scegli almeno un'impostazione da includere", "Choose folder later": "Scegli la cartella più tardi", + "Choose in Sync…": "Scegli in Sincronizzazione…", "Choose where to import from": "Scegli da dove importare", "City contains": "La città contiene", "Classic (4:3)": "Classico (4:3)", @@ -766,6 +768,7 @@ "Duplicates": "Duplicati", "Duration (seconds)": "Durata (secondi)", "E: every device keeps the original and can add photos": "E: ogni dispositivo conserva l’originale e può aggiungere foto", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Ogni album è una raccolta nel gruppo Immich; in Impostazioni ▸ Sincronizzazione ogni dispositivo sceglie Nessuno, Anteprime o Qualità piena.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Ogni dispositivo conserva il proprio catalogo e vede solo le raccolte che può e sceglie di prendere.", "Each of the {n} selected photos gets the reference that fits it": "Ognuna delle {n} foto selezionate riceve il riferimento adatto", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "L'occhio più nitido di ogni persona al 100 % nella parte superiore della lente. Anche la barra delle impostazioni rapide (puntare lo spazio accanto ai nomi dei moduli) la attiva.", @@ -2012,6 +2015,7 @@ "Preview in Browser…": "Anteprima nel browser…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Anteprima: {} controllati, {} da Immich, {} verso Immich, {} conflitti", "Previewing the Immich sync": "Anteprima della sincronizzazione Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Anteprime da Immich da sviluppare qui; le modifiche vanno agli altri tuoi dispositivi.", "Previews to develop here; edits go back.": "Anteprime da sviluppare qui; le modifiche tornano indietro.", "Previous": "Indietro", "Previous / Next Page": "Pagina precedente/successiva", @@ -2506,6 +2510,7 @@ "Show HSL Color Values": "Mostra valori colore HSL", "Show Header Bar": "Mostra barra dell'intestazione", "Show Hidden Favorites": "Mostra i preferiti nascosti", + "Show Immich albums as collections": "Mostra gli album di Immich come raccolte", "Show Import Tab Settings": "Mostra impostazioni della scheda Importa", "Show Index Numbers": "Mostra numeri di indice", "Show Info Card": "Mostra scheda informazioni", @@ -2765,6 +2770,7 @@ "The layout image can't be shown": "Impossibile mostrare l'immagine di layout", "The mask's effect on / off": "Effetto della maschera attivo / disattivo", "The new reference covers its image area too.": "Il nuovo riferimento copre anche la sua area immagine.", + "The originals come from Immich; edits go to your other devices.": "Gli originali arrivano da Immich; le modifiche vanno agli altri tuoi dispositivi.", "The originals come here; edits go back.": "Gli originali arrivano qui; le modifiche tornano indietro.", "The originals, and photos added here go to the other devices.": "Gli originali, e le foto aggiunte qui vanno agli altri dispositivi.", "The passphrases differ.": "Le passphrase non coincidono.", diff --git a/crates/ui-egui/locales/fork/ja.json b/crates/ui-egui/locales/fork/ja.json index 025b84a3ca..c82b11c66d 100644 --- a/crates/ui-egui/locales/fork/ja.json +++ b/crates/ui-egui/locales/fork/ja.json @@ -137,6 +137,7 @@ "After the Import": "読み込み後", "Album name (blank: the collection title)": "アルバム名(空欄:コレクションのタイトル)", "Albums deleted on one side ({})": "片側で削除されたアルバム ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Immich サーバーのアルバム:それぞれについてこのデバイスに何を残すか選びます。", "Albums ↔ albums": "アルバム ↔ アルバム", "Albums: {}": "アルバム: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "アルバム: リンク {}、作成 {}、名前変更 {}、変更 {}、削除 {}", @@ -444,6 +445,7 @@ "Choose a preset…": "プリセットを選択…", "Choose at least one setting to include": "含める設定を 1 つ以上選んでください", "Choose folder later": "後でフォルダーを選択", + "Choose in Sync…": "同期で選択…", "Choose the catalog to open.": "開くカタログを選択してください。", "Choose where to import from": "読み込み元を選択", "City contains": "市区町村を含む", @@ -814,6 +816,7 @@ "Duration": "再生時間", "Duration (seconds)": "長さ(秒)", "E: every device keeps the original and can add photos": "E: すべてのデバイスが元画像を保持し、写真を追加できます", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "各アルバムは Immich セット内のコレクションです。設定 ▸ 同期 で、各デバイスがなし・プレビュー・フル画質を選びます。", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "各デバイスは独自のカタログを持ち、許可されていて取得を選んだコレクションだけが表示されます。", "Each of the {n} selected photos gets the reference that fits it": "選択した {n} 枚の写真それぞれに合う参照写真を適用します", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "各人物のよりシャープな目を 100 % でルーペ上部に表示します。クイック設定バー(モジュール名の横の空き領域をポイント)でも切り替えられます。", @@ -2088,6 +2091,7 @@ "Preview in Browser…": "ブラウザーでプレビュー…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "プレビュー:{} 件を確認、Immich から {} 件、Immich へ {} 件、競合 {} 件", "Previewing the Immich sync": "Immich 同期のプレビュー", + "Previews from Immich to develop here; edits go to your other devices.": "Immich のプレビューをここで現像。編集は他のデバイスに送られます。", "Previews to develop here; edits go back.": "ここで現像するプレビュー。編集は送り返されます。", "Previous": "前の写真", "Previous / Next Page": "前のページ / 次のページ", @@ -2594,6 +2598,7 @@ "Show HSL Color Values": "HSL カラー値を表示", "Show Header Bar": "ヘッダーバーを表示", "Show Hidden Favorites": "非表示にしたお気に入りを表示", + "Show Immich albums as collections": "Immich のアルバムをコレクションとして表示", "Show Import Tab Settings": "読み込みタブの設定を表示", "Show Index Numbers": "インデックス番号を表示", "Show Info Card": "情報カードを表示", @@ -2880,6 +2885,7 @@ "The mask's effect on / off": "マスクの効果のオン / オフ", "The model is kept on this computer only. {app} never uploads or shares it.": "モデルはこのコンピューターにのみ保存されます。{app}がアップロードや共有をすることはありません。", "The new reference covers its image area too.": "新しい参照写真はその撮像範囲もカバーします。", + "The originals come from Immich; edits go to your other devices.": "オリジナルは Immich から取得。編集は他のデバイスに送られます。", "The originals come here; edits go back.": "元画像がここに届きます。編集は送り返されます。", "The originals, and photos added here go to the other devices.": "元画像、そしてここで追加した写真は他のデバイスに送られます。", "The passphrases differ.": "パスフレーズが一致しません。", diff --git a/crates/ui-egui/locales/fork/ka.json b/crates/ui-egui/locales/fork/ka.json index d73f52e3ec..d21b800da4 100644 --- a/crates/ui-egui/locales/fork/ka.json +++ b/crates/ui-egui/locales/fork/ka.json @@ -150,6 +150,7 @@ "Agree and Generate": "თანხმობა და გენერირება", "Album name (blank: the collection title)": "ალბომის სახელი (ცარიელი: კოლექციის დასახელება)", "Albums deleted on one side ({})": "ერთ მხარეს წაშლილი ალბომები ({})", + "Albums on your Immich server: choose what this device keeps of each.": "თქვენი Immich სერვერის ალბომები: აირჩიეთ, რას შეინახავს ეს მოწყობილობა თითოეულიდან.", "Albums ↔ albums": "ალბომები ↔ ალბომები", "Albums: {}": "ალბომები: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "ალბომები: დაკავშირდა {}, შეიქმნა {}, სახელი შეეცვალა {}, შეიცვალა {}, წაიშალა {}", @@ -472,6 +473,7 @@ "Choose a preset…": "აირჩიეთ პრესეტი…", "Choose at least one setting to include": "აირჩიეთ ჩასართავად მინიმუმ ერთი პარამეტრი", "Choose folder later": "საქაღალდის მოგვიანებით არჩევა", + "Choose in Sync…": "არჩევა სინქრონიზაციაში…", "Choose the catalog to open.": "აირჩიეთ გასახსნელი კატალოგი.", "Choose where to import from": "აირჩიეთ, საიდან მოხდეს იმპორტი", "Cinema Wide": "კინოს ფართო", @@ -874,6 +876,7 @@ "Duration": "ხანგრძლივობა", "Duration (seconds)": "ხანგრძლივობა (წამი)", "E: every device keeps the original and can add photos": "E: ყველა მოწყობილობა ინახავს ორიგინალს და შეუძლია ფოტოების დამატება", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "თითოეული ალბომი Immich-ის ნაკრების კოლექციაა; პარამეტრები ▸ სინქრონიზაციაში თითოეული მოწყობილობა ირჩევს: არაფერი, გადახედვები ან სრული ხარისხი.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "თითოეული მოწყობილობა ინახავს საკუთარ კატალოგს და ხედავს მხოლოდ იმ კოლექციებს, რომელთა აღებაც ნებადართულია და აირჩია.", "Each of the {n} selected photos gets the reference that fits it": "{n} არჩეული ფოტოდან თითოეული მიიღებს მისთვის შესაფერის საცნობარო ფოტოს", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "თითოეული ადამიანის უფრო მკვეთრი თვალი 100 %-ზე ლუპის ზედა ნაწილში. მას სწრაფი პარამეტრების ზოლიც რთავს (მიიტანეთ მაჩვენებელი მოდულების სახელების გვერდით ცარიელ ადგილზე).", @@ -2262,6 +2265,7 @@ "Preview in Browser…": "გადახედვა ბრაუზერში…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "გადახედვა: შემოწმდა {}, Immich-იდან {}, Immich-ში {}, კონფლიქტები: {}", "Previewing the Immich sync": "Immich-ის სინქრონიზაციის გადახედვა", + "Previews from Immich to develop here; edits go to your other devices.": "Immich-ის გადახედვები აქ დასამუშავებლად; ცვლილებები სხვა მოწყობილობებზე გადადის.", "Previews to develop here; edits go back.": "გადახედვები აქ დასამუშავებლად; ჩასწორებები ბრუნდება.", "Previous": "წინა", "Previous / Next Page": "წინა / შემდეგი გვერდი", @@ -2835,6 +2839,7 @@ "Show HSL Color Values": "HSL ფერის მნიშვნელობების ჩვენება", "Show Header Bar": "სათაურის ზოლის ჩვენება", "Show Hidden Favorites": "დამალული რჩეულების ჩვენება", + "Show Immich albums as collections": "Immich-ის ალბომების ჩვენება კოლექციებად", "Show Import Tab Settings": "იმპორტის ჩანართის პარამეტრების ჩვენება", "Show Index Numbers": "რიგითი ნომრების ჩვენება", "Show Info Card": "ინფორმაციის ბარათის ჩვენება", @@ -3139,6 +3144,7 @@ "The mask's effect on / off": "ნიღბის ეფექტი ჩართვა / გამორთვა", "The model can't take an area this large. Please select a smaller area.": "მოდელი ასეთ დიდ არეს ვერ იღებს. გთხოვთ, აირჩიოთ უფრო პატარა არე.", "The new reference covers its image area too.": "ახალი საცნობარო ფოტო მის გამოსახულების არესაც ფარავს.", + "The originals come from Immich; edits go to your other devices.": "ორიგინალები Immich-იდან მოდის; ცვლილებები სხვა მოწყობილობებზე გადადის.", "The originals come here; edits go back.": "ორიგინალები აქ მოდის; ჩასწორებები ბრუნდება.", "The originals, and photos added here go to the other devices.": "ორიგინალები, და აქ დამატებული ფოტოები სხვა მოწყობილობებზე მიდის.", "The passphrases differ.": "საიდუმლო ფრაზები არ ემთხვევა.", diff --git a/crates/ui-egui/locales/fork/pl.json b/crates/ui-egui/locales/fork/pl.json index bc1a381a7e..97a169bf12 100644 --- a/crates/ui-egui/locales/fork/pl.json +++ b/crates/ui-egui/locales/fork/pl.json @@ -143,6 +143,7 @@ "Agree and Generate": "Zgadzam się i generuj", "Album name (blank: the collection title)": "Nazwa albumu (puste: tytuł kolekcji)", "Albums deleted on one side ({})": "Albumy usunięte po jednej stronie ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Albumy na Twoim serwerze Immich: wybierz, co to urządzenie zachowa z każdego.", "Albums ↔ albums": "Albumy ↔ albumy", "Albums: {}": "Albumy: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Albumy: połączone {}, utworzone {}, ze zmienioną nazwą {}, zmienione {}, usunięte {}", @@ -456,6 +457,7 @@ "Choose a preset…": "Wybierz ustawienie wstępne…", "Choose at least one setting to include": "Wybierz co najmniej jedno ustawienie do uwzględnienia", "Choose folder later": "Wybierz folder później", + "Choose in Sync…": "Wybierz w Synchronizacji…", "Choose the catalog to open.": "Wybierz katalog do otwarcia.", "Choose where to import from": "Wybierz, skąd importować", "Cinema Wide": "Kinowy panoramiczny", @@ -836,6 +838,7 @@ "Duration": "Czas trwania", "Duration (seconds)": "Czas trwania (sekundy)", "E: every device keeps the original and can add photos": "E: każde urządzenie zachowuje oryginał i może dodawać zdjęcia", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Każdy album jest kolekcją w zestawie Immich; w Ustawieniach ▸ Synchronizacja każde urządzenie wybiera Brak, Podglądy lub Pełna jakość.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Każde urządzenie ma własny katalog i widzi tylko kolekcje, które może i chce pobrać.", "Each of the {n} selected photos gets the reference that fits it": "Każde z {n} wybranych zdjęć otrzyma pasujące do niego odniesienie", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Ostrzejsze oko każdej osoby w 100 % u góry lupy. Przełącza go też pasek szybkich ustawień (wskaż puste miejsce obok nazw modułów).", @@ -2180,6 +2183,7 @@ "Preview in Browser…": "Podgląd w przeglądarce…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Podgląd: sprawdzono {}, z Immich {}, do Immich {}, konflikty: {}", "Previewing the Immich sync": "Podgląd synchronizacji z Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Podglądy z Immich do wywołania tutaj; zmiany trafiają na Twoje inne urządzenia.", "Previews to develop here; edits go back.": "Podglądy do wywołania tutaj; zmiany wracają.", "Previous": "Wstecz", "Previous / Next Page": "Poprzednia / następna strona", @@ -2699,6 +2703,7 @@ "Show HSL Color Values": "Pokaż wartości kolorów HSL", "Show Header Bar": "Pokaż pasek nagłówka", "Show Hidden Favorites": "Pokaż ukryte ulubione", + "Show Immich albums as collections": "Pokaż albumy Immich jako kolekcje", "Show Import Tab Settings": "Pokaż ustawienia karty importu", "Show Index Numbers": "Pokaż numery indeksu", "Show Info Card": "Pokaż kartę informacji", @@ -2987,6 +2992,7 @@ "The layout image can't be shown": "Nie można wyświetlić obrazu układu", "The mask's effect on / off": "Efekt maski wł. / wył.", "The new reference covers its image area too.": "Nowe odniesienie obejmuje też jego obszar obrazu.", + "The originals come from Immich; edits go to your other devices.": "Oryginały pochodzą z Immich; zmiany trafiają na Twoje inne urządzenia.", "The originals come here; edits go back.": "Oryginały trafiają tutaj; zmiany wracają.", "The originals, and photos added here go to the other devices.": "Oryginały, a zdjęcia dodane tutaj trafiają do innych urządzeń.", "The passphrases differ.": "Hasła się różnią.", diff --git a/crates/ui-egui/locales/fork/pt-br.json b/crates/ui-egui/locales/fork/pt-br.json index 61d7c22e4f..c05dfbeba3 100644 --- a/crates/ui-egui/locales/fork/pt-br.json +++ b/crates/ui-egui/locales/fork/pt-br.json @@ -137,6 +137,7 @@ "After the Import": "Depois da importação", "Album name (blank: the collection title)": "Nome do álbum (em branco: o título da coleção)", "Albums deleted on one side ({})": "Álbuns excluídos em um lado ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Álbuns do seu servidor Immich: escolha o que este dispositivo guarda de cada um.", "Albums ↔ albums": "Álbuns ↔ álbuns", "Albums: {}": "Álbuns: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Álbuns: {} vinculados, {} criados, {} renomeados, {} alterados, {} excluídos", @@ -443,6 +444,7 @@ "Choose a preset…": "Escolher uma predefinição…", "Choose at least one setting to include": "Escolha pelo menos uma configuração para incluir", "Choose folder later": "Escolher pasta depois", + "Choose in Sync…": "Escolher em Sincronização…", "Choose the catalog to open.": "Escolha o catálogo a abrir.", "Choose where to import from": "Escolha de onde importar", "City contains": "A cidade contém", @@ -813,6 +815,7 @@ "Duration": "Duração", "Duration (seconds)": "Duração (segundos)", "E: every device keeps the original and can add photos": "E: cada dispositivo mantém o original e pode adicionar fotos", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Cada álbum é uma coleção do conjunto Immich; em Configurações ▸ Sincronização cada dispositivo escolhe Nenhum, Prévias ou Qualidade total.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Cada dispositivo mantém seu próprio catálogo e vê apenas as coleções que tem permissão e escolhe receber.", "Each of the {n} selected photos gets the reference that fits it": "Cada uma das {n} fotos selecionadas recebe a referência que lhe corresponde", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "O olho mais nítido de cada pessoa a 100 % no topo da lupa. A barra de configurações rápidas (aponte para o espaço ao lado dos nomes dos módulos) também a alterna.", @@ -2087,6 +2090,7 @@ "Preview in Browser…": "Visualizar no navegador…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Pré-visualização: {} verificados, {} do Immich, {} para o Immich, {} conflitos", "Previewing the Immich sync": "Prévia da sincronização com o Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Prévias do Immich para revelar aqui; as edições vão para seus outros dispositivos.", "Previews to develop here; edits go back.": "Prévias para revelar aqui; as edições voltam.", "Previous": "Anterior", "Previous / Next Page": "Página anterior/próxima", @@ -2593,6 +2597,7 @@ "Show HSL Color Values": "Mostrar valores de cor HSL", "Show Header Bar": "Mostrar barra de cabeçalho", "Show Hidden Favorites": "Mostrar favoritos ocultos", + "Show Immich albums as collections": "Mostrar álbuns do Immich como coleções", "Show Import Tab Settings": "Mostrar configurações da aba Importar", "Show Index Numbers": "Mostrar números de índice", "Show Info Card": "Mostrar cartão de informações", @@ -2877,6 +2882,7 @@ "The mask's effect on / off": "Efeito da máscara ligado / desligado", "The model is kept on this computer only. {app} never uploads or shares it.": "O modelo fica apenas neste computador. O {app} nunca o envia nem o compartilha.", "The new reference covers its image area too.": "A nova referência também cobre a área de imagem dela.", + "The originals come from Immich; edits go to your other devices.": "Os originais vêm do Immich; as edições vão para seus outros dispositivos.", "The originals come here; edits go back.": "Os originais vêm para cá; as edições voltam.", "The originals, and photos added here go to the other devices.": "Os originais, e as fotos adicionadas aqui vão para os outros dispositivos.", "The passphrases differ.": "As frases secretas não coincidem.", diff --git a/crates/ui-egui/locales/fork/ru.json b/crates/ui-egui/locales/fork/ru.json index 5f95451e5a..d598ae866a 100644 --- a/crates/ui-egui/locales/fork/ru.json +++ b/crates/ui-egui/locales/fork/ru.json @@ -145,6 +145,7 @@ "After the Import": "После импорта", "Album name (blank: the collection title)": "Название альбома (пусто: название коллекции)", "Albums deleted on one side ({})": "Альбомы, удалённые с одной стороны ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Альбомы на вашем сервере Immich: выберите, что это устройство хранит из каждого.", "Albums ↔ albums": "Альбомы ↔ альбомы", "Albums: {}": "Альбомы: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Альбомы: связано {}, создано {}, переименовано {}, изменено {}, удалено {}", @@ -451,6 +452,7 @@ "Choose a plug-in module (.wasm) first": "Сначала выберите модуль плагина (.wasm)", "Choose a preset…": "Выберите пресет…", "Choose folder later": "Выбрать папку позже", + "Choose in Sync…": "Выбрать в синхронизации…", "Choose the catalog to open.": "Выберите каталог для открытия.", "Choose where to import from": "Выберите, откуда импортировать", "City contains": "Город содержит", @@ -811,6 +813,7 @@ "Duration": "Длительность", "Duration (seconds)": "Длительность (секунды)", "E: every device keeps the original and can add photos": "E: каждое устройство хранит оригинал и может добавлять фото", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Каждый альбом — коллекция в наборе Immich; в Настройках ▸ Синхронизация каждое устройство выбирает «Нет», «Превью» или «Полное качество».", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Каждое устройство хранит свой каталог и видит только те коллекции, которые ему разрешено и которые оно выбирает брать.", "Each of the {n} selected photos gets the reference that fits it": "Каждое из {n} выбранных фото получит подходящий ему эталон", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Более резкий глаз каждого человека в масштабе 100 % вверху лупы. Её также переключает панель быстрых настроек (наведите указатель на пустое место рядом с названиями модулей).", @@ -2095,6 +2098,7 @@ "Preview only: editing the camera's embedded JPEG": "Только превью: обрабатывается встроенный JPEG камеры", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Предпросмотр: проверено {}, из Immich {}, в Immich {}, конфликтов {}", "Previewing the Immich sync": "Предпросмотр синхронизации с Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Превью из Immich для проявки здесь; правки уходят на другие ваши устройства.", "Previews to develop here; edits go back.": "Превью для обработки здесь; правки возвращаются.", "Previous": "Предыдущий", "Previous / Next Page": "Предыдущая / следующая страница", @@ -2599,6 +2603,7 @@ "Show HSL Color Values": "Показывать значения HSL", "Show Header Bar": "Показать панель заголовка", "Show Hidden Favorites": "Показать скрытое в «Избранном»", + "Show Immich albums as collections": "Показывать альбомы Immich как коллекции", "Show Import Tab Settings": "Показать настройки вкладки импорта", "Show Index Numbers": "Показывать номера", "Show Info Card": "Показать карточку сведений", @@ -2874,6 +2879,7 @@ "The new reference covers its image area too.": "Новый эталон охватывает и его область изображения.", "The number at the end of the original name (IMG_0042 → 0042)": "Номер в конце исходного имени (IMG_0042 → 0042)", "The original extension is always added; {ext} only puts it inside the name as well.": "Исходное расширение добавляется всегда; {ext} лишь дополнительно вставляет его в имя.", + "The originals come from Immich; edits go to your other devices.": "Оригиналы приходят из Immich; правки уходят на другие ваши устройства.", "The originals come here; edits go back.": "Оригиналы приходят сюда; правки возвращаются.", "The originals, and photos added here go to the other devices.": "Оригиналы, а фото, добавленные здесь, уходят на другие устройства.", "The passphrases differ.": "Парольные фразы не совпадают.", diff --git a/crates/ui-egui/locales/fork/sv.json b/crates/ui-egui/locales/fork/sv.json index cb558c0a44..eb6ca76670 100644 --- a/crates/ui-egui/locales/fork/sv.json +++ b/crates/ui-egui/locales/fork/sv.json @@ -144,6 +144,7 @@ "Agree and Generate": "Godkänn och generera", "Album name (blank: the collection title)": "Albumnamn (tomt: samlingens titel)", "Albums deleted on one side ({})": "Album raderade på ena sidan ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Album på din Immich-server: välj vad den här enheten behåller av vart och ett.", "Albums ↔ albums": "Album ↔ album", "Albums: {}": "Album: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Album: {} länkade, {} skapade, {} omdöpta, {} ändrade, {} raderade", @@ -450,6 +451,7 @@ "Choose a plug-in module (.wasm) first": "Välj först en tilläggsmodul (.wasm)", "Choose a preset…": "Välj en förinställning…", "Choose folder later": "Välj mapp senare", + "Choose in Sync…": "Välj i Synkronisering…", "Choose the catalog to open.": "Välj katalogen som ska öppnas.", "Choose where to import from": "Välj var du vill importera från", "Chroma": "Kroma", @@ -840,6 +842,7 @@ "Duplicates": "Dubbletter", "Duration (seconds)": "Längd (sekunder)", "E: every device keeps the original and can add photos": "E: varje enhet behåller originalet och kan lägga till foton", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Varje album är en samling i uppsättningen Immich; under Inställningar ▸ Synkronisering väljer varje enhet Ingen, Förhandsvisningar eller Full kvalitet.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Varje enhet behåller sin egen katalog och ser bara de samlingar den får och väljer att ta.", "Each of the {n} selected photos gets the reference that fits it": "Vart och ett av de {n} valda fotona får den referens som passar det", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Varje persons skarpare öga i 100 % överst i lupen. Snabbinställningsfältet (peka på det tomma utrymmet bredvid modulnamnen) växlar den också.", @@ -2183,6 +2186,7 @@ "Preview in Browser…": "Förhandsgranska i webbläsare…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Förhandsgranskning: {} kontrollerade, {} från Immich, {} till Immich, {} konflikter", "Previewing the Immich sync": "Förhandsgranskar Immich-synken", + "Previews from Immich to develop here; edits go to your other devices.": "Förhandsvisningar från Immich att framkalla här; ändringar går till dina andra enheter.", "Previews to develop here; edits go back.": "Förhandsvisningar att framkalla här; ändringar går tillbaka.", "Previous": "Föregående", "Previous / Next Page": "Föregående/nästa sida", @@ -2734,6 +2738,7 @@ "Show HSL Color Values": "Visa HSL-färgvärden", "Show Header Bar": "Visa sidhuvudsfält", "Show Hidden Favorites": "Visa dolda favoriter", + "Show Immich albums as collections": "Visa Immich-album som samlingar", "Show Import Tab Settings": "Visa inställningar för importfliken", "Show Index Numbers": "Visa indexnummer", "Show Info Card": "Visa infokort", @@ -3019,6 +3024,7 @@ "The mask's effect on / off": "Maskens effekt på / av", "The model can't take an area this large. Please select a smaller area.": "Modellen klarar inte ett så här stort område. Markera ett mindre område.", "The new reference covers its image area too.": "Den nya referensen täcker även dess bildyta.", + "The originals come from Immich; edits go to your other devices.": "Originalen kommer från Immich; ändringar går till dina andra enheter.", "The originals come here; edits go back.": "Originalen kommer hit; ändringar går tillbaka.", "The originals, and photos added here go to the other devices.": "Originalen, och foton som läggs till här går till de andra enheterna.", "The passphrases differ.": "Lösenfraserna skiljer sig åt.", diff --git a/crates/ui-egui/locales/fork/uk.json b/crates/ui-egui/locales/fork/uk.json index 0979ed819e..a4c6ba04bb 100644 --- a/crates/ui-egui/locales/fork/uk.json +++ b/crates/ui-egui/locales/fork/uk.json @@ -121,6 +121,7 @@ "After the Import": "Після імпорту", "Album name (blank: the collection title)": "Назва альбому (порожньо: назва колекції)", "Albums deleted on one side ({})": "Альбоми, видалені з одного боку ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Альбоми на вашому сервері Immich: виберіть, що цей пристрій зберігає з кожного.", "Albums ↔ albums": "Альбоми ↔ альбоми", "Albums: {}": "Альбоми: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Альбоми: пов’язано {}, створено {}, перейменовано {}, змінено {}, видалено {}", @@ -411,6 +412,7 @@ "Choose a preset…": "Виберіть набір налаштувань…", "Choose at least one setting to include": "Виберіть принаймні одне налаштування", "Choose folder later": "Вибрати теку пізніше", + "Choose in Sync…": "Вибрати в синхронізації…", "Choose the catalog to open.": "Виберіть каталог для відкриття.", "Choose where to import from": "Виберіть, звідки імпортувати", "City contains": "Місто містить", @@ -759,6 +761,7 @@ "Duration": "Тривалість", "Duration (seconds)": "Тривалість (секунди)", "E: every device keeps the original and can add photos": "E: кожен пристрій зберігає оригінал і може додавати фото", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Кожен альбом — колекція в наборі Immich; у Налаштуваннях ▸ Синхронізація кожен пристрій вибирає «Нічого», «Прев’ю» або «Повна якість».", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Кожен пристрій має власний каталог і бачить лише ті колекції, які йому дозволено і які він обирає брати.", "Each of the {n} selected photos gets the reference that fits it": "Кожне з {n} вибраних фото отримає відповідний йому еталон", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Різкіше око кожної людини в масштабі 100 % угорі лупи. Її також перемикає панель швидких налаштувань (наведіть вказівник на порожнє місце поруч із назвами модулів).", @@ -1981,6 +1984,7 @@ "Preview in Browser…": "Переглянути в браузері…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Попередній перегляд: перевірено {}, з Immich {}, до Immich {}, конфліктів {}", "Previewing the Immich sync": "Попередній перегляд синхронізації з Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Прев’ю з Immich для проявлення тут; правки йдуть на інші ваші пристрої.", "Previews to develop here; edits go back.": "Прев’ю для обробки тут; правки повертаються.", "Previous": "Попередній", "Previous / Next Page": "Попередня / наступна сторінка", @@ -2479,6 +2483,7 @@ "Show HSL Color Values": "Показувати значення HSL", "Show Header Bar": "Показати панель заголовка", "Show Hidden Favorites": "Показати приховані улюблені", + "Show Immich albums as collections": "Показувати альбоми Immich як колекції", "Show Import Tab Settings": "Показати налаштування вкладки імпорту", "Show Index Numbers": "Показувати порядкові номери", "Show Info Card": "Показати картку відомостей", @@ -2743,6 +2748,7 @@ "The mask's effect on / off": "Дія маски увімк. / вимк.", "The model is kept on this computer only. {app} never uploads or shares it.": "Модель зберігається лише на цьому комп’ютері. {app} ніколи не вивантажує й не поширює її.", "The new reference covers its image area too.": "Новий еталон охоплює і його область зображення.", + "The originals come from Immich; edits go to your other devices.": "Оригінали надходять з Immich; правки йдуть на інші ваші пристрої.", "The originals come here; edits go back.": "Оригінали приходять сюди; правки повертаються.", "The originals, and photos added here go to the other devices.": "Оригінали, а фото, додані тут, ідуть на інші пристрої.", "The passphrases differ.": "Парольні фрази відрізняються.", diff --git a/crates/ui-egui/locales/fork/vi.json b/crates/ui-egui/locales/fork/vi.json index 435e7b7abc..dc48d4ce13 100644 --- a/crates/ui-egui/locales/fork/vi.json +++ b/crates/ui-egui/locales/fork/vi.json @@ -154,6 +154,7 @@ "Agree and Generate": "Đồng ý và tạo", "Album name (blank: the collection title)": "Tên album (để trống: tiêu đề bộ sưu tập)", "Albums deleted on one side ({})": "Album đã xóa ở một bên ({})", + "Albums on your Immich server: choose what this device keeps of each.": "Album trên máy chủ Immich của bạn: chọn thiết bị này giữ gì của từng album.", "Albums ↔ albums": "Album ↔ album", "Albums: {}": "Album: {}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "Album: {} đã liên kết, {} đã tạo, {} đã đổi tên, {} đã thay đổi, {} đã xóa", @@ -479,6 +480,7 @@ "Choose a preset…": "Chọn thiết lập sẵn…", "Choose at least one setting to include": "Chọn ít nhất một thiết lập để đưa vào", "Choose folder later": "Chọn thư mục sau", + "Choose in Sync…": "Chọn trong Đồng bộ…", "Choose the catalog to open.": "Chọn catalog để mở.", "Choose where to import from": "Chọn nguồn nhập", "Chroma": "Sắc độ", @@ -887,6 +889,7 @@ "Duration": "Thời lượng", "Duration (seconds)": "Thời lượng (giây)", "E: every device keeps the original and can add photos": "E: mọi thiết bị giữ bản gốc và có thể thêm ảnh", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Mỗi album là một bộ sưu tập trong nhóm Immich; trong Cài đặt ▸ Đồng bộ, mỗi thiết bị chọn Không, Bản xem trước hoặc Chất lượng đầy đủ.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Mỗi thiết bị giữ catalog riêng và chỉ thấy những bộ sưu tập được phép và chọn nhận.", "Each of the {n} selected photos gets the reference that fits it": "Mỗi ảnh trong {n} ảnh đã chọn nhận ảnh tham chiếu phù hợp với nó", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Con mắt sắc nét hơn của mỗi người ở 100 % phía trên kính lúp. Thanh cài đặt nhanh (trỏ vào khoảng trống cạnh tên các mô-đun) cũng bật tắt nó.", @@ -2293,6 +2296,7 @@ "Preview in Browser…": "Xem trước trong trình duyệt…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "Xem trước: đã kiểm tra {}, {} từ Immich, {} lên Immich, {} xung đột", "Previewing the Immich sync": "Đang xem trước đồng bộ Immich", + "Previews from Immich to develop here; edits go to your other devices.": "Bản xem trước từ Immich để chỉnh sửa tại đây; chỉnh sửa được gửi tới các thiết bị khác của bạn.", "Previews to develop here; edits go back.": "Ảnh xem trước để xử lý ở đây; chỉnh sửa được gửi về.", "Previous": "Trước", "Previous / Next Page": "Trang trước/sau", @@ -2869,6 +2873,7 @@ "Show HSL Color Values": "Hiện giá trị màu HSL", "Show Header Bar": "Hiện thanh tiêu đề", "Show Hidden Favorites": "Hiện mục yêu thích đã ẩn", + "Show Immich albums as collections": "Hiển thị album Immich dưới dạng bộ sưu tập", "Show Import Tab Settings": "Hiện cài đặt thẻ Nhập", "Show Index Numbers": "Hiện số thứ tự", "Show Info Card": "Hiện thẻ thông tin", @@ -3179,6 +3184,7 @@ "The mask's effect on / off": "Bật / tắt hiệu ứng của mặt nạ", "The model can't take an area this large. Please select a smaller area.": "Mô hình không xử lý được vùng lớn như vậy. Vui lòng chọn vùng nhỏ hơn.", "The new reference covers its image area too.": "Ảnh tham chiếu mới cũng bao phủ vùng ảnh của nó.", + "The originals come from Immich; edits go to your other devices.": "Bản gốc đến từ Immich; chỉnh sửa được gửi tới các thiết bị khác của bạn.", "The originals come here; edits go back.": "Bản gốc được chuyển đến đây; chỉnh sửa được gửi về.", "The originals, and photos added here go to the other devices.": "Bản gốc, và ảnh thêm ở đây được gửi đến các thiết bị khác.", "The passphrases differ.": "Hai cụm mật khẩu không khớp.", diff --git a/crates/ui-egui/locales/fork/zh-hans.json b/crates/ui-egui/locales/fork/zh-hans.json index 3d0d2bb13a..8578f99967 100644 --- a/crates/ui-egui/locales/fork/zh-hans.json +++ b/crates/ui-egui/locales/fork/zh-hans.json @@ -134,6 +134,7 @@ "After the Import": "导入之后", "Album name (blank: the collection title)": "相册名称(留空:使用收藏集标题)", "Albums deleted on one side ({})": "一侧已删除的相册({})", + "Albums on your Immich server: choose what this device keeps of each.": "Immich 服务器上的相册:为每个相册选择此设备保留的内容。", "Albums ↔ albums": "相册 ↔ 相册", "Albums: {}": "相册:{}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "相册:已关联 {},已创建 {},已重命名 {},已更改 {},已删除 {}", @@ -432,6 +433,7 @@ "Choose a preset…": "选择预设…", "Choose at least one setting to include": "请至少选择一项要包含的设置", "Choose folder later": "稍后选择文件夹", + "Choose in Sync…": "在同步中选择…", "Choose the catalog to open.": "选择要打开的目录。", "Choose where to import from": "选择导入来源", "City contains": "城市包含", @@ -789,6 +791,7 @@ "Duration": "时长", "Duration (seconds)": "时长(秒)", "E: every device keeps the original and can add photos": "E: 每台设备都保留原片并可添加照片", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "每个相册都是 Immich 集合中的一个收藏集;在“设置 ▸ 同步”中,每台设备选择“无”“预览”或“完整画质”。", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "每台设备保留自己的目录,只显示允许且选择获取的收藏夹。", "Each of the {n} selected photos gets the reference that fits it": "所选的 {n} 张照片各自使用适合它的参考照片", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "在放大镜顶部以 100 % 显示每个人更清晰的那只眼睛。快速设置栏(指向模块名称旁边的空白处)也可切换它。", @@ -2046,6 +2049,7 @@ "Preview in Browser…": "在浏览器中预览…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "预览:已检查 {} 项,从 Immich 拉取 {} 项,推送到 Immich {} 项,冲突 {} 项", "Previewing the Immich sync": "预览 Immich 同步", + "Previews from Immich to develop here; edits go to your other devices.": "在此处冲印来自 Immich 的预览;编辑会同步到你的其他设备。", "Previews to develop here; edits go back.": "在此修改预览;编辑会传回。", "Previous": "上一张", "Previous / Next Page": "上一页 / 下一页", @@ -2549,6 +2553,7 @@ "Show HSL Color Values": "显示 HSL 颜色值", "Show Header Bar": "显示标题栏", "Show Hidden Favorites": "显示隐藏的收藏夹", + "Show Immich albums as collections": "将 Immich 相册显示为收藏集", "Show Import Tab Settings": "显示导入选项卡设置", "Show Index Numbers": "显示索引编号", "Show Info Card": "显示信息卡", @@ -2827,6 +2832,7 @@ "The mask's effect on / off": "开 / 关蒙版的效果", "The model is kept on this computer only. {app} never uploads or shares it.": "模型只保存在本机上。{app} 绝不会上传或分享它。", "The new reference covers its image area too.": "新参考照片也覆盖它的成像区域。", + "The originals come from Immich; edits go to your other devices.": "原图来自 Immich;编辑会同步到你的其他设备。", "The originals come here; edits go back.": "原片传到这里;编辑会传回。", "The originals, and photos added here go to the other devices.": "原片,以及在此添加的照片会发送到其他设备。", "The passphrases differ.": "两次输入的口令不一致。", diff --git a/crates/ui-egui/locales/fork/zh-hant.json b/crates/ui-egui/locales/fork/zh-hant.json index b40ba4b3a5..d96a147647 100644 --- a/crates/ui-egui/locales/fork/zh-hant.json +++ b/crates/ui-egui/locales/fork/zh-hant.json @@ -137,6 +137,7 @@ "After the Import": "匯入之後", "Album name (blank: the collection title)": "相簿名稱(留空:使用收藏集標題)", "Albums deleted on one side ({})": "一側已刪除的相簿({})", + "Albums on your Immich server: choose what this device keeps of each.": "Immich 伺服器上的相簿:為每個相簿選擇此裝置保留的內容。", "Albums ↔ albums": "相簿 ↔ 相簿", "Albums: {}": "相簿:{}", "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted": "相簿:已連結 {},已建立 {},已重新命名 {},已變更 {},已刪除 {}", @@ -444,6 +445,7 @@ "Choose a preset…": "選擇預設集…", "Choose at least one setting to include": "請至少選擇一項要包含的設定", "Choose folder later": "稍後選擇資料夾", + "Choose in Sync…": "在同步中選擇…", "Choose the catalog to open.": "選擇要開啟的目錄。", "Choose where to import from": "選擇匯入來源", "City contains": "城市包含", @@ -813,6 +815,7 @@ "Duration": "時長", "Duration (seconds)": "時長(秒)", "E: every device keeps the original and can add photos": "E: 每台裝置都保留原始檔並可加入相片", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "每個相簿都是 Immich 集合中的一個收藏集;在「設定 ▸ 同步」中,每台裝置選擇「無」「預覽」或「完整畫質」。", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "每台裝置保留自己的目錄,只會看到允許且選擇取得的收藏集。", "Each of the {n} selected photos gets the reference that fits it": "所選的 {n} 張照片各自使用適合它的參考照片", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "在放大鏡頂部以 100 % 顯示每個人較清晰的那隻眼睛。快速設定列(指向模組名稱旁的空白處)也可切換它。", @@ -2087,6 +2090,7 @@ "Preview in Browser…": "在瀏覽器中預覽…", "Preview: {} checked, {} from Immich, {} to Immich, {} conflicts": "預覽:已檢查 {} 項,從 Immich 拉取 {} 項,推送到 Immich {} 項,衝突 {} 項", "Previewing the Immich sync": "預覽 Immich 同步", + "Previews from Immich to develop here; edits go to your other devices.": "在此處沖印來自 Immich 的預覽;編輯會同步到你的其他裝置。", "Previews to develop here; edits go back.": "在此編修預覽;編輯會傳回。", "Previous": "上一張", "Previous / Next Page": "上一頁 / 下一頁", @@ -2592,6 +2596,7 @@ "Show HSL Color Values": "顯示 HSL 顏色值", "Show Header Bar": "顯示標題列", "Show Hidden Favorites": "顯示隱藏的喜好項目", + "Show Immich albums as collections": "將 Immich 相簿顯示為收藏集", "Show Import Tab Settings": "顯示匯入標籤頁設定", "Show Index Numbers": "顯示索引編號", "Show Info Card": "顯示資訊卡", @@ -2877,6 +2882,7 @@ "The mask's effect on / off": "開 / 關遮色片的效果", "The model is kept on this computer only. {app} never uploads or shares it.": "模型只保存在這台電腦上。{app} 絕不會上傳或分享它。", "The new reference covers its image area too.": "新參考照片也涵蓋它的成像區域。", + "The originals come from Immich; edits go to your other devices.": "原圖來自 Immich;編輯會同步到你的其他裝置。", "The originals come here; edits go back.": "原始檔傳到這裡;編輯會傳回。", "The originals, and photos added here go to the other devices.": "原始檔,以及在此加入的相片會傳送到其他裝置。", "The passphrases differ.": "兩次輸入的密語不一致。", diff --git a/crates/ui-egui/src/panels/connections.rs b/crates/ui-egui/src/panels/connections.rs index 202b904169..bdc259d3ca 100644 --- a/crates/ui-egui/src/panels/connections.rs +++ b/crates/ui-egui/src/panels/connections.rs @@ -1015,6 +1015,7 @@ fn account_card(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, a: &V }); } }); + collections_rows(app, ui, t, i, &id, a); confirm_box(app, ui, t, i, &id, "card"); if app.immich.libraries.contains_key(&id) { extlib(app, ui, t, &id); @@ -1033,6 +1034,32 @@ fn account_card(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, a: &V ui.add_space(4.0); } +/// The account in device sync: its albums as collections (each device picks what it keeps of +/// each in Settings ▸ Sync). +fn collections_rows(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: &str, a: &Value) { + ui.horizontal_wrapped(|ui| { + let mut on = a["collections"] == true; + let c = ui.checkbox(&mut on, crate::i18n::tr("Show Immich albums as collections")); + register(ui.ctx(), format!("check:immichCollections-{i}"), c.rect); + if c.changed() { + let r = app.run("immich.collections", json!({"account": id, "on": on})); + if report(app, ui.ctx(), r) && on { + let _ = app.run("app.settings", json!({"tab": "sync"})); + } + } + if a["collections"] == true && text_button(ui, &format!("immichCollectionsOpen-{i}"), crate::i18n::tr("Choose in Sync…"), false).clicked() { + let _ = app.run("app.settings", json!({"tab": "sync"})); + } + }); + if a["collections"] == true { + ui.label( + RichText::new(crate::i18n::tr("Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.")) + .size(11.0) + .color(t.text_dim), + ); + } +} + /// IMM-SIDECARS: push the catalog's metadata to Immich (whole sidecars for external-library /// folders, the supported fields for managed assets) and pull the sidecars Immich stores back. fn sidecar_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: &str) { diff --git a/crates/ui-egui/src/panels/peer_sync.rs b/crates/ui-egui/src/panels/peer_sync.rs index 46ba358a92..78d91ea505 100644 --- a/crates/ui-egui/src/panels/peer_sync.rs +++ b/crates/ui-egui/src/panels/peer_sync.rs @@ -637,6 +637,8 @@ struct Row { letters: String, pill: Option, photos: u64, + /// An Immich album (listed under "Immich"). + immich: bool, /// How to address it in `sync.allow`/`sync.take`. target: Value, } @@ -679,10 +681,11 @@ fn rows(app: &LccApp, cat: &Value, g: &Value) -> Vec { unfiled = true; } let name = if s(&c, "kind") == "unfiled" { tr("Not in a collection").to_string() } else { s(&c, "name").to_string() }; + let owner = if flag(&c, "immich") { "Immich".to_string() } else { s(&c, "ownerName").to_string() }; out.push(Row { key: id.clone(), name, - owner: s(&c, "ownerName").to_string(), + owner, mine, grant: parse(&c["grant"]).unwrap_or_default(), take: parse(&c["take"]).unwrap_or_default(), @@ -690,6 +693,7 @@ fn rows(app: &LccApp, cat: &Value, g: &Value) -> Vec { letters: s(&c, "letters").to_string(), pill: parse(&c["pill"]), photos: c["photos"].as_u64().unwrap_or(0), + immich: flag(&c, "immich"), target: json!({"collection": id}), }); } @@ -705,6 +709,7 @@ fn rows(app: &LccApp, cat: &Value, g: &Value) -> Vec { letters: "LN".into(), pill: None, photos: 0, + immich: false, target: json!({"unfiled": true}), }); } @@ -723,9 +728,12 @@ fn rows(app: &LccApp, cat: &Value, g: &Value) -> Vec { letters: "LN".into(), pill: None, photos: app.session.catalog.album_count(a.id) as u64, + immich: false, target: json!({"album": a.id.0}), }); } + // the Immich albums last, under their own heading + out.sort_by_key(|r| r.immich); out } @@ -743,7 +751,15 @@ fn collections(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, cat: &Value, g: ui.label(RichText::new(tr(h)).size(11.0).color(t.text_label)); } ui.end_row(); + let mut immich_heading = false; for r in &rows { + if r.immich && !immich_heading { + immich_heading = true; + let h = ui.label(RichText::new(tr("Immich")).strong().color(t.text)); + register(ui.ctx(), "text:syncImmichGroup", h.rect); + ui.label(RichText::new(tr("Albums on your Immich server: choose what this device keeps of each.")).size(11.0).color(t.text_dim)); + ui.end_row(); + } let n = ui.label(RichText::new(&r.name).color(t.text)); register(ui.ctx(), format!("text:syncCollection-{}", r.key), n.rect); ui.label(RichText::new(&r.owner).size(11.0).color(t.text_dim)); @@ -794,6 +810,11 @@ fn picker(ui: &mut egui::Ui, r: &Row) -> Option<(Value, &'static str)> { } } else { for (k, label, why) in TAKES.iter().filter(|(k, _, _)| *k <= r.most) { + let why = match (r.immich, k) { + (true, Take::Previews) => "Previews from Immich to develop here; edits go to your other devices.", + (true, Take::FullQuality) => "The originals come from Immich; edits go to your other devices.", + _ => why, + }; if ui.selectable_label(*k == r.take, tr(label)).clicked() && *k != r.take { out = Some((json!(k.id()), "sync.take")); } diff --git a/docs/changelog/unreleased/2026-11-15-immich-collections.md b/docs/changelog/unreleased/2026-11-15-immich-collections.md index fe39710fd5..2927af0eaa 100644 --- a/docs/changelog/unreleased/2026-11-15-immich-collections.md +++ b/docs/changelog/unreleased/2026-11-15-immich-collections.md @@ -1,3 +1,4 @@ ## Sync - **Device sync keys photos by the SHA-1 of the original:** the same checksum Immich reports, so a device with the file and a device with only an Immich link-only photo agree on the photo. Photos not hashed yet keep their content-hash key until the SHA-1 is known; their record and collection memberships then move to the new key (`Replica::rekey`), and replicas made before this change migrate when the catalog opens. A photo arriving from another device is looked up on connected Immich servers by checksum, so it is linked rather than uploaded twice. +- **Immich albums as device-sync collections:** `immich.collections` lists an account's albums as collections `immich::` under an "Immich" set (grant fixed at Sync). Each device takes None, Previews (link-only) or Full Quality (originals) from Immich; members come from the server on each device, records travel between devices, and a photo added on any device is checked by checksum and uploaded at most once. Device sync names the account by Immich's user id, so devices reaching one server by different URLs share it. A link-only photo whose original is later imported from disk takes the file instead of becoming a second photo. diff --git a/docs/immich.md b/docs/immich.md index 3541706ae4..52289e415f 100644 --- a/docs/immich.md +++ b/docs/immich.md @@ -83,6 +83,13 @@ A file imported from disk whose SHA-1 is the checksum of a link-only photo's ass photo: the link-only photo takes the file as `immich.fetchOriginal` would (`cmd::immich::merge_into_link_only`, called from `library.import`), the new entry is removed, and it joins the import's collection in its place. +## Albums as device-sync collections + +`immich.collections {account, on}` shows an account's albums as collections in device sync; each device picks +None, Previews or Full Quality per album. Design and rules: [sync.md](sync.md) ▸ Immich collections. The +listing, imports and uploads run on workers with activity rows ("Listing Immich albums", "Adding photos to Immich +albums"); `cmd::immich::collections`. + ## External libraries (IMM-EXTLIB) When Immich indexes the same folders as the catalog as an *external library*, nothing is uploaded. Immich does not diff --git a/docs/manual-site/src/content/docs/sync/devices.mdx b/docs/manual-site/src/content/docs/sync/devices.mdx index ddf9334358..cce361aa0e 100644 --- a/docs/manual-site/src/content/docs/sync/devices.mdx +++ b/docs/manual-site/src/content/docs/sync/devices.mdx @@ -46,6 +46,14 @@ A collection created while the whole catalog syncs is asked about at once: share Right-click a collection in the left panel and choose **Sync…** to open this tab. +## Immich albums +If this device is connected to an Immich server, turn on **Show Immich albums as collections** on the account card in **Settings ▸ Connections**. Every album on the server then appears in the *Collections* table under **Immich**, on every device that has the account. + +- Each device picks per album: **None**, **Previews** (Immich's previews to develop here) or **Full Quality** (the originals, downloaded from Immich). +- An album you take appears in the left panel inside the collection set **Immich**. +- Photos come from Immich, not from your other devices; your edits, ratings and labels travel between your devices as usual. +- Add a photo to such a collection on any device and it goes to the Immich album. If Immich already has it (for example the Immich phone app uploaded it), it is linked, not uploaded again. + ## Pills Grid cells (with the other badges) and collection rows show a small pill: two letters and an arrow. @@ -59,7 +67,7 @@ Hover a pill for the same in words. - Virtual copies, versions and history, and the keyword tree don't travel. - Both devices need the same version of the app, and their clocks within five minutes of each other. - Local network only. Importing identical bytes a second time doesn't sync as a new photo. -- Immich collections and the Android camera roll are the next stages. +- The Android camera roll as a collection is the next stage. ## Privacy - Only your paired devices are contacted. Remove every device in **Settings ▸ Sync** to stop. See [Privacy](../../platforms/settings-and-privacy/). diff --git a/docs/manual-site/src/content/docs/sync/immich.mdx b/docs/manual-site/src/content/docs/sync/immich.mdx index 824312e95a..479610414e 100644 --- a/docs/manual-site/src/content/docs/sync/immich.mdx +++ b/docs/manual-site/src/content/docs/sync/immich.mdx @@ -30,6 +30,7 @@ Works with [Immich](https://immich.app) servers, version 3.0 or later. Older ser - A location or capture time you clear here stays cleared (Immich cannot clear one, so its copy keeps the old value). - **Deletions never sync on their own**: they wait in a queue for you to apply or keep; Immich gets them in its trash. A deletion that was undone (the photo restored from Immich's trash) leaves the queue by itself. **Delete Here Too**, **Trash in Immich**, **Delete in Immich Too** and **Disconnect** ask before they act. - **Albums**: link an album by hand, or set the album rule in **Sync…** (off, to Immich, from Immich, two-way). Deleting an album never deletes photos. A collection that also holds photos Immich does not have is never deleted when its Immich album is: it is kept and no longer synced. +- **Albums as collections**: **Show Immich albums as collections** on the account card lists every album as a collection in [Device sync](../devices/), where each device chooses what it keeps. - **Stacks** and Edit In versions: a saved Edit In version is uploaded and stacked on the original. - **People and smart search**: import Immich's faces and names, push names back; search Immich's index (smart, text in image, description, place) and show the result as a collection. - **External libraries**: when Immich indexes the same folders, nothing is uploaded; photos link by path through a path-mapping table. diff --git a/docs/sync.md b/docs/sync.md index 59f006e39a..1b54117c70 100644 --- a/docs/sync.md +++ b/docs/sync.md @@ -57,6 +57,29 @@ A photo that arrives from another device and has a SHA-1 key is looked up on the checksum straight away (the same lookup as for a new import), so an original Immich already has is linked, not uploaded again. A link-only photo doesn't ask other devices for its original: it comes from Immich. +## Immich collections + +- **Immich ▸ Show Immich albums as collections** (`immich.collections {account, on}`) on a device that holds the + account's key: each of its albums becomes a shared collection `immich::` inside the set + `immich:` named "Immich", owner `immich:`, grant fixed at Sync. Every device with the account + writes the same ids, so their copies merge and a renamed album is renamed everywhere. +- Each device takes **None**, **Previews** (link-only previews from Immich) or **Full Quality** (originals from + Immich); Full Sync isn't offered (`Replica::set_take` refuses it). A device that takes an album lists it in the + catalog under the album folder "Immich", created on demand. +- Which photos are in an album comes from the server, on each device that holds the key: the account's albums + are listed on a worker about once a minute (`sync.immichRefresh` at once), and what a device takes is brought in + with the ordinary Immich import (`link` or `copy`) and `immich.fetchOriginal`. Members of Immich collections are + never told to another device (`Replica::tells`) and their files are never fetched from one (`may_fetch`, + `depth_from_peers`); the collection items and the photos' records (develop settings, rating, …) travel as usual. +- A photo added to an Immich collection on any device that takes it is looked up on the server by checksum and + linked if Immich has it (the phone's own upload, another device's), else uploaded once, then put into the album. + A photo taken out of the collection is taken out of the album. An album removed on the server is removed from + every device's list (its photos stay). +- An album folder named "Immich" holds the account's albums; with two accounts there are two such folders. +- **Account identity.** The catalog's links to Immich stay under the local `#` account id. Device sync + names the account by Immich's user id alone (a UUID), so two devices that reach one server by different URLs + (LAN and public) share its collections. + ## Pills Two letters and an arrow (`RF ↓`), no colour: where the original is (**L**ocal, **R**emote, **I**mmich, @@ -93,4 +116,4 @@ Tracked in [gaps.md](gaps.md) (gaps 31–33). Android NSD. - A second import of identical bytes is the same photo, so it doesn't sync as a new one. - Not yet tested between real devices; the tests run two devices over loopback on one machine. -- Next stages: Immich collections (owner `immich:`) and the Android camera roll as collections. +- Next stage: the Android camera roll as a collection. diff --git a/docs/whats-new/2026-11-15-immich-collections.md b/docs/whats-new/2026-11-15-immich-collections.md index 3527c3ebab..174afb3d56 100644 --- a/docs/whats-new/2026-11-15-immich-collections.md +++ b/docs/whats-new/2026-11-15-immich-collections.md @@ -1,4 +1,4 @@ -### One photo, one identity across devices and Immich +### Immich albums as collections, one photo across devices and Immich - Device sync now names a photo by the SHA-1 of its original, the same checksum Immich uses. A device that holds the file and a device that holds only an Immich link see the same photo, never two. @@ -8,3 +8,6 @@ already has is linked instead of uploaded again. - Importing a file you already have as an Immich link-only photo no longer makes a second photo: the Immich photo takes the file and keeps its edits. +- **Show Immich albums as collections** (Settings ▸ Connections) lists every Immich album as a collection in the + Immich set. On each device choose None, Previews or Full Quality in Settings ▸ Sync; photos added on any device + go to the Immich album, uploaded only if Immich doesn't have them yet. From 313c1929e7c7f2eba875b1d186474cf3e298a2b2 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 14:06:42 +1100 Subject: [PATCH 11/15] SYNC-IMMICH: shared vs private Immich connections; the key travels over the peer channel into key storage Manual: sync/devices Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/immich.rs | 9 ++ crates/engine/src/cmd/immich_collections.rs | 96 +++++++++++++++++++ crates/engine/src/device_sync/catalog.rs | 11 ++- crates/engine/src/device_sync/mod.rs | 15 +++ crates/engine/src/device_sync/tests.rs | 55 ++++++++++- crates/sync/src/proto.rs | 40 ++++++++ crates/ui-egui/locales/fork/cs.json | 2 + crates/ui-egui/locales/fork/de.json | 2 + crates/ui-egui/locales/fork/es.json | 2 + crates/ui-egui/locales/fork/fi.json | 2 + crates/ui-egui/locales/fork/fr.json | 2 + crates/ui-egui/locales/fork/id.json | 2 + crates/ui-egui/locales/fork/it.json | 2 + crates/ui-egui/locales/fork/ja.json | 2 + crates/ui-egui/locales/fork/ka.json | 2 + crates/ui-egui/locales/fork/pl.json | 2 + crates/ui-egui/locales/fork/pt-br.json | 2 + crates/ui-egui/locales/fork/ru.json | 2 + crates/ui-egui/locales/fork/sv.json | 2 + crates/ui-egui/locales/fork/uk.json | 2 + crates/ui-egui/locales/fork/vi.json | 2 + crates/ui-egui/locales/fork/zh-hans.json | 2 + crates/ui-egui/locales/fork/zh-hant.json | 2 + crates/ui-egui/src/panels/connections.rs | 14 +++ .../2026-11-15-immich-collections.md | 1 + .../src/content/docs/sync/devices.mdx | 1 + docs/sync.md | 9 ++ .../2026-11-15-immich-collections.md | 2 + 28 files changed, 284 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index 0bcf9bb501..6ff0cda9b5 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -1343,6 +1343,15 @@ fn base_specs() -> Vec { always, collections::set_shown ), + cmd!( + "immich.share", + "Share Immich Connection with Synced Devices", + [], + None, + "{account?, on: bool}: share the connection with the devices this catalog syncs with: its API key goes to them over the encrypted device-sync channel into their key storage (never the catalog, replica, logs or results), and its albums' collections are told to them. off: the connection stays on this device and its collections are not told (devices that already got the key keep it: revoke the key in Immich to stop them) → {account, shared}", + always, + collections::set_shared + ), cmd!(query "immich.status", "Immich Status", [], None, "{check?: bool (also contact each server), background?: bool (do that on workers; results in later calls' `server`)} → {accounts: [{id, url, userName, version, permissions, linked, probable, link, server?, checking}], secretStore, connecting, connected?}", always, status), cmd!(query "immich.answer", "Immich Background Result", [], None, "{key, keep?: bool}: the result of a call made with background: true (immich.libraries, immich.authStatus, immich.unlockSession, immich.scanLibraries, immich.importPeople, immich.pushPeople; they return {started, key}); taken once unless keep → {done: true, result} or {done: false, running}; remote.pump lists the waiting keys in `answers`", always, answer), cmd!(query "immich.authStatus", "Immich Auth Status", [], None, "{account?, background?: bool (on a worker: {started, key}, the result through immich.answer)}: whether this app's server session is elevated (locked folders visible to its listings), and the unlock secrets the account has → {ok, account, isElevated, password, pinCode, expiresAt?, pinExpiresAt?} or {ok: false, error}", always, auth_status), diff --git a/crates/engine/src/cmd/immich_collections.rs b/crates/engine/src/cmd/immich_collections.rs index a3f8fcb143..3eea0e14b6 100644 --- a/crates/engine/src/cmd/immich_collections.rs +++ b/crates/engine/src/cmd/immich_collections.rs @@ -86,6 +86,8 @@ pub(crate) fn tick(s: &mut Session) { if !in_group(s) { return; } + take_shared(s); + offer_shared(s); let accounts = shown(s); if let Some(lib) = &mut s.device_sync.lib { let here: BTreeSet = accounts.iter().map(|(_, u)| u.clone()).collect(); @@ -415,6 +417,100 @@ pub(crate) fn set_shown(s: &mut Session, p: &Value) -> crate::Result { Ok(json!({"account": id, "collections": on})) } +/// The private connections (not shared) are kept from the other devices; the shared ones are +/// read with their keys once, for the next exchange with each device. +fn offer_shared(s: &mut Session) { + let Ok(accs) = s.immich_accounts().map(|a| a.immich.clone()) else { return }; + let private: BTreeSet = accs.iter().filter(|a| !a.shared && !a.user_id.is_empty()).map(|a| a.user_id.clone()).collect(); + let users: Vec = accs.iter().filter(|a| a.shared && !a.user_id.is_empty()).map(|a| a.user_id.clone()).collect(); + let Some(lib) = &mut s.device_sync.lib else { return }; + if lib.replica.private_immich != private { + lib.replica.private_immich = private; + touched(lib); + } + if lib.share_out.as_ref().is_some_and(|(u, _)| *u == users) { + return; + } + let mut out = Vec::new(); + if let Ok(store) = s.secret_store() { + for a in accs.iter().filter(|a| a.shared && !a.user_id.is_empty()) { + if let Ok(Some(key)) = store.get(&lcc_immich::accounts::secret_key(&a.id)) { + out.push(lcc_sync::proto::SharedAccount { + url: a.url.clone(), + user_id: a.user_id.clone(), + user_name: a.user_name.clone(), + key: key.expose().to_string(), + pinned: a.pinned.clone(), + }); + } + } + } + if let Some(lib) = &mut s.device_sync.lib { + lib.share_out = Some((users, out)); + // (a newly shared connection goes to every device again) + lib.share_sent.clear(); + } +} + +/// Connections another device of the group shared: the key goes into this device's key store +/// (never the replica, settings, logs or results), the account into its settings, shared and +/// shown as collections. An account this device already has (same Immich user) is left alone. +fn take_shared(s: &mut Session) { + let incoming = match &mut s.device_sync.lib { + Some(lib) if !lib.share_in.is_empty() => std::mem::take(&mut lib.share_in), + _ => return, + }; + for a in incoming { + let Ok(url) = lcc_immich::client::normalize_url(&a.url) else { continue }; + let have = s.immich_accounts().is_ok_and(|x| x.immich.iter().any(|y| y.user_id == a.user_id)); + if have { + continue; + } + let id = lcc_immich::Account::make_id(&url, &a.user_id); + let stored = s.secret_store().and_then(|st| { + st.set(&lcc_immich::accounts::secret_key(&id), &lcc_credentials::Secret::new(a.key.clone())).map_err(|e| e.to_string()) + }); + if let Err(e) = stored { + log::warn!("sync: a shared Immich connection couldn't be stored: {e}"); + continue; + } + let acc = lcc_immich::Account { + id, + url, + user_id: a.user_id.clone(), + user_name: a.user_name.chars().take(200).collect(), + pinned: a.pinned.clone(), + collections: true, + shared: true, + ..Default::default() + }; + if let Ok(x) = s.immich_accounts() { + x.upsert(acc); + } + if let Err(e) = s.save_accounts() { + log::warn!("sync: {e}"); + } + s.remote.coll.force = true; + } +} + +/// `immich.share {account?, on}`: share the connection (its key included) with the devices this +/// catalog syncs with, or keep it on this device (its collections are then not told). +pub(crate) fn set_shared(s: &mut Session, p: &Value) -> crate::Result { + const C: &str = "immich.share"; + let id = super::account_param(s, p, C)?; + let on = p.get("on").and_then(Value::as_bool).ok_or_else(|| super::bad(C, "missing `on` (true or false)"))?; + let accounts = s.immich_accounts().map_err(|e| super::bad(C, e))?; + let acc = accounts.get_mut(&id).ok_or_else(|| super::bad(C, "no such account"))?; + acc.shared = on; + s.save_accounts().map_err(|e| super::bad(C, e))?; + if let Some(lib) = &mut s.device_sync.lib { + lib.share_out = None; + } + offer_shared(s); + Ok(json!({"account": id, "shared": on})) +} + /// `sync.immichRefresh`: list the Immich albums shown as collections now. pub(crate) fn refresh(s: &mut Session) -> Value { s.remote.coll.force = true; diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index 177c196727..92ec8f5f0c 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -387,7 +387,12 @@ pub(super) fn prepare(s: &Session, lib: &Lib, peer: &str) -> (Batch, Outgoing) { limit = (limit / 4).max(1); continue; } - return (Batch { items, upto: out.upto, more: out.more, ack: None }, out); + // the Immich connections this device shares, once a session to each device of the group + let accounts = match &lib.share_out { + Some((_, a)) if !left && r.in_group_with(peer) && !lib.share_sent.contains(peer) => a.clone(), + _ => Vec::new(), + }; + return (Batch { items, upto: out.upto, more: out.more, ack: None, accounts }, out); } } @@ -401,6 +406,10 @@ pub(super) fn apply(s: &mut Session, lib: &mut Lib, peer: &lcc_peer::Peer, batch { return Err("a photo of the batch is being edited".into()); } + if lib.replica.in_group_with(from) { + let room = lcc_sync::proto::MAX_SHARED.saturating_sub(lib.share_in.len()); + lib.share_in.extend(batch.accounts.iter().filter(|a| a.sane()).take(room).cloned()); + } for item in batch.items.iter().take(MAX_ITEMS * 2) { if let Item::Group(g) = item { let asked = lib.replica.invited.contains(from) || lib.replica.group.as_ref().is_some_and(|mine| mine.devices.contains_key(from)); diff --git a/crates/engine/src/device_sync/mod.rs b/crates/engine/src/device_sync/mod.rs index 4ce0fa8d81..e8486a28c3 100644 --- a/crates/engine/src/device_sync/mod.rs +++ b/crates/engine/src/device_sync/mod.rs @@ -155,6 +155,13 @@ pub(crate) struct Lib { /// Photos added to (true) or taken out of (false) Immich collections here, still to send to /// the server: (collection, key, in). pub immich_out: Vec<(String, String, bool)>, + /// The Immich connections this device shares with the group (user ids, and each with its + /// key, read once from the key store). Memory only: never in the replica file. + pub share_out: Option<(Vec, Vec)>, + /// The devices already sent them in this session. + pub share_sent: HashSet, + /// Connections other devices of the group shared, to store (`immich::collections::tick`). + pub share_in: Vec, /// Each shared collection's photos as the catalogue had them when last looked at. pub base: HashMap>, /// The photos this device should hold more of than it does. @@ -678,6 +685,9 @@ pub(crate) fn ensure_lib(s: &mut Session) { hints: HashMap::new(), immich_here: BTreeSet::new(), immich_out: Vec::new(), + share_out: None, + share_sent: HashSet::new(), + share_in: Vec::new(), base: HashMap::new(), wanting: BTreeSet::new(), missing: HashMap::new(), @@ -1016,6 +1026,11 @@ fn answer_job(s: &mut Session, hub: &Arc, job: Job) { Some(lib) => catalog::prepare(s, lib, &peer), None => (Batch::default(), Outgoing::default()), }; + if !out.0.accounts.is_empty() + && let Some(lib) = &mut s.device_sync.lib + { + lib.share_sent.insert(peer.clone()); + } let _ = reply.send(out); } Job::Confirm { peer, out } => { diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 25068c99cc..0f01f44e13 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -445,7 +445,7 @@ fn hostile_photo_keys_change_nothing() { ], upto: 1, more: false, - ack: None, + ..Default::default() }; let mut l = b.device_sync.lib.take().unwrap(); let _ = super::catalog::apply(&mut b, &mut l, &ap, &batch); @@ -475,7 +475,7 @@ fn a_wrong_claimed_sha1_changes_nothing() { items: vec![lcc_sync::replica::Item::Photo { key: wrong.clone(), info: json!({"content_hash": h}), fields: Default::default(), here: Default::default() }], upto: 1, more: false, - ack: None, + ..Default::default() }; let mut l = b.device_sync.lib.take().unwrap(); super::catalog::apply(&mut b, &mut l, &ap, &batch).unwrap(); @@ -629,3 +629,54 @@ fn immich_albums_are_collections_each_device_takes_as_it_chose() { assert_eq!(a.catalog.photos().count(), 2); let _ = std::fs::remove_dir_all(&dir); } + +/// A private Immich connection's collections stay on its device; shared, its key reaches the +/// other device's key store (only there) and that device lists and takes the albums itself. +#[test] +fn a_shared_immich_connection_reaches_the_other_device_and_a_private_one_does_not() { + use crate::tests_immich::sync_tests::{Server, serve_state}; + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-immich-share"); + let x = crate::tests_immich::png(60); + let mut server = Server::default(); + server.assets.push(crate::tests_immich::asset("as-1", "dog.png", &x, json!({"visibility": "timeline"}))); + server.bytes.insert("as-1".into(), x); + server.albums.push(("al-1".into(), "Pets".into(), vec!["as-1".into()])); + let url = serve_state(std::sync::Arc::new(std::sync::Mutex::new(server)), Default::default(), Default::default()); + let (mut a, ap) = offline(&dir, "a"); + let (mut b, bp) = offline(&dir, "b"); + assert_eq!(a.execute("immich.connect", &json!({"url": url, "apiKey": crate::tests_immich::KEY})).unwrap()["ok"], true); + offline_group(&mut a, &ap, &mut b, &bp); + a.execute("immich.collections", &json!({"on": true})).unwrap(); + a.execute("sync.immichRefresh", &json!({})).unwrap(); + let has = |s: &Session| s.device_sync.lib.as_ref().is_some_and(|l| l.replica.collections.values().any(|e| e.c.meta.v.name == "Pets")); + pump_both(&mut a, &ap, &mut b, &bp, "a's collections", |a, _| has(a)); + for _ in 0..5 { + pump_both(&mut a, &ap, &mut b, &bp, "", |_, _| true); + a.execute("remote.pump", &json!({"sync": false})).unwrap(); + swap(&mut a, &ap, &mut b, &bp); + } + assert!(!has(&b), "a private connection's collections aren't told"); + assert!(b.immich_accounts().unwrap().immich.is_empty(), "nor its key"); + + a.execute("immich.share", &json!({"on": true})).unwrap(); + pump_both(&mut a, &ap, &mut b, &bp, "the shared connection at b", |_, b| has(b)); + let acc = b.immich_accounts().unwrap().immich[0].clone(); + assert!(acc.shared && acc.collections && acc.user_id == "user-1"); + let key = b.secret_store().unwrap().get(&lcc_immich::accounts::secret_key(&acc.id)).unwrap().unwrap(); + assert_eq!(key.expose(), crate::tests_immich::KEY, "the key is in b's key store"); + let replica = serde_json::to_string(&b.device_sync.lib.as_ref().unwrap().replica).unwrap(); + assert!(!replica.contains(crate::tests_immich::KEY), "never in the replica"); + for cmd in ["sync.status", "immich.status"] { + assert!(!b.execute(cmd, &json!({})).unwrap().to_string().contains(crate::tests_immich::KEY), "never in {cmd}"); + } + // b takes the album and brings the photo in from Immich with its own (shared) key + let cid = b.device_sync.lib.as_ref().unwrap().replica.collections.iter().find(|(_, e)| e.c.meta.v.name == "Pets").unwrap().0.clone(); + b.execute("sync.take", &json!({"collection": cid, "take": "previews"})).unwrap(); + b.execute("sync.immichRefresh", &json!({})).unwrap(); + pump_both(&mut a, &ap, &mut b, &bp, "the photo at b", |_, b| album_photos(b, "Pets").len() == 1); + // hostile shared connections are dropped + let bad = lcc_sync::proto::SharedAccount { url: "x".repeat(5000), user_id: String::new(), user_name: String::new(), key: "\u{0}".into(), pinned: None }; + assert!(!bad.sane()); + assert!(!format!("{bad:?}").contains('\u{0}') && format!("{:?}", lcc_sync::proto::SharedAccount { key: "secret-k".into(), ..bad }).contains("")); + let _ = std::fs::remove_dir_all(&dir); +} diff --git a/crates/sync/src/proto.rs b/crates/sync/src/proto.rs index 6bfde18a9d..d16660c944 100644 --- a/crates/sync/src/proto.rs +++ b/crates/sync/src/proto.rs @@ -57,6 +57,46 @@ pub struct Batch { /// The sender took in the other side's batches up to this number of theirs. #[serde(default)] pub ack: Option, + /// Immich connections the sender shares with the group, key and all. Only ever sent over + /// the encrypted, authenticated peer channel, to a device of the group; never stored in the + /// replica. + #[serde(default, skip_serializing_if = "Vec::is_empty")] + pub accounts: Vec, +} + +/// The most shared Immich connections one batch carries, and the longest field taken. +pub const MAX_SHARED: usize = 8; +pub const MAX_SHARED_FIELD: usize = 2048; + +/// An Immich connection one device shares with the others of its group. +#[derive(Clone, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SharedAccount { + pub url: String, + pub user_id: String, + #[serde(default)] + pub user_name: String, + /// The API key. + pub key: String, + /// A certificate fingerprint the sharing device confirmed (self-signed servers). + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pinned: Option, +} + +impl SharedAccount { + /// Whether every field is within bounds (a hostile peer's are dropped). + pub fn sane(&self) -> bool { + let ok = |s: &str| s.len() <= MAX_SHARED_FIELD && !s.chars().any(char::is_control); + !self.url.is_empty() && !self.user_id.is_empty() && self.user_id.len() <= 128 && !self.key.is_empty() + && ok(&self.url) && ok(&self.user_id) && ok(&self.user_name) && ok(&self.key) && self.pinned.as_deref().is_none_or(ok) + } +} + +/// Never prints the key. +impl std::fmt::Debug for SharedAccount { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + f.debug_struct("SharedAccount").field("url", &self.url).field("user_id", &self.user_id).field("key", &"").finish() + } } /// One file asked for. diff --git a/crates/ui-egui/locales/fork/cs.json b/crates/ui-egui/locales/fork/cs.json index 776f318a83..330d8706d8 100644 --- a/crates/ui-egui/locales/fork/cs.json +++ b/crates/ui-egui/locales/fork/cs.json @@ -2482,7 +2482,9 @@ "Share Web Gallery via Immich": "Sdílet webovou galerii přes Immich", "Share the New Collection?": "Sdílet novou kolekci?", "Share via Immich": "Sdílet přes Immich", + "Share with synced devices": "Sdílet se synchronizovanými zařízeními", "Shared Presets and Profiles": "Sdílená přednastavení a profily", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Sdíleno: klíč API tohoto serveru jde přes šifrované spojení do úložiště klíčů zařízení, se kterými se tento katalog synchronizuje, a ta vidí i jeho alba. Vypnuto: připojení a jeho alba zůstávají na tomto zařízení.", "Sharp": "Ostré", "Sharpen for screen": "Doostřit pro obrazovku", "Shortcut": "Zkratka", diff --git a/crates/ui-egui/locales/fork/de.json b/crates/ui-egui/locales/fork/de.json index b2c6290717..7b2074663e 100644 --- a/crates/ui-egui/locales/fork/de.json +++ b/crates/ui-egui/locales/fork/de.json @@ -2355,7 +2355,9 @@ "Share Web Gallery via Immich": "Webgalerie über Immich teilen", "Share the New Collection?": "Die neue Sammlung teilen?", "Share via Immich": "Über Immich teilen", + "Share with synced devices": "Mit synchronisierten Geräten teilen", "Shared Presets and Profiles": "Gemeinsame Vorgaben und Profile", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Geteilt: Der API-Schlüssel dieses Servers geht über die verschlüsselte Verbindung in den Schlüsselspeicher der Geräte, mit denen dieser Katalog synchronisiert, und sie sehen auch seine Alben. Aus: Die Verbindung und ihre Alben bleiben auf diesem Gerät.", "Sharpen for screen": "Für Bildschirm schärfen", "Shortcut": "Tastaturbefehl", "Shortcuts": "Tastenkürzel", diff --git a/crates/ui-egui/locales/fork/es.json b/crates/ui-egui/locales/fork/es.json index c3d8c77bed..2e6139ef8d 100644 --- a/crates/ui-egui/locales/fork/es.json +++ b/crates/ui-egui/locales/fork/es.json @@ -2577,7 +2577,9 @@ "Share Web Gallery via Immich": "Compartir galería web mediante Immich", "Share the New Collection?": "¿Compartir la nueva colección?", "Share via Immich": "Compartir mediante Immich", + "Share with synced devices": "Compartir con los dispositivos sincronizados", "Shared Presets and Profiles": "Ajustes preestablecidos y perfiles compartidos", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Compartida: la clave API de este servidor va, por su conexión cifrada, al almacén de claves de los dispositivos con los que se sincroniza este catálogo, y estos ven también sus álbumes. Desactivada: la conexión y sus álbumes se quedan en este dispositivo.", "Sharpen for screen": "Enfocar para pantalla", "Shortcut": "Atajo", "Shortcuts": "Atajos", diff --git a/crates/ui-egui/locales/fork/fi.json b/crates/ui-egui/locales/fork/fi.json index f6784e3b1b..a8e7d6c479 100644 --- a/crates/ui-egui/locales/fork/fi.json +++ b/crates/ui-egui/locales/fork/fi.json @@ -2645,7 +2645,9 @@ "Share Web Gallery via Immich": "Jaa verkkogalleria Immichin kautta", "Share the New Collection?": "Jaetaanko uusi kokoelma?", "Share via Immich": "Jaa Immichin kautta", + "Share with synced devices": "Jaa synkronoitujen laitteiden kanssa", "Shared Presets and Profiles": "Jaetut esiasetukset ja profiilit", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Jaettu: tämän palvelimen API-avain siirtyy salatun yhteyden kautta niiden laitteiden avainsäilöön, joiden kanssa tämä luettelo synkronoidaan, ja ne näkevät myös sen albumit. Pois: yhteys ja sen albumit pysyvät tällä laitteella.", "Sharp": "Terävä", "Sharpen for screen": "Terävöi näytölle", "Sharper result for a large area": "Terävämpi tulos suurelle alueelle", diff --git a/crates/ui-egui/locales/fork/fr.json b/crates/ui-egui/locales/fork/fr.json index 86032d7c2f..b2833f9a95 100644 --- a/crates/ui-egui/locales/fork/fr.json +++ b/crates/ui-egui/locales/fork/fr.json @@ -2322,7 +2322,9 @@ "Share Web Gallery via Immich": "Partager la galerie Web via Immich", "Share the New Collection?": "Partager la nouvelle collection ?", "Share via Immich": "Partager via Immich", + "Share with synced devices": "Partager avec les appareils synchronisés", "Shared Presets and Profiles": "Préréglages et profils partagés", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Partagé : la clé API de ce serveur va, par leur liaison chiffrée, dans le stockage de clés des appareils avec lesquels ce catalogue se synchronise, et ils voient aussi ses albums. Désactivé : la connexion et ses albums restent sur cet appareil.", "Sharpen for screen": "Accentuer pour l'écran", "Shortcut": "Raccourci", "Shortcuts": "Raccourcis", diff --git a/crates/ui-egui/locales/fork/id.json b/crates/ui-egui/locales/fork/id.json index f50b04b5ec..84e3381942 100644 --- a/crates/ui-egui/locales/fork/id.json +++ b/crates/ui-egui/locales/fork/id.json @@ -2652,7 +2652,9 @@ "Share Web Gallery via Immich": "Bagikan galeri web lewat Immich", "Share the New Collection?": "Bagikan koleksi baru?", "Share via Immich": "Bagikan lewat Immich", + "Share with synced devices": "Bagikan dengan perangkat yang disinkronkan", "Shared Presets and Profiles": "Preset dan profil bersama", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Dibagikan: kunci API server ini dikirim lewat tautan terenkripsi ke penyimpanan kunci perangkat yang disinkronkan dengan katalog ini, dan perangkat itu juga melihat albumnya. Mati: koneksi dan albumnya tetap di perangkat ini.", "Sharp": "Tajam", "Sharpen for screen": "Pertajam untuk layar", "Sharper result for a large area": "Hasil lebih tajam untuk area besar", diff --git a/crates/ui-egui/locales/fork/it.json b/crates/ui-egui/locales/fork/it.json index 1a87698e4d..1086b3c644 100644 --- a/crates/ui-egui/locales/fork/it.json +++ b/crates/ui-egui/locales/fork/it.json @@ -2490,7 +2490,9 @@ "Share Web Gallery via Immich": "Condividi galleria web tramite Immich", "Share the New Collection?": "Condividere la nuova raccolta?", "Share via Immich": "Condividi tramite Immich", + "Share with synced devices": "Condividi con i dispositivi sincronizzati", "Shared Presets and Profiles": "Preset e profili condivisi", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Condivisa: la chiave API di questo server va, tramite il collegamento cifrato, nell’archivio chiavi dei dispositivi con cui si sincronizza questo catalogo, che vedono anche i suoi album. Disattivata: la connessione e i suoi album restano su questo dispositivo.", "Sharp": "Nitido", "Sharpen for screen": "Nitidezza per lo schermo", "Shortcut": "Scorciatoia", diff --git a/crates/ui-egui/locales/fork/ja.json b/crates/ui-egui/locales/fork/ja.json index c82b11c66d..8b3b3c7734 100644 --- a/crates/ui-egui/locales/fork/ja.json +++ b/crates/ui-egui/locales/fork/ja.json @@ -2579,7 +2579,9 @@ "Share Web Gallery via Immich": "Immich で Web ギャラリーを共有", "Share the New Collection?": "新しいコレクションを共有しますか?", "Share via Immich": "Immich で共有", + "Share with synced devices": "同期中のデバイスと共有", "Shared Presets and Profiles": "共有プリセットとプロファイル", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "共有:このサーバーの API キーは暗号化された接続でこのカタログを同期しているデバイスのキー保管場所に送られ、そのデバイスでもアルバムが見えます。オフ:接続とアルバムはこのデバイスだけに残ります。", "Sharpen for screen": "画面用にシャープ", "Shortcut": "ショートカット", "Shortcuts": "ショートカット", diff --git a/crates/ui-egui/locales/fork/ka.json b/crates/ui-egui/locales/fork/ka.json index d21b800da4..aeb67fe0eb 100644 --- a/crates/ui-egui/locales/fork/ka.json +++ b/crates/ui-egui/locales/fork/ka.json @@ -2815,7 +2815,9 @@ "Share Web Gallery via Immich": "ვებ-გალერეის გაზიარება Immich-ით", "Share the New Collection?": "გაზიარდეს ახალი კოლექცია?", "Share via Immich": "გაზიარება Immich-ით", + "Share with synced devices": "გაზიარება სინქრონიზებულ მოწყობილობებთან", "Shared Presets and Profiles": "საერთო პრესეტები და პროფილები", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "გაზიარებული: ამ სერვერის API გასაღები დაშიფრული კავშირით გადადის იმ მოწყობილობების გასაღებების საცავში, რომლებთანაც ეს კატალოგი სინქრონიზდება, და ისინიც ხედავენ მის ალბომებს. გამორთული: კავშირი და მისი ალბომები ამ მოწყობილობაზე რჩება.", "Sharp": "მკვეთრი", "Sharpen for screen": "ეკრანისთვის გამკვეთრება", "Sharper result for a large area": "უფრო მკვეთრი შედეგი დიდი არისთვის", diff --git a/crates/ui-egui/locales/fork/pl.json b/crates/ui-egui/locales/fork/pl.json index 97a169bf12..876711a558 100644 --- a/crates/ui-egui/locales/fork/pl.json +++ b/crates/ui-egui/locales/fork/pl.json @@ -2682,7 +2682,9 @@ "Share Web Gallery via Immich": "Udostępnij galerię internetową przez Immich", "Share the New Collection?": "Udostępnić nową kolekcję?", "Share via Immich": "Udostępnij przez Immich", + "Share with synced devices": "Udostępnij synchronizowanym urządzeniom", "Shared Presets and Profiles": "Wspólne ustawienia wstępne i profile", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Udostępnione: klucz API tego serwera trafia przez szyfrowane połączenie do magazynu kluczy urządzeń, z którymi synchronizuje się ten katalog, i widzą one też jego albumy. Wyłączone: połączenie i jego albumy zostają na tym urządzeniu.", "Sharp": "Ostry", "Sharpen for screen": "Wyostrz dla ekranu", "Shooting Data": "Dane zdjęcia", diff --git a/crates/ui-egui/locales/fork/pt-br.json b/crates/ui-egui/locales/fork/pt-br.json index c05dfbeba3..f4acd0de65 100644 --- a/crates/ui-egui/locales/fork/pt-br.json +++ b/crates/ui-egui/locales/fork/pt-br.json @@ -2578,7 +2578,9 @@ "Share Web Gallery via Immich": "Compartilhar galeria web pelo Immich", "Share the New Collection?": "Compartilhar a nova coleção?", "Share via Immich": "Compartilhar via Immich", + "Share with synced devices": "Compartilhar com os dispositivos sincronizados", "Shared Presets and Profiles": "Predefinições e perfis compartilhados", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Compartilhada: a chave de API deste servidor vai, pela conexão criptografada, para o armazenamento de chaves dos dispositivos com que este catálogo sincroniza, e eles também veem seus álbuns. Desativada: a conexão e seus álbuns ficam neste dispositivo.", "Sharpen for screen": "Nitidez para tela", "Shortcut": "Atalho", "Shortcuts": "Atalhos", diff --git a/crates/ui-egui/locales/fork/ru.json b/crates/ui-egui/locales/fork/ru.json index d598ae866a..931a23fa9c 100644 --- a/crates/ui-egui/locales/fork/ru.json +++ b/crates/ui-egui/locales/fork/ru.json @@ -2581,7 +2581,9 @@ "Share Web Gallery via Immich": "Поделиться веб-галереей через Immich", "Share the New Collection?": "Поделиться новой коллекцией?", "Share via Immich": "Поделиться через Immich", + "Share with synced devices": "Поделиться с синхронизируемыми устройствами", "Shared Presets and Profiles": "Общие пресеты и профили", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Общий доступ: API-ключ этого сервера по зашифрованному каналу попадает в хранилище ключей устройств, с которыми синхронизируется этот каталог, и они тоже видят его альбомы. Выкл.: подключение и его альбомы остаются на этом устройстве.", "Sharpen for screen": "Повысить резкость для экрана", "Shift": "Сдвиг", "Shift by": "Сдвинуть на", diff --git a/crates/ui-egui/locales/fork/sv.json b/crates/ui-egui/locales/fork/sv.json index eb6ca76670..28b254fd14 100644 --- a/crates/ui-egui/locales/fork/sv.json +++ b/crates/ui-egui/locales/fork/sv.json @@ -2714,7 +2714,9 @@ "Share Web Gallery via Immich": "Dela webbgalleri via Immich", "Share the New Collection?": "Dela den nya samlingen?", "Share via Immich": "Dela via Immich", + "Share with synced devices": "Dela med synkroniserade enheter", "Shared Presets and Profiles": "Delade förinställningar och profiler", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Delad: serverns API-nyckel går över den krypterade länken till nyckellagringen på enheterna som den här katalogen synkroniserar med, och de ser också dess album. Av: anslutningen och dess album stannar på den här enheten.", "Sharp": "Skarp", "Sharpen for screen": "Skärpa för skärm", "Sharper result for a large area": "Skarpare resultat för ett stort område", diff --git a/crates/ui-egui/locales/fork/uk.json b/crates/ui-egui/locales/fork/uk.json index a4c6ba04bb..4d50d75746 100644 --- a/crates/ui-egui/locales/fork/uk.json +++ b/crates/ui-egui/locales/fork/uk.json @@ -2464,7 +2464,9 @@ "Share Web Gallery via Immich": "Поділитися вебгалереєю через Immich", "Share the New Collection?": "Поділитися новою колекцією?", "Share via Immich": "Поділитися через Immich", + "Share with synced devices": "Поділитися із синхронізованими пристроями", "Shared Presets and Profiles": "Спільні набори налаштувань і профілі", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Спільне: API-ключ цього сервера зашифрованим каналом потрапляє до сховища ключів пристроїв, з якими синхронізується цей каталог, і вони теж бачать його альбоми. Вимкнено: підключення та його альбоми залишаються на цьому пристрої.", "Sharpen for screen": "Підвищити різкість для екрана", "Shortcut": "Комбінація клавіш", "Shortcuts": "Клавіатурні скорочення", diff --git a/crates/ui-egui/locales/fork/vi.json b/crates/ui-egui/locales/fork/vi.json index dc48d4ce13..69cb3b4890 100644 --- a/crates/ui-egui/locales/fork/vi.json +++ b/crates/ui-egui/locales/fork/vi.json @@ -2848,7 +2848,9 @@ "Share Web Gallery via Immich": "Chia sẻ thư viện ảnh web qua Immich", "Share the New Collection?": "Chia sẻ bộ sưu tập mới?", "Share via Immich": "Chia sẻ qua Immich", + "Share with synced devices": "Chia sẻ với các thiết bị đồng bộ", "Shared Presets and Profiles": "Thiết lập sẵn và hồ sơ dùng chung", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "Chia sẻ: khóa API của máy chủ này được gửi qua kết nối mã hóa vào kho khóa của các thiết bị đồng bộ với danh mục này, và chúng cũng thấy các album. Tắt: kết nối và album chỉ ở trên thiết bị này.", "Sharp": "Nét", "Sharpen for screen": "Làm nét cho màn hình", "Sharper result for a large area": "Kết quả nét hơn cho vùng lớn", diff --git a/crates/ui-egui/locales/fork/zh-hans.json b/crates/ui-egui/locales/fork/zh-hans.json index 8578f99967..d00f7e9d84 100644 --- a/crates/ui-egui/locales/fork/zh-hans.json +++ b/crates/ui-egui/locales/fork/zh-hans.json @@ -2534,7 +2534,9 @@ "Share Web Gallery via Immich": "通过 Immich 共享 Web 画廊", "Share the New Collection?": "共享新收藏夹?", "Share via Immich": "通过 Immich 共享", + "Share with synced devices": "与同步的设备共享", "Shared Presets and Profiles": "共享预设和配置文件", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "共享:此服务器的 API 密钥会通过加密连接存入与此目录同步的设备的密钥存储,这些设备也能看到它的相册。关闭:连接及其相册只留在此设备上。", "Sharpen for screen": "针对屏幕锐化", "Shortcut": "快捷键", "Shortcuts": "快捷键", diff --git a/crates/ui-egui/locales/fork/zh-hant.json b/crates/ui-egui/locales/fork/zh-hant.json index d96a147647..45d44dfe4f 100644 --- a/crates/ui-egui/locales/fork/zh-hant.json +++ b/crates/ui-egui/locales/fork/zh-hant.json @@ -2577,7 +2577,9 @@ "Share Web Gallery via Immich": "透過 Immich 分享網路藝廊", "Share the New Collection?": "共享新收藏集?", "Share via Immich": "透過 Immich 分享", + "Share with synced devices": "與同步的裝置共享", "Shared Presets and Profiles": "共用預設集和描述檔", + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.": "共享:此伺服器的 API 金鑰會透過加密連線存入與此目錄同步的裝置的金鑰儲存區,這些裝置也能看到它的相簿。關閉:連線及其相簿只留在此裝置上。", "Sharpen for screen": "針對螢幕銳利化", "Shortcut": "快速鍵", "Shortcuts": "快速鍵", diff --git a/crates/ui-egui/src/panels/connections.rs b/crates/ui-egui/src/panels/connections.rs index bdc259d3ca..dd2908e407 100644 --- a/crates/ui-egui/src/panels/connections.rs +++ b/crates/ui-egui/src/panels/connections.rs @@ -1051,6 +1051,20 @@ fn collections_rows(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, i let _ = app.run("app.settings", json!({"tab": "sync"})); } }); + let mut shared = a["shared"] == true; + let c = ui.checkbox(&mut shared, crate::i18n::tr("Share with synced devices")); + register(ui.ctx(), format!("check:immichShare-{i}"), c.rect); + if c.changed() { + let r = app.run("immich.share", json!({"account": id, "on": shared})); + report(app, ui.ctx(), r); + } + ui.label( + RichText::new(crate::i18n::tr( + "Shared: this server's API key goes to the devices this catalog syncs with, over their encrypted link, into their key storage, and they see its albums too. Off: the connection and its albums stay on this device.", + )) + .size(11.0) + .color(t.text_dim), + ); if a["collections"] == true { ui.label( RichText::new(crate::i18n::tr("Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.")) diff --git a/docs/changelog/unreleased/2026-11-15-immich-collections.md b/docs/changelog/unreleased/2026-11-15-immich-collections.md index 2927af0eaa..19caebcf7b 100644 --- a/docs/changelog/unreleased/2026-11-15-immich-collections.md +++ b/docs/changelog/unreleased/2026-11-15-immich-collections.md @@ -2,3 +2,4 @@ - **Device sync keys photos by the SHA-1 of the original:** the same checksum Immich reports, so a device with the file and a device with only an Immich link-only photo agree on the photo. Photos not hashed yet keep their content-hash key until the SHA-1 is known; their record and collection memberships then move to the new key (`Replica::rekey`), and replicas made before this change migrate when the catalog opens. A photo arriving from another device is looked up on connected Immich servers by checksum, so it is linked rather than uploaded twice. - **Immich albums as device-sync collections:** `immich.collections` lists an account's albums as collections `immich::` under an "Immich" set (grant fixed at Sync). Each device takes None, Previews (link-only) or Full Quality (originals) from Immich; members come from the server on each device, records travel between devices, and a photo added on any device is checked by checksum and uploaded at most once. Device sync names the account by Immich's user id, so devices reaching one server by different URLs share it. A link-only photo whose original is later imported from disk takes the file instead of becoming a second photo. +- **Shared or private Immich connections:** `immich.share` sends an account and its API key to the group's devices over the encrypted peer channel, into their key storage (never the replica, logs or results); a private account's collections are never told to other devices. diff --git a/docs/manual-site/src/content/docs/sync/devices.mdx b/docs/manual-site/src/content/docs/sync/devices.mdx index cce361aa0e..3e060c9de3 100644 --- a/docs/manual-site/src/content/docs/sync/devices.mdx +++ b/docs/manual-site/src/content/docs/sync/devices.mdx @@ -49,6 +49,7 @@ Right-click a collection in the left panel and choose **Sync…** to open this t ## Immich albums If this device is connected to an Immich server, turn on **Show Immich albums as collections** on the account card in **Settings ▸ Connections**. Every album on the server then appears in the *Collections* table under **Immich**, on every device that has the account. +- **Share with synced devices** on the account card sends the connection, API key included, to the devices this catalog syncs with (over their encrypted link, into their key storage), so they connect to Immich too. Off (the default), the connection and its albums stay on this device. To stop a device that already has the key, revoke the key in Immich. - Each device picks per album: **None**, **Previews** (Immich's previews to develop here) or **Full Quality** (the originals, downloaded from Immich). - An album you take appears in the left panel inside the collection set **Immich**. - Photos come from Immich, not from your other devices; your edits, ratings and labels travel between your devices as usual. diff --git a/docs/sync.md b/docs/sync.md index 1b54117c70..522f89734e 100644 --- a/docs/sync.md +++ b/docs/sync.md @@ -76,6 +76,15 @@ uploaded again. A link-only photo doesn't ask other devices for its original: it A photo taken out of the collection is taken out of the album. An album removed on the server is removed from every device's list (its photos stay). - An album folder named "Immich" holds the account's albums; with two accounts there are two such folders. +- **Shared or private connection.** An account is private to its device unless **Share with synced devices** + (`immich.share {account, on}`) is on. Private: its collections and their photos' records are never told + (`Replica::private_immich`, local state). Shared: the account (URL, user id, name, pinned certificate) and its + API key go to each device of the group in the next exchange (`Batch::accounts`, over the encrypted, + authenticated peer channel only, once per session per device), where the key goes into that device's key + storage (`lcc-credentials`) and the account into its settings, shared and shown as collections. The key is + never written to the replica, journal, logs or command results. A device that already has an account for the + same Immich user keeps its own. Turning sharing off doesn't take the key back from devices that got it: + revoke the key in Immich for that. - **Account identity.** The catalog's links to Immich stay under the local `#` account id. Device sync names the account by Immich's user id alone (a UUID), so two devices that reach one server by different URLs (LAN and public) share its collections. diff --git a/docs/whats-new/2026-11-15-immich-collections.md b/docs/whats-new/2026-11-15-immich-collections.md index 174afb3d56..5b936ed2a0 100644 --- a/docs/whats-new/2026-11-15-immich-collections.md +++ b/docs/whats-new/2026-11-15-immich-collections.md @@ -11,3 +11,5 @@ - **Show Immich albums as collections** (Settings ▸ Connections) lists every Immich album as a collection in the Immich set. On each device choose None, Previews or Full Quality in Settings ▸ Sync; photos added on any device go to the Immich album, uploaded only if Immich doesn't have them yet. +- **Share with synced devices** sends an Immich connection, key included, to your other devices over their + encrypted link; off, the connection and its albums stay on this device. From f21dfeb0516a2da18cb12d65f8f2b332b9f82dc2 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 14:07:26 +1100 Subject: [PATCH 12/15] SYNC-IMMICH: the two-device Immich test shares its connections Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/device_sync/tests.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 0f01f44e13..4af3eb19b9 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -564,6 +564,8 @@ fn immich_albums_are_collections_each_device_takes_as_it_chose() { offline_group(&mut a, &ap, &mut b, &bp); for s in [&mut a, &mut b] { s.execute("immich.collections", &json!({"on": true})).unwrap(); + // (both connected on their own; shared, so the albums' records travel between them) + s.execute("immich.share", &json!({"on": true})).unwrap(); s.execute("sync.immichRefresh", &json!({})).unwrap(); } pump_both(&mut a, &ap, &mut b, &bp, "the album as a collection", |a, b| { From dee5051bf94e2fa28da346c3bc729385e5311d01 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 14:14:19 +1100 Subject: [PATCH 13/15] SYNC-ROLL: Camera Roll - {Device Name} collection watching the camera-roll folder Manual: sync/devices Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/device_sync.rs | 35 +++ crates/engine/src/cmd/immich_collections.rs | 27 ++- crates/engine/src/device_sync/catalog.rs | 11 +- crates/engine/src/device_sync/mod.rs | 14 +- crates/engine/src/device_sync/roll.rs | 228 ++++++++++++++++++ crates/engine/src/device_sync/tests.rs | 62 ++++- crates/sync/src/proto.rs | 11 +- crates/sync/src/replica.rs | 4 + crates/ui-egui/locales/fork/cs.json | 3 + crates/ui-egui/locales/fork/de.json | 3 + crates/ui-egui/locales/fork/es.json | 3 + crates/ui-egui/locales/fork/fi.json | 3 + crates/ui-egui/locales/fork/fr.json | 3 + crates/ui-egui/locales/fork/id.json | 3 + crates/ui-egui/locales/fork/it.json | 3 + crates/ui-egui/locales/fork/ja.json | 3 + crates/ui-egui/locales/fork/ka.json | 3 + crates/ui-egui/locales/fork/pl.json | 3 + crates/ui-egui/locales/fork/pt-br.json | 3 + crates/ui-egui/locales/fork/ru.json | 3 + crates/ui-egui/locales/fork/sv.json | 3 + crates/ui-egui/locales/fork/uk.json | 3 + crates/ui-egui/locales/fork/vi.json | 3 + crates/ui-egui/locales/fork/zh-hans.json | 3 + crates/ui-egui/locales/fork/zh-hant.json | 3 + crates/ui-egui/src/camera_roll.rs | 6 +- crates/ui-egui/src/panels/connections.rs | 8 +- crates/ui-egui/src/panels/peer_sync.rs | 32 +++ .../2026-11-15-immich-collections.md | 1 + .../src/content/docs/sync/devices.mdx | 8 +- docs/sync.md | 17 +- .../2026-11-15-immich-collections.md | 2 + 32 files changed, 492 insertions(+), 25 deletions(-) create mode 100644 crates/engine/src/device_sync/roll.rs diff --git a/crates/engine/src/cmd/device_sync.rs b/crates/engine/src/cmd/device_sync.rs index 597d8992fa..8673eff5c4 100644 --- a/crates/engine/src/cmd/device_sync.rs +++ b/crates/engine/src/cmd/device_sync.rs @@ -90,6 +90,41 @@ pub fn specs() -> Vec { Ok(json!({"listing": 0, "errors": {}})) } }), + cmd!( + "sync.cameraRoll", + "Sync the Camera Roll", + [], + None, + "{on: bool, folder?}: this device's camera roll becomes the collection `Camera Roll - {device name}`, owned by this device and shared like any other: `folder` is watched and imported in place, and the collection holds every photo whose file is in it (on Android the folder is the platform's camera roll, learned from its listing) → {on, folder, collection}", + always, + |s, p| { + #[cfg(not(target_arch = "wasm32"))] + return sync::roll::set(s, p); + #[cfg(target_arch = "wasm32")] + { + let _ = (s, p); + Err(bad("sync.cameraRoll", "there is no camera roll here")) + } + } + ), + cmd!(query "sync.cameraRollScan", "Look in the Camera Roll Now", [], None, "{}: import what is new in the camera-roll folder and file the collection now (also done when the folder changes) → {folder, photos}", always, |s, _p| { + #[cfg(not(target_arch = "wasm32"))] + return Ok(sync::roll::scan_now(s)); + #[cfg(target_arch = "wasm32")] + { + let _ = s; + Ok(json!({"folder": null, "photos": 0})) + } + }), + cmd!(query "sync.cameraRollSeen", "Camera Roll Listed", [], None, "{paths}: the platform listed its camera roll (Android): on a device whose camera roll syncs without a folder of its own, their folder is the roll → {folder}", always, |s, p| { + #[cfg(not(target_arch = "wasm32"))] + return sync::roll::seen(s, p); + #[cfg(target_arch = "wasm32")] + { + let _ = (s, p); + Ok(json!({"folder": null})) + } + }), cmd!(query "sync.now", "Sync Now", [], None, "{}: exchange with every device now → sync.status", always, |s, _p| { sync::sync_now(s); sync::status(s) diff --git a/crates/engine/src/cmd/immich_collections.rs b/crates/engine/src/cmd/immich_collections.rs index 3eea0e14b6..ccbaf75f41 100644 --- a/crates/engine/src/cmd/immich_collections.rs +++ b/crates/engine/src/cmd/immich_collections.rs @@ -78,7 +78,9 @@ fn in_group(s: &Session) -> bool { /// The accounts shown as collections here: `(local id, user id)`. fn shown(s: &mut Session) -> Vec<(String, String)> { - s.immich_accounts().map(|a| a.immich.iter().filter(|x| x.collections && !x.user_id.is_empty()).map(|x| (x.id.clone(), x.user_id.clone())).collect()).unwrap_or_default() + s.immich_accounts() + .map(|a| a.immich.iter().filter(|x| x.collections && !x.user_id.is_empty()).map(|x| (x.id.clone(), x.user_id.clone())).collect()) + .unwrap_or_default() } /// Every frame from `remote.pump`: starts the listings that are due and the uploads waiting. @@ -272,7 +274,11 @@ fn start_push(s: &mut Session, accounts: &[(String, String)]) { let Some((account, _)) = accounts.iter().find(|(_, u)| *u == r.account) else { continue }; let Some(p) = lib.keys.get(&key).and_then(|id| s.catalog.photo(*id)) else { continue }; let linked = s.catalog.remote_of(p.id).find(|x| x.service == SERVICE && x.account_id == *account).map(|x| x.remote_id.clone()); - let push = by_album.entry((account.clone(), r.album.clone())).or_insert_with(|| Push { album: r.album.clone(), add: Vec::new(), remove: Vec::new() }); + let push = by_album.entry((account.clone(), r.album.clone())).or_insert_with(|| Push { + album: r.album.clone(), + add: Vec::new(), + remove: Vec::new(), + }); if on { let path = match &p.source { Source::File { path } if p.preview_only.is_none() => PathBuf::from(path), @@ -310,7 +316,12 @@ fn start_push(s: &mut Session, accounts: &[(String, String)]) { }); } -fn push(client: &lcc_immich::Client, device: &str, pushes: Vec, task: &crate::activity::TaskGuard) -> (Vec<(PhotoId, String, String)>, Option) { +fn push( + client: &lcc_immich::Client, + device: &str, + pushes: Vec, + task: &crate::activity::TaskGuard, +) -> (Vec<(PhotoId, String, String)>, Option) { let mut links = Vec::new(); let mut error = None; for p in pushes { @@ -376,7 +387,9 @@ pub(crate) fn finish_push(s: &mut Session, p: Pushed) { let ops: Vec = p .links .into_iter() - .filter(|(photo, _, _)| s.catalog.photo(*photo).is_some() && !s.catalog.remote_of(*photo).any(|r| r.service == SERVICE && r.account_id == p.account)) + .filter(|(photo, _, _)| { + s.catalog.photo(*photo).is_some() && !s.catalog.remote_of(*photo).any(|r| r.service == SERVICE && r.account_id == p.account) + }) .map(|(photo, asset, sha1)| { lcc_catalog::Catalog::link_remote_op(lcc_catalog::RemoteIdentity { photo_id: photo, @@ -467,9 +480,9 @@ fn take_shared(s: &mut Session) { continue; } let id = lcc_immich::Account::make_id(&url, &a.user_id); - let stored = s.secret_store().and_then(|st| { - st.set(&lcc_immich::accounts::secret_key(&id), &lcc_credentials::Secret::new(a.key.clone())).map_err(|e| e.to_string()) - }); + let stored = s + .secret_store() + .and_then(|st| st.set(&lcc_immich::accounts::secret_key(&id), &lcc_credentials::Secret::new(a.key.clone())).map_err(|e| e.to_string())); if let Err(e) = stored { log::warn!("sync: a shared Immich connection couldn't be stored: {e}"); continue; diff --git a/crates/engine/src/device_sync/catalog.rs b/crates/engine/src/device_sync/catalog.rs index 92ec8f5f0c..161cb5e074 100644 --- a/crates/engine/src/device_sync/catalog.rs +++ b/crates/engine/src/device_sync/catalog.rs @@ -353,8 +353,7 @@ pub(super) fn scan(s: &Session, lib: &mut Lib) -> bool { } None => { let members: BTreeSet<&String> = lib.replica.members.values().flat_map(|m| m.iter().filter(|(_, e)| e.on.v).map(|(k, _)| k)).collect(); - let keys: BTreeSet = - lib.replica.photos.keys().chain(members).filter(|k| lib.keys.contains_key(*k)).cloned().collect(); + let keys: BTreeSet = lib.replica.photos.keys().chain(members).filter(|k| lib.keys.contains_key(*k)).cloned().collect(); for key in keys { changed |= scan_photo(s, lib, &key, now); } @@ -558,9 +557,11 @@ pub(crate) fn reconcile(s: &mut Session, lib: &mut Lib) { !c.gone() && here && match c.kind { - CollectionKind::Set => lib.replica.collections.values().any(|e| { - e.c.meta.v.parent.as_deref() == Some(id.as_str()) && !e.c.gone() && e.c.take_of(&me) != Take::None - }), + CollectionKind::Set => lib + .replica + .collections + .values() + .any(|e| e.c.meta.v.parent.as_deref() == Some(id.as_str()) && !e.c.gone() && e.c.take_of(&me) != Take::None), _ => c.take_of(&me) != Take::None, } } else { diff --git a/crates/engine/src/device_sync/mod.rs b/crates/engine/src/device_sync/mod.rs index e8486a28c3..674dab8a2d 100644 --- a/crates/engine/src/device_sync/mod.rs +++ b/crates/engine/src/device_sync/mod.rs @@ -22,6 +22,8 @@ pub(crate) mod catalog; pub(crate) mod record; +#[cfg(not(target_arch = "wasm32"))] +pub(crate) mod roll; #[cfg(test)] mod tests; mod wire; @@ -162,6 +164,9 @@ pub(crate) struct Lib { pub share_sent: HashSet, /// Connections other devices of the group shared, to store (`immich::collections::tick`). pub share_in: Vec, + /// The camera-roll folder's watch. + #[cfg(not(target_arch = "wasm32"))] + pub roll: roll::RollWatch, /// Each shared collection's photos as the catalogue had them when last looked at. pub base: HashMap>, /// The photos this device should hold more of than it does. @@ -268,7 +273,7 @@ impl State { self.service.as_ref().map(|s| s.device_id()).or_else(|| self.stored().map(|s| s.identity.device_id)) } - fn device_name(&self) -> String { + pub(crate) fn device_name(&self) -> String { self.service.as_ref().map(|s| s.status().name).or_else(|| self.stored().map(|s| s.identity.name)).unwrap_or_else(default_device_name) } @@ -455,6 +460,7 @@ fn catalogue_status(s: &Session, online: &HashSet, paired: &[lcc_peer::P "collections": collections, "undecided": catalog::undecided(s, lib), "unkeyed": catalog::unkeyed(s), + "cameraRoll": r.camera_roll, "photos": s.catalog.photos().count(), }) } @@ -587,6 +593,8 @@ pub(crate) fn rename(s: &mut Session, name: &str) -> Result { } let a = s.activity.clone(); s.device_sync.ensure(&a)?.rename(&name).map_err(other)?; + #[cfg(not(target_arch = "wasm32"))] + roll::renamed(s, &name); status(s) } @@ -688,6 +696,8 @@ pub(crate) fn ensure_lib(s: &mut Session) { share_out: None, share_sent: HashSet::new(), share_in: Vec::new(), + #[cfg(not(target_arch = "wasm32"))] + roll: Default::default(), base: HashMap::new(), wanting: BTreeSet::new(), missing: HashMap::new(), @@ -913,6 +923,8 @@ pub(crate) fn tick(s: &mut Session) -> Result { } s.device_sync.lib = Some(lib); } + #[cfg(not(target_arch = "wasm32"))] + roll::tick(s); let jobs = std::mem::take(&mut *lock(&hub.jobs)); let mut handled = 0; for job in jobs { diff --git a/crates/engine/src/device_sync/roll.rs b/crates/engine/src/device_sync/roll.rs new file mode 100644 index 0000000000..bfaa6761f8 --- /dev/null +++ b/crates/engine/src/device_sync/roll.rs @@ -0,0 +1,228 @@ +//! The camera roll as a collection: `Camera Roll - {Device Name}` (`docs/sync.md` ▸ Camera roll). +//! +//! `sync.cameraRoll {on, folder?}` makes this device's camera-roll collection (kind +//! [`CollectionKind::CameraRoll`], owned by the device, shared like any other collection) and +//! watches `folder`: about every 30 s a worker takes the folder's stamp +//! ([`crate::folder_watch::stamp`]); when it changed, the folder is imported in place (the +//! ordinary import, which skips what the catalog has) and the collection is made to hold every +//! photo of the catalog whose file is in the folder. On Android the folder is DCIM/Camera, which +//! the app learns from the camera-roll listing the platform gives it (`sync.cameraRollSeen`). +//! The collection follows the device's name. +//! +//! Photo identity does the rest of the dedupe: the roll's photos are keyed by the SHA-1 of the +//! original, the same as the Immich app's upload of them, so whichever of the app's own upload, +//! the Immich app's upload, a peer's copy or a later import comes first, it is one photo. + +use std::path::Path; +use std::sync::mpsc::{Receiver, TryRecvError, channel}; +use std::time::{Duration, Instant}; + +use lcc_catalog::{Album, AlbumId, Op, PhotoId, Source}; +use lcc_sync::model::{CollectionKind, Grant}; +use serde_json::{Value, json}; + +use super::{Lib, now_ms, touched}; +use crate::{EngineError, Result, Session}; + +/// How often the folder's stamp is taken. +const EVERY: Duration = Duration::from_secs(30); + +/// The worker taking the folder's stamp, and the last stamp taken. +#[derive(Default)] +pub(crate) struct RollWatch { + pub at: Option, + pub rx: Option>>, + pub stamp: Option, +} + +/// The shared id of this device's camera roll. +pub(crate) fn roll_id(device: &str) -> String { + format!("roll:{device}") +} + +/// The collection's name on a device called `device_name`. +pub(crate) fn roll_name(device_name: &str) -> String { + format!("Camera Roll - {device_name}") +} + +fn other(e: impl std::fmt::Display) -> EngineError { + EngineError::Other(e.to_string()) +} + +/// `sync.cameraRoll {on, folder?}`. +pub(crate) fn set(s: &mut Session, p: &Value) -> Result { + let on = p.get("on").and_then(Value::as_bool).ok_or_else(|| other("missing `on` (true or false)"))?; + let folder = p.get("folder").and_then(Value::as_str).map(str::trim).filter(|f| !f.is_empty()).map(str::to_string); + if folder.as_deref().is_some_and(|f| f.len() > 4096 || f.chars().any(char::is_control)) { + return Err(other("that folder name can't be used")); + } + super::ensure_lib(s); + let name = s.device_sync.device_name(); + let Some(mut lib) = s.device_sync.lib.take() else { return Err(other("only a catalogue on disk syncs")) }; + let out = (|| -> Result { + let me = lib.replica.device.clone(); + if !lib.replica.group.as_ref().is_some_and(|g| g.has(&me)) { + return Err(other(lcc_sync::replica::Refused::NoGroup)); + } + if !on { + lib.replica.camera_roll = None; + return Ok(json!({"on": false})); + } + let folder = match folder { + Some(f) => { + if !Path::new(&f).is_dir() { + return Err(other(format!("`{f}` isn't a folder"))); + } + f + } + // the platform tells where its camera roll is (Android: `sync.cameraRollSeen`) + None if cfg!(target_os = "android") => lib.replica.camera_roll.clone().unwrap_or_default(), + None => return Err(other("choose the folder your camera roll is in (`folder`)")), + }; + ensure_collection(s, &mut lib, &name); + lib.replica.camera_roll = Some(folder.clone()); + lib.roll.stamp = None; + lib.roll.at = None; + Ok(json!({"on": true, "folder": folder, "collection": roll_id(&me)})) + })(); + touched(&mut lib); + lib.revision = None; + s.device_sync.lib = Some(lib); + let v = out?; + if v["on"] == true { + scan_now(s); + } + Ok(v) +} + +/// `sync.cameraRollSeen {paths}`: the platform listed its camera roll; on a device whose camera +/// roll syncs without a folder of its own, the folder they are in is the roll. +pub(crate) fn seen(s: &mut Session, p: &Value) -> Result { + let paths: Vec<&str> = + p.get("paths").and_then(Value::as_array).map(|a| a.iter().filter_map(Value::as_str).take(100_000).collect()).unwrap_or_default(); + let parent = paths.iter().filter_map(|x| Path::new(x).parent()).map(|d| d.to_string_lossy().to_string()).find(|d| !d.is_empty()); + let Some(lib) = &mut s.device_sync.lib else { return Ok(json!({"folder": null})) }; + if let (Some(d), Some(cur)) = (parent, lib.replica.camera_roll.as_mut()) + && cur.is_empty() + { + *cur = d; + lib.roll.stamp = None; + lib.dirty = true; + } + Ok(json!({"folder": lib.replica.camera_roll})) +} + +/// The camera-roll collection and its catalog collection, made when missing. +fn ensure_collection(s: &mut Session, lib: &mut Lib, device_name: &str) { + let id = roll_id(&lib.replica.device); + let mapped = lib.replica.albums.get(&id).copied().filter(|a| s.catalog.album(AlbumId(*a)).is_some()); + let album = match mapped { + Some(a) => a, + None => { + let aid = s.catalog.alloc_album_id(); + if s.apply_system(Op::AddAlbum { album: Album::new(aid, roll_name(device_name)) }).is_err() { + return; + } + lib.replica.asked.insert(aid.0); + aid.0 + } + }; + if lib.replica.collection(&id).is_none() { + lib.replica.add_collection(&id, CollectionKind::CameraRoll, &roll_name(device_name), None, Grant::None, Some(album), now_ms()); + } else { + lib.replica.albums.insert(id, album); + } +} + +/// The device was renamed: its camera roll follows. +pub(crate) fn renamed(s: &mut Session, device_name: &str) { + let Some(lib) = &s.device_sync.lib else { return }; + let id = roll_id(&lib.replica.device); + let Some(a) = lib.replica.albums.get(&id).copied() else { return }; + let name = roll_name(device_name); + if s.catalog.album(AlbumId(a)).is_some_and(|x| x.name != name) { + let _ = s.apply_system(Op::RenameAlbum { id: AlbumId(a), name }); + } +} + +/// Every sync tick: the folder's stamp on a worker; when it changed, the folder is imported. +pub(crate) fn tick(s: &mut Session) { + let Some(lib) = &mut s.device_sync.lib else { return }; + let Some(folder) = lib.replica.camera_roll.clone().filter(|f| !f.is_empty()) else { return }; + if let Some(rx) = &lib.roll.rx { + match rx.try_recv() { + Ok(stamp) => { + lib.roll.rx = None; + if stamp.is_some() && stamp != lib.roll.stamp { + lib.roll.stamp = stamp; + import_and_file(s, &folder); + } + } + Err(TryRecvError::Empty) => {} + Err(TryRecvError::Disconnected) => lib.roll.rx = None, + } + return; + } + if lib.roll.at.is_some_and(|t| t.elapsed() < EVERY) { + return; + } + lib.roll.at = Some(Instant::now()); + let (tx, rx) = channel(); + lib.roll.rx = Some(rx); + let dir = folder.clone(); + if std::thread::Builder::new() + .name("camera-roll".into()) + .spawn(move || { + let _ = tx.send(crate::folder_watch::stamp(&dir)); + }) + .is_err() + { + lib.roll.rx = None; + } +} + +/// `sync.cameraRollScan`: import the folder and file the collection now. +pub(crate) fn scan_now(s: &mut Session) -> Value { + let folder = s.device_sync.lib.as_ref().and_then(|l| l.replica.camera_roll.clone()).filter(|f| !f.is_empty()); + match folder { + Some(f) => { + let n = import_and_file(s, &f); + json!({"folder": f, "photos": n}) + } + None => json!({"folder": null, "photos": 0}), + } +} + +/// Imports what is new in the folder (in place), then makes the collection hold every photo of +/// the catalog whose file is in it. → how many it holds. +fn import_and_file(s: &mut Session, folder: &str) -> usize { + if let Err(e) = s.execute("library.import", &json!({"paths": [folder], "mode": "add"})) { + log::info!("camera roll: {e}"); + } + let name = s.device_sync.device_name(); + let Some(mut lib) = s.device_sync.lib.take() else { return 0 }; + ensure_collection(s, &mut lib, &name); + let id = roll_id(&lib.replica.device); + let mut n = 0; + if let Some(a) = lib.replica.albums.get(&id).copied() { + let mut photos: Vec = s + .catalog + .photos() + .filter(|p| !p.deleted && p.copy_of.is_none() && matches!(&p.source, Source::File { path } if crate::folder_watch::within(path, folder))) + .map(|p| p.id) + .collect(); + photos.sort(); + n = photos.len(); + let differs = s.catalog.album(AlbumId(a)).is_some_and(|al| { + let mut cur = al.photos.clone(); + cur.sort(); + cur != photos + }); + if differs { + let _ = s.apply_system(Op::SetAlbumPhotos { id: AlbumId(a), photos }); + } + } + touched(&mut lib); + s.device_sync.lib = Some(lib); + n +} diff --git a/crates/engine/src/device_sync/tests.rs b/crates/engine/src/device_sync/tests.rs index 4af3eb19b9..a37609d666 100644 --- a/crates/engine/src/device_sync/tests.rs +++ b/crates/engine/src/device_sync/tests.rs @@ -472,7 +472,12 @@ fn a_wrong_claimed_sha1_changes_nothing() { let h = b.catalog.photo(ib).unwrap().content_hash.clone().unwrap(); let wrong = "sha1:a9993e364706816aba3e25717850c26c9cd0d89d".to_string(); let batch = lcc_sync::proto::Batch { - items: vec![lcc_sync::replica::Item::Photo { key: wrong.clone(), info: json!({"content_hash": h}), fields: Default::default(), here: Default::default() }], + items: vec![lcc_sync::replica::Item::Photo { + key: wrong.clone(), + info: json!({"content_hash": h}), + fields: Default::default(), + here: Default::default(), + }], upto: 1, more: false, ..Default::default() @@ -569,7 +574,9 @@ fn immich_albums_are_collections_each_device_takes_as_it_chose() { s.execute("sync.immichRefresh", &json!({})).unwrap(); } pump_both(&mut a, &ap, &mut b, &bp, "the album as a collection", |a, b| { - let names = |s: &Session| s.device_sync.lib.as_ref().is_some_and(|l| l.replica.collections.values().any(|e| e.c.is_immich() && e.c.meta.v.name == "Holiday")); + let names = |s: &Session| { + s.device_sync.lib.as_ref().is_some_and(|l| l.replica.collections.values().any(|e| e.c.is_immich() && e.c.meta.v.name == "Holiday")) + }; names(a) && names(b) }); let v = status(&mut a); @@ -677,8 +684,55 @@ fn a_shared_immich_connection_reaches_the_other_device_and_a_private_one_does_no b.execute("sync.immichRefresh", &json!({})).unwrap(); pump_both(&mut a, &ap, &mut b, &bp, "the photo at b", |_, b| album_photos(b, "Pets").len() == 1); // hostile shared connections are dropped - let bad = lcc_sync::proto::SharedAccount { url: "x".repeat(5000), user_id: String::new(), user_name: String::new(), key: "\u{0}".into(), pinned: None }; + let bad = + lcc_sync::proto::SharedAccount { url: "x".repeat(5000), user_id: String::new(), user_name: String::new(), key: "\u{0}".into(), pinned: None }; assert!(!bad.sane()); - assert!(!format!("{bad:?}").contains('\u{0}') && format!("{:?}", lcc_sync::proto::SharedAccount { key: "secret-k".into(), ..bad }).contains("")); + assert!( + !format!("{bad:?}").contains('\u{0}') + && format!("{:?}", lcc_sync::proto::SharedAccount { key: "secret-k".into(), ..bad }).contains("") + ); + let _ = std::fs::remove_dir_all(&dir); +} + +/// The camera roll is a collection `Camera Roll - {Device Name}` owned by the device: the folder +/// is imported in place, new photos in it join, and the collection follows a rename. +#[test] +fn the_camera_roll_is_a_collection_that_follows_the_device_name() { + let dir = lcc_testkit::TempDir::new("lcc-engine-sync-roll"); + let roll = dir.join("DCIM").join("Camera"); + std::fs::create_dir_all(&roll).unwrap(); + write_png(&roll.join("IMG_1.png"), 31); + write_png(&roll.join("IMG_2.png"), 32); + let (mut a, ap) = offline(&dir, "a"); + let (mut b, bp) = offline(&dir, "b"); + assert!(a.execute("sync.cameraRoll", &json!({"on": true, "folder": roll.to_string_lossy()})).is_err(), "only while syncing"); + offline_group(&mut a, &ap, &mut b, &bp); + assert!(a.execute("sync.cameraRoll", &json!({"on": true})).is_err(), "a folder is needed on a desktop"); + assert!(a.execute("sync.cameraRoll", &json!({"on": true, "folder": dir.join("nope").to_string_lossy()})).is_err()); + assert!(a.execute("sync.cameraRoll", &json!({"on": true, "folder": "bad\u{0}name"})).is_err()); + let v = a.execute("sync.cameraRoll", &json!({"on": true, "folder": roll.to_string_lossy()})).unwrap(); + let name = super::roll::roll_name("a"); + assert_eq!(album_photos(&a, &name).len(), 2, "{v}"); + let cid = v["collection"].as_str().unwrap().to_string(); + let c = a.device_sync.lib.as_ref().unwrap().replica.collection(&cid).unwrap().clone(); + assert_eq!(c.kind, lcc_sync::CollectionKind::CameraRoll); + // shared like any other collection: the other device takes it + a.execute("sync.allow", &json!({"collection": cid, "allow": "preview"})).unwrap(); + swap(&mut a, &ap, &mut b, &bp); + assert!(b.device_sync.lib.as_ref().unwrap().replica.collection(&cid).is_some_and(|c| c.meta.v.name == name)); + // a photo taken later joins + write_png(&roll.join("IMG_3.png"), 33); + assert_eq!(a.execute("sync.cameraRollScan", &json!({})).unwrap()["photos"], 3); + assert_eq!(album_photos(&a, &name).len(), 3); + assert_eq!(a.catalog.photos().count(), 3, "nothing imported twice"); + // the device is renamed: the collection follows, on the other device too + super::roll::renamed(&mut a, "Pixel"); + swap(&mut a, &ap, &mut b, &bp); + assert_eq!(album_photos(&a, "Camera Roll - Pixel").len(), 3); + assert!(b.device_sync.lib.as_ref().unwrap().replica.collection(&cid).is_some_and(|c| c.meta.v.name == "Camera Roll - Pixel")); + // the platform's listing names the folder where none was given (Android) + let r = a.execute("sync.cameraRollSeen", &json!({"paths": [5, "", "\u{0}"]})).unwrap(); + assert_eq!(r["folder"], roll.to_string_lossy().as_ref(), "a folder given stays"); + assert_eq!(a.execute("sync.cameraRoll", &json!({"on": false})).unwrap()["on"], false); let _ = std::fs::remove_dir_all(&dir); } diff --git a/crates/sync/src/proto.rs b/crates/sync/src/proto.rs index d16660c944..d2f4a1864b 100644 --- a/crates/sync/src/proto.rs +++ b/crates/sync/src/proto.rs @@ -87,8 +87,15 @@ impl SharedAccount { /// Whether every field is within bounds (a hostile peer's are dropped). pub fn sane(&self) -> bool { let ok = |s: &str| s.len() <= MAX_SHARED_FIELD && !s.chars().any(char::is_control); - !self.url.is_empty() && !self.user_id.is_empty() && self.user_id.len() <= 128 && !self.key.is_empty() - && ok(&self.url) && ok(&self.user_id) && ok(&self.user_name) && ok(&self.key) && self.pinned.as_deref().is_none_or(ok) + !self.url.is_empty() + && !self.user_id.is_empty() + && self.user_id.len() <= 128 + && !self.key.is_empty() + && ok(&self.url) + && ok(&self.user_id) + && ok(&self.user_name) + && ok(&self.key) + && self.pinned.as_deref().is_none_or(ok) } } diff --git a/crates/sync/src/replica.rs b/crates/sync/src/replica.rs index a380323638..34c4cffaf1 100644 --- a/crates/sync/src/replica.rs +++ b/crates/sync/src/replica.rs @@ -183,6 +183,10 @@ pub struct Replica { /// collections are never told to another device. Local state; it doesn't travel. #[serde(default)] pub private_immich: BTreeSet, + /// The folder this device's camera roll is watched in (`""`: the platform says where). + /// Local state; it doesn't travel. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub camera_roll: Option, #[serde(default)] pub clock: Clock, #[serde(default)] diff --git a/crates/ui-egui/locales/fork/cs.json b/crates/ui-egui/locales/fork/cs.json index 330d8706d8..19940ac06b 100644 --- a/crates/ui-egui/locales/fork/cs.json +++ b/crates/ui-egui/locales/fork/cs.json @@ -1946,6 +1946,8 @@ "Photos exported as a catalog": "Fotografie exportované jako katalog", "Photos imported": "Fotografie importovány", "Photos imported from now on; photos already in the catalog keep theirs.": "Fotografie importované od této chvíle; fotografie již v katalogu si ponechají svá nastavení.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Fotky z fotoaparátu jdou do sbírky „Camera Roll - název tohoto zařízení“.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Fotky ve složce {folder} jdou do sbírky „Camera Roll - název tohoto zařízení“.", "Photos that use the old reference keep it.": "Fotografie, které používají starou referenci, si ji ponechají.", "Photos whose capture time can't be read were left as they were": "Fotografie, jejichž čas pořízení nelze přečíst, zůstaly beze změny", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Fotografie, jejichž soubor metadat změnil jiný program: uložení nahradí tyto změny údaji z katalogu.", @@ -2686,6 +2688,7 @@ "Sync With This Catalog": "Synchronizovat s tímto katalogem", "Sync conflicts ({})": "Konflikty synchronizace ({})", "Sync this catalog": "Synchronizovat tento katalog", + "Sync this device's camera roll": "Synchronizovat fotoaparát tohoto zařízení", "Sync: Devices or Immich": "Synchronizace: zařízení nebo Immich", "Synchronize Copies": "Synchronizace kopií", "Synchronize Settings": "Synchronizovat nastavení", diff --git a/crates/ui-egui/locales/fork/de.json b/crates/ui-egui/locales/fork/de.json index 7b2074663e..eca3823ddb 100644 --- a/crates/ui-egui/locales/fork/de.json +++ b/crates/ui-egui/locales/fork/de.json @@ -1852,6 +1852,8 @@ "Photos exported as a catalog": "Als Katalog exportierte Fotos", "Photos imported": "Importierte Fotos", "Photos imported from now on; photos already in the catalog keep theirs.": "Ab jetzt importierte Fotos; Fotos, die bereits im Katalog sind, behalten ihre.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Fotos der Kamerarolle kommen in die Sammlung „Camera Roll - Name dieses Geräts“.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Fotos in {folder} kommen in die Sammlung „Camera Roll - Name dieses Geräts“.", "Photos that use the old reference keep it.": "Fotos, die die alte Referenz verwenden, behalten sie.", "Photos whose capture time can't be read were left as they were": "Fotos, deren Aufnahmezeit nicht lesbar ist, blieben unverändert", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Fotos, deren Metadatendatei ein anderes Programm geändert hat: Speichern ersetzt diese Änderungen durch die des Katalogs.", @@ -2554,6 +2556,7 @@ "Sync With This Catalog": "Mit diesem Katalog synchronisieren", "Sync conflicts ({})": "Synchronisierungskonflikte ({})", "Sync this catalog": "Diesen Katalog synchronisieren", + "Sync this device's camera roll": "Kamerarolle dieses Geräts synchronisieren", "Sync: Devices or Immich": "Synchronisierung: Geräte oder Immich", "Synchronize Copies": "Kopien synchronisieren", "Synchronize Settings": "Einstellungen synchronisieren", diff --git a/crates/ui-egui/locales/fork/es.json b/crates/ui-egui/locales/fork/es.json index 2e6139ef8d..e794d8e3cb 100644 --- a/crates/ui-egui/locales/fork/es.json +++ b/crates/ui-egui/locales/fork/es.json @@ -2019,6 +2019,8 @@ "Photos imported": "Fotos importadas", "Photos imported from now on; photos already in the catalog keep theirs.": "Las fotos importadas a partir de ahora; las que ya están en el catálogo conservan el que tienen.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Las fotos en Eliminados recientemente se pueden restaurar desde la app: clic derecho → Restaurar (o Eliminar permanentemente), también en el", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Las fotos del carrete van a la colección «Camera Roll - nombre de este dispositivo».", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Las fotos de {folder} van a la colección «Camera Roll - nombre de este dispositivo».", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "Las fotos se quedan en Todas las fotos. Eliminar una carpeta también elimina sus álbumes. Puedes deshacerlo.", "Photos that use the old reference keep it.": "Las fotos que usan la referencia antigua la conservan.", "Photos whose capture time can't be read were left as they were": "Las fotos cuya hora de captura no se puede leer se dejaron como estaban", @@ -2798,6 +2800,7 @@ "Sync With This Catalog": "Sincronizar con este catálogo", "Sync conflicts ({})": "Conflictos de sincronización ({})", "Sync this catalog": "Sincronizar este catálogo", + "Sync this device's camera roll": "Sincronizar el carrete de este dispositivo", "Sync: Devices or Immich": "Sincronización: dispositivos o Immich", "Synchronize Copies": "Sincronizar copias", "Synchronize Settings": "Sincronizar ajustes", diff --git a/crates/ui-egui/locales/fork/fi.json b/crates/ui-egui/locales/fork/fi.json index a8e7d6c479..86ad092858 100644 --- a/crates/ui-egui/locales/fork/fi.json +++ b/crates/ui-egui/locales/fork/fi.json @@ -2051,6 +2051,8 @@ "Photos exported as a catalog": "Katalogina viedyt kuvat", "Photos imported": "Tuodut kuvat", "Photos imported from now on; photos already in the catalog keep theirs.": "Tästä lähtien tuotavat kuvat; katalogissa jo olevat kuvat säilyttävät omansa.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Kamerarullan kuvat menevät kokoelmaan ”Camera Roll - tämän laitteen nimi”.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Kansion {folder} kuvat menevät kokoelmaan ”Camera Roll - tämän laitteen nimi”.", "Photos that use the old reference keep it.": "Vanhaa viitekuvaa käyttävät kuvat säilyttävät sen.", "Photos whose capture time can't be read were left as they were": "Kuvat, joiden kuvausaikaa ei voi lukea, jätettiin ennalleen", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Kuvat, joiden metatietotiedostoa toinen ohjelma on muuttanut: tallentaminen korvaa nämä muutokset katalogin tiedoilla.", @@ -2868,6 +2870,7 @@ "Sync With This Catalog": "Synkronoi tämän katalogin kanssa", "Sync conflicts ({})": "Synkronoinnin ristiriidat ({})", "Sync this catalog": "Synkronoi tämä katalogi", + "Sync this device's camera roll": "Synkronoi tämän laitteen kamerarulla", "Sync: Devices or Immich": "Synkronointi: laitteet tai Immich", "Synchronize Copies": "Synkronoi kopiot", "Synchronize Folder": "Synkronoi kansio", diff --git a/crates/ui-egui/locales/fork/fr.json b/crates/ui-egui/locales/fork/fr.json index b2833f9a95..88b4d1d00f 100644 --- a/crates/ui-egui/locales/fork/fr.json +++ b/crates/ui-egui/locales/fork/fr.json @@ -1814,6 +1814,8 @@ "Photos imported": "Photos importées", "Photos imported from now on; photos already in the catalog keep theirs.": "Les photos importées à partir de maintenant ; celles déjà dans le catalogue gardent le leur.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Les photos de Récemment supprimés peuvent être restaurées depuis l’application : clic droit → Restaurer (ou Supprimer définitivement), aussi dans le", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Les photos de la pellicule vont dans la collection « Camera Roll - nom de cet appareil ».", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Les photos de {folder} vont dans la collection « Camera Roll - nom de cet appareil ».", "Photos that use the old reference keep it.": "Les photos qui utilisent l’ancienne référence la conservent.", "Photos whose capture time can't be read were left as they were": "Les photos dont l’heure de prise de vue est illisible ont été laissées telles quelles", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Photos dont un autre programme a modifié le fichier de métadonnées : l’enregistrement remplace ces modifications par celles du catalogue.", @@ -2523,6 +2525,7 @@ "Sync With This Catalog": "Synchroniser avec ce catalogue", "Sync conflicts ({})": "Conflits de synchronisation ({})", "Sync this catalog": "Synchroniser ce catalogue", + "Sync this device's camera roll": "Synchroniser la pellicule de cet appareil", "Sync: Devices or Immich": "Synchronisation : appareils ou Immich", "Synchronize Copies": "Synchroniser les copies", "Synchronize Settings": "Synchroniser les paramètres", diff --git a/crates/ui-egui/locales/fork/id.json b/crates/ui-egui/locales/fork/id.json index 84e3381942..971d9907ba 100644 --- a/crates/ui-egui/locales/fork/id.json +++ b/crates/ui-egui/locales/fork/id.json @@ -2071,6 +2071,8 @@ "Photos exported as a catalog": "Foto diekspor sebagai katalog", "Photos imported": "Foto diimpor", "Photos imported from now on; photos already in the catalog keep theirs.": "Foto yang diimpor mulai sekarang; foto yang sudah ada di katalog mempertahankan pengaturannya.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Foto di rol kamera masuk ke koleksi “Camera Roll - nama perangkat ini”.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Foto di {folder} masuk ke koleksi “Camera Roll - nama perangkat ini”.", "Photos that use the old reference keep it.": "Foto yang memakai referensi lama tetap menyimpannya.", "Photos whose capture time can't be read were left as they were": "Foto yang waktu pengambilannya tidak dapat dibaca dibiarkan seperti semula", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Foto yang file metadatanya diubah program lain: menyimpan akan mengganti perubahan itu dengan data katalog.", @@ -2873,6 +2875,7 @@ "Sync With This Catalog": "Sinkronkan dengan katalog ini", "Sync conflicts ({})": "Konflik sinkronisasi ({})", "Sync this catalog": "Sinkronkan katalog ini", + "Sync this device's camera roll": "Sinkronkan rol kamera perangkat ini", "Sync: Devices or Immich": "Sinkronisasi: perangkat atau Immich", "Synchronize Copies": "Sinkronkan Salinan", "Synchronize Settings": "Sinkronkan pengaturan", diff --git a/crates/ui-egui/locales/fork/it.json b/crates/ui-egui/locales/fork/it.json index 1086b3c644..4a23dd2c59 100644 --- a/crates/ui-egui/locales/fork/it.json +++ b/crates/ui-egui/locales/fork/it.json @@ -1947,6 +1947,8 @@ "Photos exported as a catalog": "Foto esportate come catalogo", "Photos imported": "Foto importate", "Photos imported from now on; photos already in the catalog keep theirs.": "Le foto importate da ora in poi; quelle già nel catalogo mantengono la loro impostazione.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Le foto del rullino vanno nella raccolta «Camera Roll - nome di questo dispositivo».", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Le foto in {folder} vanno nella raccolta «Camera Roll - nome di questo dispositivo».", "Photos that use the old reference keep it.": "Le foto che usano il vecchio riferimento lo mantengono.", "Photos whose capture time can't be read were left as they were": "Le foto di cui non si può leggere l'ora di scatto sono state lasciate com'erano", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Foto il cui file dei metadati è stato modificato da un altro programma: il salvataggio sostituisce quelle modifiche con quelle del catalogo.", @@ -2695,6 +2697,7 @@ "Sync With This Catalog": "Sincronizza con questo catalogo", "Sync conflicts ({})": "Conflitti di sincronizzazione ({})", "Sync this catalog": "Sincronizza questo catalogo", + "Sync this device's camera roll": "Sincronizza il rullino di questo dispositivo", "Sync: Devices or Immich": "Sincronizzazione: dispositivi o Immich", "Synchronize Copies": "Sincronizza copie", "Synchronize Settings": "Sincronizza impostazioni", diff --git a/crates/ui-egui/locales/fork/ja.json b/crates/ui-egui/locales/fork/ja.json index 8b3b3c7734..c9e8b376aa 100644 --- a/crates/ui-egui/locales/fork/ja.json +++ b/crates/ui-egui/locales/fork/ja.json @@ -2023,6 +2023,8 @@ "Photos imported": "読み込んだ写真", "Photos imported from now on; photos already in the catalog keep theirs.": "今後読み込む写真に適用されます。カタログにある写真はそれぞれの設定を保ちます。", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "最近削除した項目の写真はアプリから復元できます: 右クリック → 復元(または完全に削除)、また", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "カメラロールの写真はコレクション「Camera Roll - このデバイスの名前」に入ります。", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} の写真はコレクション「Camera Roll - このデバイスの名前」に入ります。", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "写真は「すべての写真」に残ります。フォルダーを削除すると、その中のアルバムも削除されます。この操作は取り消せます。", "Photos that use the old reference keep it.": "古い参照写真を使っている写真はそのまま使い続けます。", "Photos whose capture time can't be read were left as they were": "撮影日時を読み取れない写真は、そのままにしました", @@ -2799,6 +2801,7 @@ "Sync With This Catalog": "このカタログと同期", "Sync conflicts ({})": "同期の競合({})", "Sync this catalog": "このカタログを同期", + "Sync this device's camera roll": "このデバイスのカメラロールを同期", "Sync: Devices or Immich": "同期:デバイスまたは Immich", "Synchronize Copies": "コピーを同期", "Synchronize Folder": "フォルダーを同期", diff --git a/crates/ui-egui/locales/fork/ka.json b/crates/ui-egui/locales/fork/ka.json index aeb67fe0eb..3a44ac4c70 100644 --- a/crates/ui-egui/locales/fork/ka.json +++ b/crates/ui-egui/locales/fork/ka.json @@ -2194,6 +2194,8 @@ "Photos exported as a catalog": "კატალოგად ექსპორტირებული ფოტოები", "Photos imported": "ფოტოები იმპორტირებულია", "Photos imported from now on; photos already in the catalog keep theirs.": "ამიერიდან იმპორტირებული ფოტოები; კატალოგში უკვე არსებული ფოტოები თავისას ინარჩუნებს.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "კამერის ფოტოები გადადის კოლექციაში „Camera Roll - ამ მოწყობილობის სახელი“.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder}-ის ფოტოები გადადის კოლექციაში „Camera Roll - ამ მოწყობილობის სახელი“.", "Photos that use the old reference keep it.": "ფოტოები, რომლებიც ძველ საცნობარო ფოტოს იყენებენ, შეინარჩუნებენ მას.", "Photos whose capture time can't be read were left as they were": "ფოტოები, რომელთა გადაღების დროის წაკითხვა ვერ მოხერხდა, უცვლელი დარჩა", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "ფოტოები, რომელთა მეტამონაცემების ფაილი სხვა პროგრამამ შეცვალა: შენახვა ამ ცვლილებებს კატალოგის მონაცემებით ჩაანაცვლებს.", @@ -3054,6 +3056,7 @@ "Sync With This Catalog": "ამ კატალოგთან სინქრონიზაცია", "Sync conflicts ({})": "სინქრონიზაციის კონფლიქტები ({})", "Sync this catalog": "ამ კატალოგის სინქრონიზაცია", + "Sync this device's camera roll": "ამ მოწყობილობის კამერის ალბომის სინქრონიზაცია", "Sync: Devices or Immich": "სინქრონიზაცია: მოწყობილობები ან Immich", "Synchronize Copies": "ასლების სინქრონიზაცია", "Synchronize Settings": "პარამეტრების სინქრონიზაცია", diff --git a/crates/ui-egui/locales/fork/pl.json b/crates/ui-egui/locales/fork/pl.json index 876711a558..4b6544082a 100644 --- a/crates/ui-egui/locales/fork/pl.json +++ b/crates/ui-egui/locales/fork/pl.json @@ -2111,6 +2111,8 @@ "Photos exported as a catalog": "Zdjęcia wyeksportowane jako katalog", "Photos imported": "Zaimportowane zdjęcia", "Photos imported from now on; photos already in the catalog keep theirs.": "Zdjęcia importowane od teraz; zdjęcia już obecne w katalogu zachowują swoje ustawienia.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Zdjęcia z rolki aparatu trafiają do kolekcji „Camera Roll - nazwa tego urządzenia”.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Zdjęcia z {folder} trafiają do kolekcji „Camera Roll - nazwa tego urządzenia”.", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "Zdjęcia pozostają we Wszystkich zdjęciach. Usunięcie folderu usuwa też jego albumy. Możesz to cofnąć.", "Photos that use the old reference keep it.": "Zdjęcia używające starego odniesienia zachowują je.", "Photos whose capture time can't be read were left as they were": "Zdjęcia, których czasu wykonania nie da się odczytać, pozostawiono bez zmian", @@ -2905,6 +2907,7 @@ "Sync With This Catalog": "Synchronizuj z tym katalogiem", "Sync conflicts ({})": "Konflikty synchronizacji ({})", "Sync this catalog": "Synchronizuj ten katalog", + "Sync this device's camera roll": "Synchronizuj rolkę aparatu tego urządzenia", "Sync: Devices or Immich": "Synchronizacja: urządzenia lub Immich", "Synchronize Copies": "Synchronizuj kopie", "Synchronize Settings": "Synchronizuj ustawienia", diff --git a/crates/ui-egui/locales/fork/pt-br.json b/crates/ui-egui/locales/fork/pt-br.json index f4acd0de65..28976b88ad 100644 --- a/crates/ui-egui/locales/fork/pt-br.json +++ b/crates/ui-egui/locales/fork/pt-br.json @@ -2022,6 +2022,8 @@ "Photos imported": "Fotos importadas", "Photos imported from now on; photos already in the catalog keep theirs.": "Fotos importadas daqui em diante; as fotos já no catálogo mantêm as suas.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Fotos em Excluídos recentemente podem ser restauradas no app: clique com o botão direito → Restaurar (ou Excluir permanentemente), também no", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "As fotos do rolo da câmera vão para a coleção “Camera Roll - nome deste dispositivo”.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "As fotos em {folder} vão para a coleção “Camera Roll - nome deste dispositivo”.", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "As fotos continuam em Todas as fotos. Excluir uma pasta também exclui seus álbuns. Você pode desfazer isto.", "Photos that use the old reference keep it.": "As fotos que usam a referência antiga a mantêm.", "Photos whose capture time can't be read were left as they were": "Fotos cuja hora de captura não pode ser lida ficaram como estavam", @@ -2797,6 +2799,7 @@ "Sync With This Catalog": "Sincronizar com este catálogo", "Sync conflicts ({})": "Conflitos de sincronização ({})", "Sync this catalog": "Sincronizar este catálogo", + "Sync this device's camera roll": "Sincronizar o rolo da câmera deste dispositivo", "Sync: Devices or Immich": "Sincronização: dispositivos ou Immich", "Synchronize Copies": "Sincronizar cópias", "Synchronize Settings": "Sincronizar configurações", diff --git a/crates/ui-egui/locales/fork/ru.json b/crates/ui-egui/locales/fork/ru.json index 931a23fa9c..1bfea4664d 100644 --- a/crates/ui-egui/locales/fork/ru.json +++ b/crates/ui-egui/locales/fork/ru.json @@ -2025,6 +2025,8 @@ "Photos imported": "Импортировано фото", "Photos imported from now on; photos already in the catalog keep theirs.": "Фото, импортируемые с этого момента; фото, уже находящиеся в каталоге, сохраняют свои.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Фото из Недавно удалённых можно восстановить в приложении: правый щелчок → Восстановить (или Удалить навсегда), также в", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Фото из фотоплёнки попадают в коллекцию «Camera Roll - имя этого устройства».", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Фото из {folder} попадают в коллекцию «Camera Roll - имя этого устройства».", "Photos per bracket (0 = auto)": "Фото в брекетинге (0 = авто)", "Photos that use the old reference keep it.": "Фото, использующие старый эталон, сохраняют его.", "Photos whose capture time can't be read were left as they were": "Фото, время съёмки которых не удалось прочитать, оставлены как есть", @@ -2795,6 +2797,7 @@ "Sync With This Catalog": "Синхронизировать с этим каталогом", "Sync conflicts ({})": "Конфликты синхронизации ({})", "Sync this catalog": "Синхронизировать этот каталог", + "Sync this device's camera roll": "Синхронизировать фотоплёнку этого устройства", "Sync: Devices or Immich": "Синхронизация: устройства или Immich", "Synchronize Copies": "Синхронизация копий", "Synchronize Folder": "Синхронизировать папку", diff --git a/crates/ui-egui/locales/fork/sv.json b/crates/ui-egui/locales/fork/sv.json index 28b254fd14..b9fee0d469 100644 --- a/crates/ui-egui/locales/fork/sv.json +++ b/crates/ui-egui/locales/fork/sv.json @@ -2115,6 +2115,8 @@ "Photos exported as a catalog": "Foton exporterade som katalog", "Photos imported": "Foton importerade", "Photos imported from now on; photos already in the catalog keep theirs.": "Foton som importeras från och med nu; foton som redan finns i katalogen behåller sin inställning.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Bilder i kamerarullen hamnar i samlingen ”Camera Roll - den här enhetens namn”.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Bilder i {folder} hamnar i samlingen ”Camera Roll - den här enhetens namn”.", "Photos that use the old reference keep it.": "Foton som använder den gamla referensen behåller den.", "Photos whose capture time can't be read were left as they were": "Foton vars tagningstid inte kan läsas lämnades som de var", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Foton vars metadatafil har ändrats av ett annat program: sparande ersätter de ändringarna med katalogens.", @@ -2940,6 +2942,7 @@ "Sync With This Catalog": "Synka med den här katalogen", "Sync conflicts ({})": "Synkkonflikter ({})", "Sync this catalog": "Synka den här katalogen", + "Sync this device's camera roll": "Synkronisera den här enhetens kamerarulle", "Sync: Devices or Immich": "Synkning: enheter eller Immich", "Synchronize Copies": "Synkronisera kopior", "Synchronize Settings": "Synkronisera inställningar", diff --git a/crates/ui-egui/locales/fork/uk.json b/crates/ui-egui/locales/fork/uk.json index 4d50d75746..06fc660806 100644 --- a/crates/ui-egui/locales/fork/uk.json +++ b/crates/ui-egui/locales/fork/uk.json @@ -1917,6 +1917,8 @@ "Photos exported as a catalog": "Фото, експортовані як каталог", "Photos imported": "Імпортовано фото", "Photos imported from now on; photos already in the catalog keep theirs.": "Фото, імпортовані відтепер; фото, які вже є в каталозі, зберігають свої.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Фото з фотоплівки потрапляють до колекції «Camera Roll - назва цього пристрою».", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Фото з {folder} потрапляють до колекції «Camera Roll - назва цього пристрою».", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "Фото залишаються в «Усіх фото». Видалення теки видаляє і її альбоми. Цю дію можна скасувати.", "Photos that use the old reference keep it.": "Фото, що використовують старий еталон, зберігають його.", "Photos whose capture time can't be read were left as they were": "Фото, час зйомки яких не вдалося прочитати, залишилися без змін", @@ -2670,6 +2672,7 @@ "Sync With This Catalog": "Синхронізувати з цим каталогом", "Sync conflicts ({})": "Конфлікти синхронізації ({})", "Sync this catalog": "Синхронізувати цей каталог", + "Sync this device's camera roll": "Синхронізувати фотоплівку цього пристрою", "Sync: Devices or Immich": "Синхронізація: пристрої або Immich", "Synchronize Copies": "Синхронізація копій", "Synchronize Settings": "Синхронізувати налаштування", diff --git a/crates/ui-egui/locales/fork/vi.json b/crates/ui-egui/locales/fork/vi.json index 69cb3b4890..4a70e11bf7 100644 --- a/crates/ui-egui/locales/fork/vi.json +++ b/crates/ui-egui/locales/fork/vi.json @@ -2223,6 +2223,8 @@ "Photos exported as a catalog": "Ảnh đã xuất thành catalog", "Photos imported": "Ảnh đã nhập", "Photos imported from now on; photos already in the catalog keep theirs.": "Ảnh nhập từ bây giờ; ảnh đã có trong catalog giữ thiết lập của chúng.", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Ảnh trong thư viện máy ảnh được đưa vào bộ sưu tập “Camera Roll - tên thiết bị này”.", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Ảnh trong {folder} được đưa vào bộ sưu tập “Camera Roll - tên thiết bị này”.", "Photos that use the old reference keep it.": "Các ảnh đang dùng ảnh tham chiếu cũ vẫn giữ nó.", "Photos whose capture time can't be read were left as they were": "Ảnh không đọc được thời gian chụp được giữ nguyên", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Ảnh có tệp siêu dữ liệu bị chương trình khác thay đổi: lưu sẽ thay các thay đổi đó bằng nội dung của catalog.", @@ -3093,6 +3095,7 @@ "Sync With This Catalog": "Đồng bộ với catalog này", "Sync conflicts ({})": "Xung đột đồng bộ ({})", "Sync this catalog": "Đồng bộ catalog này", + "Sync this device's camera roll": "Đồng bộ thư viện ảnh máy ảnh của thiết bị này", "Sync: Devices or Immich": "Đồng bộ: thiết bị hoặc Immich", "Synchronize Copies": "Đồng bộ bản sao", "Synchronize Settings": "Đồng bộ hóa cài đặt", diff --git a/crates/ui-egui/locales/fork/zh-hans.json b/crates/ui-egui/locales/fork/zh-hans.json index d00f7e9d84..a122c11647 100644 --- a/crates/ui-egui/locales/fork/zh-hans.json +++ b/crates/ui-egui/locales/fork/zh-hans.json @@ -1981,6 +1981,8 @@ "Photos imported": "已导入的照片", "Photos imported from now on; photos already in the catalog keep theirs.": "从现在起导入的照片;目录中已有的照片保持原有设置。", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "“最近删除”中的照片可在应用内恢复:右键 → 恢复(或永久删除),也可在", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "相机胶卷中的照片会放入收藏集“Camera Roll - 此设备名称”。", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} 中的照片会放入收藏集“Camera Roll - 此设备名称”。", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "照片仍保留在“所有照片”中。删除文件夹也会删除其中的相册。此操作可以撤销。", "Photos that use the old reference keep it.": "使用旧参考照片的照片会保留它。", "Photos whose capture time can't be read were left as they were": "无法读取拍摄时间的照片已保持原样", @@ -2751,6 +2753,7 @@ "Sync With This Catalog": "与此目录同步", "Sync conflicts ({})": "同步冲突({})", "Sync this catalog": "同步此目录", + "Sync this device's camera roll": "同步此设备的相机胶卷", "Sync: Devices or Immich": "同步:设备或 Immich", "Synchronize Copies": "同步副本", "Synchronize Settings": "同步设置", diff --git a/crates/ui-egui/locales/fork/zh-hant.json b/crates/ui-egui/locales/fork/zh-hant.json index 45d44dfe4f..a5395e3ea5 100644 --- a/crates/ui-egui/locales/fork/zh-hant.json +++ b/crates/ui-egui/locales/fork/zh-hant.json @@ -2022,6 +2022,8 @@ "Photos imported": "已匯入的照片", "Photos imported from now on; photos already in the catalog keep theirs.": "從現在起匯入的照片;目錄中已有的照片保留其原本設定。", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "“最近刪除”中的照片可在應用內恢復:右鍵 → 恢復(或永久刪除),也可在", + "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "相機膠卷中的照片會放入收藏集「Camera Roll - 此裝置名稱」。", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} 中的照片會放入收藏集「Camera Roll - 此裝置名稱」。", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "照片會保留在「所有照片」中。刪除資料夾也會刪除其中的相簿。此動作可以復原。", "Photos that use the old reference keep it.": "使用舊參考照片的照片會保留它。", "Photos whose capture time can't be read were left as they were": "無法讀取拍攝時間的照片維持原狀", @@ -2796,6 +2798,7 @@ "Sync With This Catalog": "與此目錄同步", "Sync conflicts ({})": "同步衝突({})", "Sync this catalog": "同步此目錄", + "Sync this device's camera roll": "同步此裝置的相機膠卷", "Sync: Devices or Immich": "同步:裝置或 Immich", "Synchronize Copies": "同步副本", "Synchronize Folder": "同步檔案夾", diff --git a/crates/ui-egui/src/camera_roll.rs b/crates/ui-egui/src/camera_roll.rs index 666dd3bd6a..1ab5ead490 100644 --- a/crates/ui-egui/src/camera_roll.rs +++ b/crates/ui-egui/src/camera_roll.rs @@ -140,7 +140,11 @@ fn watch_collect(app: &mut LccApp, ctx: &egui::Context) { }; app.pending_camera_roll_watch = None; match answer { - Ok(paths) => import_new(app, paths), + Ok(paths) => { + // device sync's camera-roll collection learns where the platform keeps the roll + let _ = app.session.execute("sync.cameraRollSeen", &serde_json::json!({"paths": paths.iter().take(16).collect::>()})); + import_new(app, paths) + } // a watch that can't read the roll says so in the log, not in a toast every few minutes Err(e) => log::warn!("camera roll watch: {e}"), } diff --git a/crates/ui-egui/src/panels/connections.rs b/crates/ui-egui/src/panels/connections.rs index dd2908e407..29cf48f51c 100644 --- a/crates/ui-egui/src/panels/connections.rs +++ b/crates/ui-egui/src/panels/connections.rs @@ -1067,9 +1067,11 @@ fn collections_rows(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, i ); if a["collections"] == true { ui.label( - RichText::new(crate::i18n::tr("Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.")) - .size(11.0) - .color(t.text_dim), + RichText::new(crate::i18n::tr( + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.", + )) + .size(11.0) + .color(t.text_dim), ); } } diff --git a/crates/ui-egui/src/panels/peer_sync.rs b/crates/ui-egui/src/panels/peer_sync.rs index 78d91ea505..dec2f14dae 100644 --- a/crates/ui-egui/src/panels/peer_sync.rs +++ b/crates/ui-egui/src/panels/peer_sync.rs @@ -238,6 +238,7 @@ fn this_device(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, st: &Value) { RichText::new(tr("Another device nearby has this name too: give this one another.")).size(11.0).color(t.caution), ); } + camera_roll_row(app, ui, t, st); if flag(st, "pairingsLost") { crate::dialog_frame::note( ui, @@ -246,6 +247,37 @@ fn this_device(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, st: &Value) { } } +/// This device's camera roll as the collection `Camera Roll - {name}` (while the catalog syncs). +fn camera_roll_row(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, st: &Value) { + let cat = &st["catalogue"]; + if cat["group"].is_null() { + return; + } + let mut on = !cat["cameraRoll"].is_null(); + let c = ui.checkbox(&mut on, tr("Sync this device's camera roll")); + register(ui.ctx(), "check:syncCameraRoll", c.rect); + if c.changed() { + if !on { + run(app, "roll", "sync.cameraRoll", json!({"on": false})); + } else if cfg!(target_os = "android") { + run(app, "roll", "sync.cameraRoll", json!({"on": true})); + } else if let Some(folder) = app.services.pick_folder.as_mut().and_then(|f| f()) { + run(app, "roll", "sync.cameraRoll", json!({"on": true, "folder": folder})); + } + if let Ok(v) = app.session.execute("sync.status", &json!({})) { + app.peer_sync.status = v; + } + } + let folder = cat["cameraRoll"].as_str().unwrap_or_default(); + let line = if folder.is_empty() { + tr("Photos in the camera roll go into the collection “Camera Roll - this device's name”.").to_string() + } else { + tr_format!("Photos in {folder} go into the collection “Camera Roll - this device's name”.", folder = folder) + }; + super::settings::hint(ui, t, &line); + error_line(app, ui, t, "roll"); +} + // ── devices ──────────────────────────────────────────────────────────────────────────────── fn devices(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, st: &Value, now: f64) { diff --git a/docs/changelog/unreleased/2026-11-15-immich-collections.md b/docs/changelog/unreleased/2026-11-15-immich-collections.md index 19caebcf7b..cc91b10cfc 100644 --- a/docs/changelog/unreleased/2026-11-15-immich-collections.md +++ b/docs/changelog/unreleased/2026-11-15-immich-collections.md @@ -3,3 +3,4 @@ - **Device sync keys photos by the SHA-1 of the original:** the same checksum Immich reports, so a device with the file and a device with only an Immich link-only photo agree on the photo. Photos not hashed yet keep their content-hash key until the SHA-1 is known; their record and collection memberships then move to the new key (`Replica::rekey`), and replicas made before this change migrate when the catalog opens. A photo arriving from another device is looked up on connected Immich servers by checksum, so it is linked rather than uploaded twice. - **Immich albums as device-sync collections:** `immich.collections` lists an account's albums as collections `immich::` under an "Immich" set (grant fixed at Sync). Each device takes None, Previews (link-only) or Full Quality (originals) from Immich; members come from the server on each device, records travel between devices, and a photo added on any device is checked by checksum and uploaded at most once. Device sync names the account by Immich's user id, so devices reaching one server by different URLs share it. A link-only photo whose original is later imported from disk takes the file instead of becoming a second photo. - **Shared or private Immich connections:** `immich.share` sends an account and its API key to the group's devices over the encrypted peer channel, into their key storage (never the replica, logs or results); a private account's collections are never told to other devices. +- **Camera roll collection:** `sync.cameraRoll` watches a folder (on Android, the camera roll the app already lists) and keeps a device-owned collection `Camera Roll - {Device Name}` that follows renames; photo identity by SHA-1 keeps it free of duplicates with the Immich app's uploads. diff --git a/docs/manual-site/src/content/docs/sync/devices.mdx b/docs/manual-site/src/content/docs/sync/devices.mdx index 3e060c9de3..f3f7b5b9cb 100644 --- a/docs/manual-site/src/content/docs/sync/devices.mdx +++ b/docs/manual-site/src/content/docs/sync/devices.mdx @@ -55,6 +55,13 @@ If this device is connected to an Immich server, turn on **Show Immich albums as - Photos come from Immich, not from your other devices; your edits, ratings and labels travel between your devices as usual. - Add a photo to such a collection on any device and it goes to the Immich album. If Immich already has it (for example the Immich phone app uploaded it), it is linked, not uploaded again. +## Camera roll +Turn on **Sync this device's camera roll** under *This Device* (while the catalog syncs). On a computer, choose the folder your phone's photos arrive in; on Android it is the phone's camera roll. + +- New photos in the folder are imported as they arrive and go into the collection **Camera Roll - ‹this device's name›**; it is renamed with the device. +- Share it from the *Collections* table like any other collection. +- If the Immich app also uploads your camera roll, nothing is stored twice: the same photo is recognised by its checksum, whichever arrives first. + ## Pills Grid cells (with the other badges) and collection rows show a small pill: two letters and an arrow. @@ -68,7 +75,6 @@ Hover a pill for the same in words. - Virtual copies, versions and history, and the keyword tree don't travel. - Both devices need the same version of the app, and their clocks within five minutes of each other. - Local network only. Importing identical bytes a second time doesn't sync as a new photo. -- The Android camera roll as a collection is the next stage. ## Privacy - Only your paired devices are contacted. Remove every device in **Settings ▸ Sync** to stop. See [Privacy](../../platforms/settings-and-privacy/). diff --git a/docs/sync.md b/docs/sync.md index 522f89734e..0fbe259eb9 100644 --- a/docs/sync.md +++ b/docs/sync.md @@ -89,6 +89,22 @@ uploaded again. A link-only photo doesn't ask other devices for its original: it names the account by Immich's user id alone (a UUID), so two devices that reach one server by different URLs (LAN and public) share its collections. +## Camera roll + +- **Settings ▸ Sync ▸ This Device ▸ Sync this device's camera roll** (`sync.cameraRoll {on, folder?}`) makes the + collection `Camera Roll - {Device Name}` (id `roll:`, kind `cameraRoll`), owned by the device and shared + like any other collection (grant None until the person allows it). It follows the device's name. +- The folder is watched: a worker takes its stamp about every 30 s; when it changed, the folder is imported in place + (the ordinary import, which skips what the catalog has) and the collection holds every photo whose file is in the + folder (`sync.cameraRollScan` does it now). On a desktop the folder is chosen; on Android the app's camera-roll + watch (MediaStore listing of DCIM/Camera through `crates/android-host`) tells the folder with + `sync.cameraRollSeen`, so no new platform code was needed. +- No duplicates with the Immich app: a roll photo is keyed by its SHA-1, as is the Immich app's upload of it. If + Immich has it first, the checksum lookup after import links it; if the app uploads it first (added to an Immich + collection), the Immich app's later upload is a duplicate Immich refuses; a device that sees it only through + Immich (link-only) and a device that gets the file from a peer hold the same key, so the photo is one photo + everywhere, and a later import of the file onto a link-only photo makes it take the file. + ## Pills Two letters and an arrow (`RF ↓`), no colour: where the original is (**L**ocal, **R**emote, **I**mmich, @@ -125,4 +141,3 @@ Tracked in [gaps.md](gaps.md) (gaps 31–33). Android NSD. - A second import of identical bytes is the same photo, so it doesn't sync as a new one. - Not yet tested between real devices; the tests run two devices over loopback on one machine. -- Next stage: the Android camera roll as a collection. diff --git a/docs/whats-new/2026-11-15-immich-collections.md b/docs/whats-new/2026-11-15-immich-collections.md index 5b936ed2a0..660f1bbcad 100644 --- a/docs/whats-new/2026-11-15-immich-collections.md +++ b/docs/whats-new/2026-11-15-immich-collections.md @@ -13,3 +13,5 @@ go to the Immich album, uploaded only if Immich doesn't have them yet. - **Share with synced devices** sends an Immich connection, key included, to your other devices over their encrypted link; off, the connection and its albums stay on this device. +- **Sync this device's camera roll** (Settings ▸ Sync) puts new photos into the collection "Camera Roll - ‹device›", + without duplicates when the Immich app uploads them too. From e75f2b57dee1bbd7e63b0b85b48bbc67469a7ca4 Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 14:25:44 +1100 Subject: [PATCH 14/15] SYNC-IMMICH: remove the name-matching Immich album rule (linkAlbum, syncAlbums); migrate it to albums as collections Manual: sync/immich Co-Authored-By: Claude Opus 5.5 --- crates/engine/src/cmd/immich.rs | 3 - crates/engine/src/cmd/immich_publish.rs | 493 +--------------- crates/engine/src/cmd/immich_sync.rs | 23 +- crates/engine/src/remote.rs | 2 - crates/engine/src/tests_immich_sync.rs | 182 +----- crates/immich/src/accounts.rs | 12 +- crates/immich/src/albums.rs | 557 ------------------ crates/immich/src/lib.rs | 1 - crates/immich/src/sync.rs | 10 +- crates/immich/src/tests.rs | 10 + crates/ui-egui/locales/fork/cs-formats.json | 1 + crates/ui-egui/locales/fork/cs.json | 9 +- crates/ui-egui/locales/fork/de-formats.json | 1 + crates/ui-egui/locales/fork/de.json | 9 +- crates/ui-egui/locales/fork/es-formats.json | 1 + crates/ui-egui/locales/fork/es.json | 9 +- crates/ui-egui/locales/fork/fi-formats.json | 1 + crates/ui-egui/locales/fork/fi.json | 9 +- crates/ui-egui/locales/fork/fr-formats.json | 1 + crates/ui-egui/locales/fork/fr.json | 9 +- crates/ui-egui/locales/fork/id-formats.json | 1 + crates/ui-egui/locales/fork/id.json | 9 +- crates/ui-egui/locales/fork/it-formats.json | 1 + crates/ui-egui/locales/fork/it.json | 9 +- crates/ui-egui/locales/fork/ja-formats.json | 1 + crates/ui-egui/locales/fork/ja.json | 9 +- crates/ui-egui/locales/fork/ka-formats.json | 1 + crates/ui-egui/locales/fork/ka.json | 9 +- crates/ui-egui/locales/fork/pl-formats.json | 1 + crates/ui-egui/locales/fork/pl.json | 9 +- .../ui-egui/locales/fork/pt-br-formats.json | 1 + crates/ui-egui/locales/fork/pt-br.json | 9 +- crates/ui-egui/locales/fork/ru-formats.json | 3 +- crates/ui-egui/locales/fork/ru.json | 9 +- crates/ui-egui/locales/fork/sv-formats.json | 1 + crates/ui-egui/locales/fork/sv.json | 9 +- crates/ui-egui/locales/fork/uk-formats.json | 3 +- crates/ui-egui/locales/fork/uk.json | 9 +- crates/ui-egui/locales/fork/vi-formats.json | 1 + crates/ui-egui/locales/fork/vi.json | 9 +- .../ui-egui/locales/fork/zh-hans-formats.json | 1 + crates/ui-egui/locales/fork/zh-hans.json | 9 +- .../ui-egui/locales/fork/zh-hant-formats.json | 1 + crates/ui-egui/locales/fork/zh-hant.json | 9 +- crates/ui-egui/src/panels/connections.rs | 113 +--- crates/ui-egui/src/tests_immich_ui.rs | 5 +- .../2026-11-15-immich-collections.md | 1 + docs/immich.md | 32 +- .../src/content/docs/sync/immich.mdx | 3 +- docs/parity-checklist.md | 2 +- .../2026-11-15-immich-collections.md | 2 + 51 files changed, 189 insertions(+), 1436 deletions(-) delete mode 100644 crates/immich/src/albums.rs diff --git a/crates/engine/src/cmd/immich.rs b/crates/engine/src/cmd/immich.rs index 6ff0cda9b5..cf6ba5521b 100644 --- a/crates/engine/src/cmd/immich.rs +++ b/crates/engine/src/cmd/immich.rs @@ -920,9 +920,6 @@ pub fn pump(s: &mut Session, p: &Value) -> Result { Msg::Synced(d) => { sync::finish(s, *d); } - Msg::AlbumsSynced(d) => { - publish::finish_albums(s, *d); - } Msg::Sidecars(d) => { sidecars::finish(s, *d); } diff --git a/crates/engine/src/cmd/immich_publish.rs b/crates/engine/src/cmd/immich_publish.rs index 2ff33d334d..6029c2237a 100644 --- a/crates/engine/src/cmd/immich_publish.rs +++ b/crates/engine/src/cmd/immich_publish.rs @@ -1,24 +1,22 @@ -//! IMM-PUBLISH wiring (the service itself is `lcc_immich::publish`) and the collections ↔ albums -//! part of IMM-SYNC. +//! IMM-PUBLISH wiring (the service itself is `lcc_immich::publish`). //! //! - [`opener`]: for a publish run of an Immich service, reads the account's key and what the //! service needs per photo (capture time, original file, existing Immich link) on the session //! thread, and hands the publish framework a function that opens the service on its worker. -//! - `immich.linkAlbum` / `immich.syncAlbums`: a catalog album linked to an Immich album keeps the -//! same linked photos on both sides (a set three-way merge against the last sync, like keywords). +//! +//! Immich albums meet the catalog as device-sync collections (`immich_collections.rs`); the +//! name-matching album rule (`immich.linkAlbum`, `immich.syncAlbums`) was replaced by them. -use std::collections::{BTreeSet, HashMap}; +use std::collections::HashMap; -use lcc_catalog::{AlbumId, PhotoId, Source}; +use lcc_catalog::{PhotoId, Source}; use lcc_immich::link::SERVICE; use lcc_immich::publish::{ImmichPublish, PhotoInfo, PublishSettings, SendMode}; use lcc_publish::{CollectionConfig, PublishError, PublishService, ServiceConfig}; -use serde::Serialize; -use serde_json::{Value, json}; +use serde_json::Value; -use super::{account_param, failure}; -use crate::cmd::{CommandSpec, always, bad, bool_or, cmd, str_param}; -use crate::{Result, Session}; +use crate::Session; +use crate::cmd::CommandSpec; /// Opens a publish service on a worker thread. pub type Opener = Box std::result::Result, PublishError> + Send>; @@ -129,477 +127,6 @@ pub fn check_settings(settings: &Value) -> std::result::Result<(), String> { Ok(()) } -// ---- collections ↔ albums - -use lcc_immich::albums::{self as plan_albums, LocalAlbum, LocalOp, PendingDelete, RemoteAlbum, RemoteOp}; -pub use lcc_immich::albums::{AlbumLink, AlbumLinks}; -use lcc_immich::sync::{Direction, FieldRule}; - -fn sync_file(s: &Session, account: &str, ext: &str) -> Option { - let name: String = account.chars().map(|c| if c.is_ascii_alphanumeric() || c == '-' || c == '.' { c } else { '_' }).take(150).collect(); - s.immich_dir().map(|d| d.join("sync").join(format!("{name}.{ext}"))) -} - -fn load_json(path: Option) -> T { - path.and_then(|p| std::fs::read(p).ok()).and_then(|b| serde_json::from_slice(&b).ok()).unwrap_or_default() -} - -fn save_json(path: Option, v: &T) -> std::result::Result<(), String> { - let Some(p) = path else { return Ok(()) }; - if let Some(d) = p.parent() { - std::fs::create_dir_all(d).map_err(|e| format!("{}: {e}", d.display()))?; - } - // temp file + rename; a failed write (full disk) removes the temp file - let body = serde_json::to_vec(v).map_err(|e| e.to_string())?; - lcc_catalog::safe_file::write_atomic(&p, &body).map_err(|e| format!("{}: {e}", p.display())) -} - -fn load_links(s: &Session, account: &str) -> AlbumLinks { - load_json(sync_file(s, account, "albums.json")) -} - -fn save_links(s: &Session, account: &str, l: &AlbumLinks) -> std::result::Result<(), String> { - save_json(sync_file(s, account, "albums.json"), l) -} - -pub(crate) fn load_pending(s: &Session, account: &str) -> Vec { - load_json(sync_file(s, account, "album-deletes.json")) -} - -fn save_pending(s: &Session, account: &str, p: &[PendingDelete]) -> std::result::Result<(), String> { - save_json(sync_file(s, account, "album-deletes.json"), p) -} - -/// The set three-way merge: kept when both have it, or one side added it since `base`. -pub fn merge_sets(base: Option<&BTreeSet>, l: &BTreeSet, r: &BTreeSet) -> BTreeSet { - match base { - None => l.union(r).cloned().collect(), - Some(b) => l.union(r).filter(|k| (l.contains(*k) && r.contains(*k)) || !b.contains(*k)).cloned().collect(), - } -} - -fn link_album(s: &mut Session, p: &Value) -> Result { - const C: &str = "immich.linkAlbum"; - let id = account_param(s, p, C)?; - let album = p.get("album").and_then(Value::as_u64).ok_or_else(|| bad(C, "missing `album` (catalog album id)"))?; - let al = s.catalog.album(AlbumId(album)).ok_or_else(|| bad(C, "no such album"))?; - if al.folder || al.smart.is_some() { - return Err(bad(C, "only plain albums hold photos")); - } - if let Some(x) = str_param(p, "immichAlbum") - && x.trim().is_empty() - { - return Err(bad(C, "`immichAlbum` is empty (omit it to use the Immich album of the same name)")); - } - let name = al.name.clone(); - let mut links = load_links(s, &id); - if bool_or(p, "unlink", false) { - links.remove(&album); - save_links(s, &id, &links).map_err(|e| bad(C, e))?; - return Ok(json!({"unlinked": album})); - } - let (_, client) = match s.immich_client(&id) { - Ok(x) => x, - Err(e) => return Ok(failure(&e)), - }; - let target = match str_param(p, "immichAlbum") { - Some(x) => x.to_string(), - None => { - let found = match client.albums() { - Ok(a) => a.into_iter().find(|a| a.album_name == name).map(|a| a.id), - Err(e) => return Ok(failure(&e)), - }; - match found { - Some(x) => x, - None => match client.create_album(&name) { - Ok(a) => a.id, - Err(e) => return Ok(failure(&e)), - }, - } - } - }; - links.insert(album, AlbumLink { immich: target.clone(), base: None, name: None }); - save_links(s, &id, &links).map_err(|e| bad(C, e))?; - Ok(json!({"ok": true, "album": album, "immichAlbum": target})) -} - -/// Catalog albums that never map to Immich albums: folders, smart albums, the Quick Collection, -/// and published collections (and everything below a publish service's set: publish owns those). -fn unsyncable(s: &Session) -> BTreeSet { - let mut roots = BTreeSet::new(); - if let Some(dir) = s.library.as_ref().filter(|l| l.on_disk).map(|l| l.dir.clone()) - && let Ok(cfg) = lcc_publish::PublishConfig::load(&dir) - { - for svc in &cfg.services { - roots.extend(svc.set.map(|x| x.0)); - roots.extend(svc.collections.iter().map(|c| c.album.0)); - } - } - let mut out = BTreeSet::new(); - for al in s.catalog.albums() { - let mut skip = al.folder || al.smart.is_some() || al.quick || roots.contains(&al.id.0); - let mut next = al.parent; - // bounded: a damaged catalog can't loop - for _ in 0..32 { - let Some(p) = next.filter(|_| !skip) else { break }; - skip = roots.contains(&p.0); - next = s.catalog.album(p).and_then(|a| a.parent); - } - if skip { - out.insert(al.id.0); - } - } - out -} - -/// What an album sync worker gets. -struct AlbumJob { - account: String, - dry_run: bool, - rule: FieldRule, - local: Vec, - links: AlbumLinks, - pending: Vec, - /// The account's linked assets (only these count as album members). - linked: BTreeSet, - /// The links file of the library the run was started in. - home: Option, -} - -/// What it brings back. -pub(crate) struct AlbumsDone { - account: String, - dry_run: bool, - old: AlbumLinks, - plan: plan_albums::Plan, - /// Immich albums the run created: catalog album → new Immich album id, and the assets known - /// to be in it (those the server took; none when the add after the create failed). - created: Vec<(u64, String, BTreeSet)>, - errors: Vec, - fatal: Option, - home: Option, -} - -/// Start an album run: the catalog side here, the server on a worker (`background`) or inline. -pub(crate) fn start_albums(s: &mut Session, account: &str, dry_run: bool, background: bool) -> Result { - if s.remote.sync.get(account).is_some_and(|a| a.albums_running) { - return Ok(json!({"started": false, "reason": "an album sync of this account is already running"})); - } - let rule = s.immich_accounts().ok().and_then(|a| a.get(account).map(|x| x.sync.album_rule())).unwrap_or_default(); - let links = load_links(s, account); - if rule.direction == Direction::Off && links.is_empty() { - return Ok(json!({"ok": true, "albums": 0, "changes": {"toImmich": [], "toCatalog": []}})); - } - let (_, client) = match s.immich_client(account) { - Ok(x) => x, - Err(e) => return Ok(failure(&e)), - }; - let by_photo: HashMap = s - .catalog - .remote_links() - .iter() - .filter(|r| r.service == SERVICE && r.account_id == account && r.sync_state != lcc_catalog::SyncState::Probable) - .map(|r| (r.photo_id, r.remote_id.clone())) - .collect(); - let skip = unsyncable(s); - let local: Vec = s - .catalog - .albums() - .filter(|a| !skip.contains(&a.id.0)) - .filter(|a| rule.direction != Direction::Off || links.contains_key(&a.id.0)) - .map(|a| LocalAlbum { - id: a.id.0, - name: a.name.clone(), - assets: a.photos.iter().filter_map(|p| by_photo.get(p).cloned()).collect(), - unlinked: a.photos.iter().filter(|p| !by_photo.contains_key(p)).count(), - }) - .collect(); - let job = AlbumJob { - account: account.to_string(), - dry_run, - rule, - local, - links, - pending: load_pending(s, account), - linked: by_photo.into_values().collect(), - home: sync_file(s, account, "albums.json"), - }; - s.remote.sync.entry(account.to_string()).or_default().albums_running = true; - let task = s.activity.start("immich", "Syncing albums with Immich", crate::activity::Cancel::No); - let run = move || { - let d = album_work(&client, job); - drop(task); - d - }; - if background { - let tx = s.remote.sender(); - std::thread::spawn(move || { - let _ = tx.send(crate::remote::Msg::AlbumsSynced(Box::new(run()))); - }); - return Ok(json!({"started": true})); - } - let done = run(); - Ok(finish_albums(s, done)) -} - -/// The server side of an album run. -fn album_work(c: &lcc_immich::Client, job: AlbumJob) -> AlbumsDone { - let AlbumJob { account, dry_run, rule, local, links, pending, linked, home } = job; - let mut done = - AlbumsDone { account, dry_run, old: links.clone(), plan: Default::default(), created: Vec::new(), errors: Vec::new(), fatal: None, home }; - let list = match c.albums() { - Ok(v) => v, - Err(e) => { - done.fatal = Some(e); - return done; - } - }; - let wanted: BTreeSet<&str> = links.values().map(|l| l.immich.as_str()).collect(); - let mut remote = Vec::new(); - for a in list { - if rule.direction == Direction::Off && !wanted.contains(a.id.as_str()) { - continue; - } - match c.album_assets(&a.id) { - Ok(v) => remote.push(RemoteAlbum { assets: v.into_iter().filter(|x| linked.contains(x)).collect(), id: a.id, name: a.album_name }), - Err(e) => { - done.fatal = Some(e); - return done; - } - } - } - let mut plan = plan_albums::plan(rule, &local, &remote, &links, &pending); - if !dry_run { - // what the Immich side did not do, per Immich album: the links' bases are corrected by - // it below, so a base never holds an asset that is not in the Immich album - let mut failed: BTreeSet = BTreeSet::new(); - let mut not_added: HashMap> = HashMap::new(); - let mut not_removed: HashMap> = HashMap::new(); - // the assets of `asked` a checked add/remove left undone (all of them when the call failed) - let undone = |r: std::result::Result, lcc_immich::ImmichError>, asked: &[String], errors: &mut Vec| match r { - Ok(refused) => { - if let Some((_, why)) = refused.first() { - errors.push(format!("Immich album: {} of {} photos were refused ({why})", refused.len(), asked.len())); - } - refused.into_iter().map(|(id, _)| id).collect::>() - } - Err(e) => { - errors.push(format!("Immich album: {e}")); - asked.iter().cloned().collect() - } - }; - for op in &plan.remote { - let r = match op { - RemoteOp::Create { local, name, assets } => c.create_album(name).map(|a| { - let ids: Vec = assets.iter().cloned().collect(); - let missing = if ids.is_empty() { BTreeSet::new() } else { undone(c.album_add_checked(&a.id, &ids), &ids, &mut done.errors) }; - done.created.push((*local, a.id, assets.difference(&missing).cloned().collect())); - }), - RemoteOp::Rename { id, name } => c.rename_album(id, name), - RemoteOp::Add { id, assets } => { - let missing = undone(c.album_add_checked(id, assets), assets, &mut done.errors); - if !missing.is_empty() { - not_added.entry(id.clone()).or_default().extend(missing); - } - Ok(()) - } - RemoteOp::Remove { id, assets } => { - let left = undone(c.album_remove_checked(id, assets), assets, &mut done.errors); - if !left.is_empty() { - not_removed.entry(id.clone()).or_default().extend(left); - } - Ok(()) - } - RemoteOp::Delete { id } => c.delete_album(id), - }; - if let Err(e) = r { - done.errors.push(format!("Immich album: {e}")); - if let RemoteOp::Rename { id, .. } | RemoteOp::Delete { id } = op { - failed.insert(id.clone()); - } - } - } - for link in plan.links.values_mut() { - if let Some(a) = not_added.get(&link.immich) { - link.not_added(a); - } - if let Some(a) = not_removed.get(&link.immich) { - link.not_removed(a); - } - } - // a failed rename or delete keeps the old link, so the next run tries again - for (k, old) in &links { - if failed.contains(&old.immich) { - plan.links.insert(*k, old.clone()); - } - } - } - done.plan = plan; - done -} - -/// Take an album run in: catalog changes, the links, the summary. -pub(crate) fn finish_albums(s: &mut Session, d: AlbumsDone) -> Value { - let AlbumsDone { account, dry_run, old, mut plan, created, mut errors, fatal, home } = d; - let v = if sync_file(s, &account, "albums.json") != home { - // another library was opened while the worker was out: its album ids and links are not - // this library's; nothing is applied or saved - json!({"ok": false, "dryRun": dry_run, "albums": 0, "errors": ["the library changed while the album sync was running; nothing was applied"]}) - } else if let Some(e) = fatal { - let mut v = failure(&e); - v["albums"] = json!(0); - v - } else { - let by_asset: HashMap = s - .catalog - .remote_links() - .iter() - .filter(|r| r.service == SERVICE && r.account_id == account && r.sync_state != lcc_catalog::SyncState::Probable) - .map(|r| (r.remote_id.clone(), r.photo_id)) - .collect(); - let photos = |a: &[String]| -> Vec { a.iter().filter_map(|x| by_asset.get(x)).map(|p| p.0).collect() }; - let changes = json!({"toImmich": plan.remote, "toCatalog": plan.local}); - if !dry_run { - for (local, immich, confirmed) in &created { - let name = plan - .remote - .iter() - .find_map(|o| match o { - RemoteOp::Create { local: l, name, .. } if l == local => Some(name.clone()), - _ => None, - }) - .unwrap_or_default(); - // the base: only what is known to be in the new Immich album - plan.links.insert(*local, AlbumLink { immich: immich.clone(), base: Some(confirmed.clone()), name: Some(name) }); - } - for op in plan.local.clone() { - // assets of an op that have no photo here (the link went away during the run) - let unmapped = |a: &[String]| -> Vec { a.iter().filter(|x| !by_asset.contains_key(*x)).cloned().collect() }; - let r = match &op { - LocalOp::Create { immich, name, assets } => { - let ids: Vec = assets.iter().filter(|x| by_asset.contains_key(*x)).cloned().collect(); - let ph = photos(&ids); - s.execute("album.create", &json!({"name": name})).and_then(|a| { - let id = a["id"].as_u64().unwrap_or_default(); - if !ph.is_empty() { - s.execute("album.addPhotos", &json!({"id": id, "ids": ph}))?; - } - // the base: only the assets whose photos are in the new album - plan.links - .insert(id, AlbumLink { immich: immich.clone(), base: Some(ids.into_iter().collect()), name: Some(name.clone()) }); - Ok(Value::Null) - }) - } - LocalOp::Rename { id, name } => s.execute("album.rename", &json!({"id": id, "name": name})), - LocalOp::Add { id, assets } => { - let r = s.execute("album.addPhotos", &json!({"id": id, "ids": photos(assets)})); - if let Some(l) = plan.links.get_mut(id) { - // not in the catalog album: not common to both sides - match &r { - Ok(_) => l.not_added(&unmapped(assets)), - Err(_) => l.not_added(assets), - } - } - r - } - LocalOp::Remove { id, assets } => { - let r = s.execute("album.removePhotos", &json!({"id": id, "ids": photos(assets)})); - if r.is_err() - && let Some(l) = plan.links.get_mut(id) - { - // still in the catalog album and (as far as the base knows) once in - // both: the next run removes them again - l.not_removed(assets); - } - r - } - LocalOp::Delete { id } => s.execute("album.delete", &json!({"id": id})), - }; - if let Err(e) = r { - errors.push(format!("catalog album: {e}")); - // a failed rename or delete keeps the old link, so the next run tries again - if let LocalOp::Rename { id, .. } | LocalOp::Delete { id } = &op - && let Some(o) = old.get(id) - { - plan.links.insert(*id, o.clone()); - } - } - } - if let Err(e) = save_links(s, &account, &plan.links).and_then(|_| save_pending(s, &account, &plan.pending)) { - errors.push(e); - } - } - let empty = Vec::new(); - let (to_i, to_c) = (changes["toImmich"].as_array().unwrap_or(&empty), changes["toCatalog"].as_array().unwrap_or(&empty)); - let count = |k: &str| to_i.iter().chain(to_c).filter(|o| o["op"] == k).count(); - json!({ - "ok": errors.is_empty(), - "dryRun": dry_run, - "created": count("create"), - "renamed": count("rename"), - "membership": count("add") + count("remove"), - "deleted": count("delete"), - "pending": plan.pending, - "kept": plan.kept, - "conflicts": plan.conflicts, - "errors": errors, - "changes": changes, - "albums": plan.links.len(), - }) - }; - let e = s.remote.sync.entry(account).or_default(); - e.albums_running = false; - e.albums_last = Some(v.clone()); - v -} - -fn sync_albums(s: &mut Session, p: &Value) -> Result { - const C: &str = "immich.syncAlbums"; - let id = account_param(s, p, C)?; - start_albums(s, &id, bool_or(p, "dryRun", false), bool_or(p, "background", false)) -} - -/// An album deletion waiting for the user: `apply` deletes the surviving album too (never its -/// photos); `keep` keeps it, unlinked, so the next run puts it back where it was deleted. -fn resolve_album_deletion(s: &mut Session, p: &Value) -> Result { - const C: &str = "immich.resolveAlbumDeletion"; - let id = account_param(s, p, C)?; - let album = p.get("album").and_then(Value::as_u64).ok_or_else(|| bad(C, "missing `album` (catalog album id)"))?; - let apply = match str_param(p, "action") { - Some("apply") => true, - Some("keep") => false, - _ => return Err(bad(C, "`action` must be apply or keep")), - }; - let mut pending = load_pending(s, &id); - let Some(pos) = pending.iter().position(|d| d.album == album) else { return Err(bad(C, "no deletion waiting for that album")) }; - let d = pending.remove(pos); - if apply { - match d.deleted_on { - plan_albums::DeletedOn::Catalog => { - let (_, client) = match s.immich_client(&id) { - Ok(x) => x, - Err(e) => return Ok(failure(&e)), - }; - if let Err(e) = client.delete_album(&d.immich) { - return Ok(failure(&e)); - } - } - plan_albums::DeletedOn::Immich => { - s.execute("album.delete", &json!({"id": album}))?; - } - } - } - let mut links = load_links(s, &id); - links.remove(&album); - save_links(s, &id, &links).map_err(|e| bad(C, e))?; - save_pending(s, &id, &pending).map_err(|e| bad(C, e))?; - Ok(json!({"ok": true, "album": album, "applied": apply})) -} - pub fn specs() -> Vec { - vec![ - cmd!(query "immich.linkAlbum", "Link Album with Immich", [], None, "{account?, album: catalog album id, immichAlbum?: id (default: the Immich album of the same name, created if missing), unlink?: bool}: the album's linked photos sync both ways with the Immich album (immich.syncAlbums) → {ok, album, immichAlbum}", always, link_album), - cmd!(query "immich.syncAlbums", "Sync Albums with Immich", [], None, "{account?, dryRun?: bool, background?: bool}: collections ↔ albums by the account's album rule (immich.setSync config.albums: direction off = only albums linked by hand, membership both ways; toImmich|fromImmich|twoWay = every plain album maps to the Immich album of the same name, with creates, renames, membership and album deletes, never photo deletes; the policy decides deletes and names changed on both sides, ask leaves deletes in `pending`; a catalog album that holds photos without an Immich link is never deleted for an Immich-side delete: it is kept, taken out of the sync and listed in `kept`) → {ok, dryRun, created, renamed, membership, deleted, pending, kept: [{album, name, unlinked}], conflicts, errors, changes: {toImmich, toCatalog}, albums} or {started}", always, sync_albums), - cmd!(query "immich.resolveAlbumDeletion", "Resolve Immich Album Deletion", [], None, "{account?, album: catalog album id, action: apply|keep}: an album deleted on one side and waiting (immich.syncAlbums → pending): apply deletes the other side's album too (photos stay), keep unlinks it so it is created again where it was deleted → {ok, album, applied}", always, resolve_album_deletion), - ] + Vec::new() } diff --git a/crates/engine/src/cmd/immich_sync.rs b/crates/engine/src/cmd/immich_sync.rs index bef3fe3236..bed42700c7 100644 --- a/crates/engine/src/cmd/immich_sync.rs +++ b/crates/engine/src/cmd/immich_sync.rs @@ -51,10 +51,6 @@ pub(crate) struct AccountSync { preview: Option, next_due: Option, failures: u32, - /// An album run (`immich.syncAlbums`) is on a worker. - pub(crate) albums_running: bool, - /// The last album run's summary. - pub(crate) albums_last: Option, } /// One linked pair as the worker gets it. @@ -137,7 +133,6 @@ fn state_of<'a>(s: &'a mut Session, account: &str) -> &'a mut SyncState { entry.state = None; entry.last = None; entry.preview = None; - entry.albums_last = None; entry.state_file = path.clone(); } entry.state.get_or_insert_with(|| match path.as_ref().map(std::fs::read) { @@ -892,11 +887,6 @@ pub(crate) fn tick(s: &mut Session) { if let Err(err) = start(s, &id, false, false, true) { log::warn!("Immich background sync: {err}"); } - if config_of(s, &id).album_rule().direction != merge::Direction::Off - && let Err(err) = super::publish::start_albums(s, &id, false, true) - { - log::warn!("Immich background album sync: {err}"); - } // a start that could not reach the key / server waits a while let e = s.remote.sync.entry(id).or_default(); if !e.running && e.next_due.is_none() { @@ -914,12 +904,7 @@ fn sync_cmd(s: &mut Session, p: &Value) -> Result { const C: &str = "immich.sync"; let id = account_param(s, p, C)?; let (dry, background) = (bool_or(p, "dryRun", false), bool_or(p, "background", false)); - let mut v = start(s, &id, dry, bool_or(p, "full", false), background)?; - // the album rule rides along with every real run (Sync Now, the schedule) - if !dry && config_of(s, &id).album_rule().direction != merge::Direction::Off { - v["albums"] = super::publish::start_albums(s, &id, false, background)?; - } - Ok(v) + start(s, &id, dry, bool_or(p, "full", false), background) } fn status(s: &mut Session, p: &Value) -> Result { @@ -943,10 +928,6 @@ fn status(s: &mut Session, p: &Value) -> Result { "log": st.log.iter().rev().take(n).collect::>(), "config": cfg, "rules": Field::ALL.iter().map(|f| json!({"field": f.name(), "rule": cfg.rule(*f)})).collect::>(), - "albumRule": cfg.album_rule(), - "albumsRunning": e.is_some_and(|e| e.albums_running), - "albumsLast": e.and_then(|e| e.albums_last.clone()), - "albumDeletions": super::publish::load_pending(s, &id), })) } @@ -1369,7 +1350,7 @@ pub fn specs() -> Vec { cmd!(query "immich.syncStatus", "Immich Sync Status", [], None, "{account?, log?: n} → {running, last, preview (the last dry run, with its changes), nextRunInSeconds, syncedUntil, items, conflicts, deletions, log (activity, newest first), config, rules}", always, status), cmd!(query "immich.syncConflicts", "Immich Sync Conflicts", [], None, "{account?} → {conflicts: [{photo, assetId, fileName, field, catalog, immich, detected, decided?}]}", always, conflicts), cmd!(query "immich.resolveConflict", "Resolve Immich Sync Conflict", [], None, "{account?, keep: catalog|immich, ids?: photos, assetId?, field?, sync?: bool, background?: bool}: decide conflicts (default: all); the next sync applies them (sync: run it now) → {decided, sync?}", always, resolve), - cmd!(query "immich.setSync", "Immich Sync Settings", [], None, "{account?, config: {rules?: {rating|favorite|archived|description|keywords|location|captured: {direction: twoWay|toImmich|fromImmich|off, policy: catalog|immich|newest|ask}}, favorite?: pick|fiveStars, description?: caption|title, intervalMinutes?, onPublish?, pushPeople?, albums?: {direction, policy} (collections ↔ albums, immich.syncAlbums; default off = only albums linked by hand, policy ask)}} → {config}", always, set_config), + cmd!(query "immich.setSync", "Immich Sync Settings", [], None, "{account?, config: {rules?: {rating|favorite|archived|description|keywords|location|captured: {direction: twoWay|toImmich|fromImmich|off, policy: catalog|immich|newest|ask}}, favorite?: pick|fiveStars, description?: caption|title, intervalMinutes?, onPublish?, pushPeople?}} → {config}", always, set_config), cmd!(query "immich.resolveDeletion", "Resolve Immich Deletion", [], None, "{account?, assets?: [asset ids] (omitted = all queued; [] = none), action: apply|keep}: apply: a photo whose asset is in Immich's trash goes to Recently Deleted, an asset whose photo was deleted goes to Immich's trash (never a hard delete); each is checked first, and a deletion that was undone meanwhile (the asset restored from the trash, the photo restored) is dropped, not applied; keep: dismiss → {resolved, restored, failed}", always, resolve_deletion), cmd!(query "immich.importPeople", "Import People from Immich", [], None, "{account?, ids?: photos (default all linked), includeHidden?: bool, background?: bool (on a worker, with an activity row that can be cancelled: {started, key}, the result through immich.answer)}: read Immich's faces and people into the photos' face regions, marked from Immich (unconfirmed ones are replaced on the next import; regions the photo had are kept) → {photos, added, removed, skipped, more, people: [{id, name, birthDate, hidden}]}", always, import_people), cmd!( diff --git a/crates/engine/src/remote.rs b/crates/engine/src/remote.rs index 56cae3a764..25b7f85dca 100644 --- a/crates/engine/src/remote.rs +++ b/crates/engine/src/remote.rs @@ -60,8 +60,6 @@ pub(crate) enum Msg { Version(Box), /// `immich.sync {background}`: a sync run finished. Synced(Box), - /// `immich.syncAlbums {background}`: an album run finished. - AlbumsSynced(Box), /// `immich.pullSidecars` / `immich.pushSidecars` {background}: a sidecar run finished. Sidecars(Box), /// The Immich albums shown as collections were listed (device sync). diff --git a/crates/engine/src/tests_immich_sync.rs b/crates/engine/src/tests_immich_sync.rs index 5ee610fef0..6a949cafb1 100644 --- a/crates/engine/src/tests_immich_sync.rs +++ b/crates/engine/src/tests_immich_sync.rs @@ -708,25 +708,8 @@ fn publish_to_immich_albums_renders_and_stacks() { } #[test] -fn albums_sync_both_ways_and_smart_search_maps_results_to_photos() { - let Setup { mut s, state, one, two, dir, .. } = setup("albums"); - let a = s.execute("album.create", &json!({"name": "Holiday"})).unwrap()["id"].as_u64().unwrap(); - s.execute("album.addPhotos", &json!({"id": a, "ids": [one.0]})).unwrap(); - let r = s.execute("immich.linkAlbum", &json!({"album": a})).unwrap(); - assert_eq!(r["ok"], true, "{r}"); - // Immich already has photo two in it - state.lock().unwrap().albums[0].2.push("bbbb-2".into()); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["ok"], true, "{r}"); - let mut photos = s.catalog.album(lcc_catalog::AlbumId(a)).unwrap().photos.clone(); - photos.sort(); - assert_eq!(photos, vec![one, two]); - assert!(state.lock().unwrap().albums[0].2.contains(&"aaaa-1".to_string())); - // removed in Immich: removed in the catalog - state.lock().unwrap().albums[0].2.retain(|x| x != "aaaa-1"); - s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(s.catalog.album(lcc_catalog::AlbumId(a)).unwrap().photos, vec![two]); - +fn smart_search_maps_results_to_photos() { + let Setup { mut s, two, dir, .. } = setup("albums"); // smart search maps Immich's results to photos, and shows or saves them let r = s.execute("immich.smartSearch", &json!({"query": "from immich", "show": true, "saveAs": "Immich: from immich"})).unwrap(); assert_eq!(r["ok"], true, "{r}"); @@ -743,80 +726,6 @@ fn albums_sync_both_ways_and_smart_search_maps_results_to_photos() { let _ = std::fs::remove_dir_all(&dir); } -/// The album rule: every plain album maps by name (creates both ways), renames travel, an album -/// deleted on one side waits (ask) or follows the policy, photos are never deleted; a background -/// run holds an activity row. -#[test] -fn album_rule_creates_renames_and_deletes_albums() { - let Setup { mut s, state, one, two, dir, .. } = setup("albumrule"); - let album_named = |s: &Session, n: &str| s.catalog.albums().find(|a| a.name == n).map(|a| a.id); - let holiday = s.execute("album.create", &json!({"name": "Holiday"})).unwrap()["id"].as_u64().unwrap(); - s.execute("album.addPhotos", &json!({"id": holiday, "ids": [one.0]})).unwrap(); - state.lock().unwrap().albums.push(("album-x".into(), "Trip".into(), vec!["bbbb-2".into()])); - // off (the default): nothing happens to unlinked albums - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["albums"], 0, "{r}"); - assert!(album_named(&s, "Trip").is_none()); - - s.execute("immich.setSync", &json!({"config": {"albums": {"direction": "twoWay", "policy": "ask"}}})).unwrap(); - assert_eq!(s.execute("immich.syncStatus", &json!({})).unwrap()["albumRule"]["direction"], "twoWay"); - // a background run, with the server held: the activity stack shows it - let guard = state.lock().unwrap(); - assert_eq!(s.execute("immich.syncAlbums", &json!({"background": true})).unwrap()["started"], true); - assert!(s.activity.list().iter().any(|t| t.kind == "immich" && t.label == "Syncing albums with Immich")); - drop(guard); - pump_until(&mut s, |s, _| !s.remote.sync.values().any(|e| e.albums_running)); - assert!(!s.activity.list().iter().any(|t| t.label == "Syncing albums with Immich")); - let last = s.execute("immich.syncStatus", &json!({})).unwrap()["albumsLast"].clone(); - assert_eq!(last["ok"], true, "{last}"); - assert_eq!(last["created"], 2, "{last}"); - let trip = album_named(&s, "Trip").expect("Trip created in the catalog"); - assert_eq!(s.catalog.album(trip).unwrap().photos, vec![two]); - { - let st = state.lock().unwrap(); - let h = st.albums.iter().find(|a| a.1 == "Holiday").expect("Holiday created in Immich"); - assert_eq!(h.2, vec!["aaaa-1".to_string()]); - } - // renamed in the catalog → renamed in Immich - s.execute("album.rename", &json!({"id": holiday, "name": "Summer"})).unwrap(); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["renamed"], 1, "{r}"); - assert!(state.lock().unwrap().albums.iter().any(|a| a.1 == "Summer")); - // deleted in Immich, policy ask: waits; nothing deleted yet - state.lock().unwrap().albums.retain(|a| a.0 != "album-x"); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["pending"][0]["deletedOn"], "immich", "{r}"); - assert!(s.catalog.album(trip).is_some()); - let st = s.execute("immich.syncStatus", &json!({})).unwrap(); - assert_eq!(st["albumDeletions"].as_array().unwrap().len(), 1); - // the user applies it: the catalog album goes, its photo stays - s.execute("immich.resolveAlbumDeletion", &json!({"album": trip.0, "action": "apply"})).unwrap(); - assert!(s.catalog.album(trip).is_none()); - assert!(s.catalog.photo(two).is_some_and(|p| !p.deleted)); - assert!(s.execute("immich.syncStatus", &json!({})).unwrap()["albumDeletions"].as_array().unwrap().is_empty()); - // policy catalog: a catalog delete removes the Immich album (never its assets) - s.execute("immich.setSync", &json!({"config": {"albums": {"direction": "twoWay", "policy": "catalog"}}})).unwrap(); - s.execute("album.delete", &json!({"id": holiday})).unwrap(); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["deleted"], 1, "{r}"); - assert!(!state.lock().unwrap().albums.iter().any(|a| a.1 == "Summer")); - assert_eq!(remote(&state, "aaaa-1")["isTrashed"], Value::Null); - // one-way to Immich: an Immich-only album is not pulled in - s.execute("immich.setSync", &json!({"config": {"albums": {"direction": "toImmich"}}})).unwrap(); - state.lock().unwrap().albums.push(("album-y".into(), "Theirs".into(), vec![])); - s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert!(album_named(&s, "Theirs").is_none()); - // Sync Now runs the album rule too, and a background metadata run holds its own row - let guard = state.lock().unwrap(); - let r = s.execute("immich.sync", &json!({"background": true})).unwrap(); - assert_eq!(r["albums"]["started"], true, "{r}"); - let rows: Vec = s.activity.list().into_iter().map(|t| t.label).collect(); - assert!(rows.iter().any(|l| l == "Syncing metadata with Immich") && rows.iter().any(|l| l == "Syncing albums with Immich"), "{rows:?}"); - drop(guard); - pump_until(&mut s, |s, _| !s.remote.sync.values().any(|e| e.albums_running || e.running)); - let _ = std::fs::remove_dir_all(&dir); -} - /// RT.C1/C2: an Edit In version of a linked photo goes to Immich stacked on the original as the /// primary; saving it again asks (or follows the remembered choice): Keep both adds the new upload /// on top, Replace also trashes the previous upload after copying its albums. @@ -998,57 +907,6 @@ fn a_photo_edited_during_a_run_takes_immichs_change_on_the_next_run() { let _ = std::fs::remove_dir_all(&dir); } -/// An album add that fails (the request, or single photos the server refuses) must not leave -/// those photos in the link's base: the next run would read them as "removed in Immich" and take -/// them out of the catalog collection. -#[test] -fn a_failed_album_add_never_removes_photos_from_the_collection() { - let Setup { mut s, state, one, two, dir, .. } = setup("album-add-fail"); - s.execute("immich.setSync", &json!({"config": {"albums": {"direction": "twoWay", "policy": "ask"}}})).unwrap(); - let photos_of = |s: &Session, id: u64| { - let mut p = s.catalog.album(lcc_catalog::AlbumId(id)).unwrap().photos.clone(); - p.sort(); - p - }; - let on_server = |name: &str| state.lock().unwrap().albums.iter().find(|a| a.1 == name).map(|a| a.2.clone()); - // "Trip" exists on both sides (matched by name), empty in Immich; "Solo" only in the catalog - let trip = s.execute("album.create", &json!({"name": "Trip"})).unwrap()["id"].as_u64().unwrap(); - s.execute("album.addPhotos", &json!({"id": trip, "ids": [one.0, two.0]})).unwrap(); - let solo = s.execute("album.create", &json!({"name": "Solo"})).unwrap()["id"].as_u64().unwrap(); - s.execute("album.addPhotos", &json!({"id": solo, "ids": [one.0]})).unwrap(); - state.lock().unwrap().albums.push(("album-t".into(), "Trip".into(), vec![])); - - // every add fails - state.lock().unwrap().album_add_down = true; - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["ok"], false, "{r}"); - assert_eq!(on_server("Trip"), Some(vec![])); - assert_eq!(on_server("Solo"), Some(vec![]), "created, but its photo did not arrive"); - // the server is back, but refuses one photo - { - let mut st = state.lock().unwrap(); - st.album_add_down = false; - st.album_add_refused = vec!["bbbb-2".into()]; - } - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["ok"], false, "the refused photo is reported: {r}"); - assert_eq!((photos_of(&s, trip), photos_of(&s, solo)), (vec![one, two], vec![one]), "nothing left the collections"); - assert_eq!(on_server("Trip"), Some(vec!["aaaa-1".to_string()])); - assert_eq!(on_server("Solo"), Some(vec!["aaaa-1".to_string()])); - // still refused: the photo stays in the collection run after run - s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(photos_of(&s, trip), vec![one, two]); - // accepted at last - state.lock().unwrap().album_add_refused.clear(); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["ok"], true, "{r}"); - let mut t = on_server("Trip").unwrap(); - t.sort(); - assert_eq!(t, vec!["aaaa-1".to_string(), "bbbb-2".to_string()]); - assert_eq!((photos_of(&s, trip), photos_of(&s, solo)), (vec![one, two], vec![one])); - let _ = std::fs::remove_dir_all(&dir); -} - /// The sync state belongs to one catalog. A second catalog opened in the same session starts /// from its own (empty) state: merged against the first one's bases, its freshly imported, /// unrated photos read as "the user cleared this" and wiped the values in Immich. @@ -1088,42 +946,6 @@ fn another_catalog_is_not_merged_against_the_first_ones_sync_state() { let _ = std::fs::remove_dir_all(&dir); } -/// "Immich wins" (or "newest wins") lets an album deleted in Immich delete the catalog -/// collection: never one that holds photos Immich does not have. It is kept, taken out of the -/// sync, and the run says so. -#[test] -fn an_immich_album_delete_keeps_a_collection_with_local_only_photos() { - let Setup { mut s, state, one, dir, .. } = setup("album-keep"); - std::fs::write(dir.join("three.png"), png(42)).unwrap(); - s.execute("library.import", &json!({"paths": [dir.join("three.png").to_string_lossy()]})).unwrap(); - let three = s.catalog.photos().find(|p| p.file_name == "three.png").unwrap().id; - s.execute("immich.setSync", &json!({"config": {"albums": {"direction": "twoWay", "policy": "immich"}}})).unwrap(); - let mixed = s.execute("album.create", &json!({"name": "Mixed"})).unwrap()["id"].as_u64().unwrap(); - s.execute("album.addPhotos", &json!({"id": mixed, "ids": [one.0, three.0]})).unwrap(); - let linked_only = s.execute("album.create", &json!({"name": "Linked"})).unwrap()["id"].as_u64().unwrap(); - s.execute("album.addPhotos", &json!({"id": linked_only, "ids": [one.0]})).unwrap(); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["ok"], true, "{r}"); - assert!(state.lock().unwrap().albums.iter().any(|a| a.1 == "Mixed" && a.2 == vec!["aaaa-1".to_string()])); - - // both albums are deleted in Immich - state.lock().unwrap().albums.clear(); - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["kept"].as_array().map(Vec::len), Some(1), "{r}"); - assert_eq!((r["kept"][0]["album"].as_u64(), r["kept"][0]["unlinked"].as_u64()), (Some(mixed), Some(1)), "{r}"); - let mut photos = s.catalog.album(lcc_catalog::AlbumId(mixed)).expect("the collection is kept").photos.clone(); - photos.sort(); - assert_eq!(photos, vec![one, three]); - assert!(s.catalog.album(lcc_catalog::AlbumId(linked_only)).is_none(), "a collection of linked photos only follows the delete"); - assert!(s.catalog.photo(one).is_some_and(|p| !p.deleted)); - // later runs leave it alone: not deleted, not made again in Immich, not reported again - let r = s.execute("immich.syncAlbums", &json!({})).unwrap(); - assert_eq!(r["kept"].as_array().map(Vec::len), Some(0), "{r}"); - assert!(s.catalog.album(lcc_catalog::AlbumId(mixed)).is_some()); - assert!(!state.lock().unwrap().albums.iter().any(|a| a.1 == "Mixed")); - let _ = std::fs::remove_dir_all(&dir); -} - /// A queued deletion that was undone in Immich (the asset restored from the trash) leaves the /// queue, and "apply all queued" never deletes its photo. #[test] diff --git a/crates/immich/src/accounts.rs b/crates/immich/src/accounts.rs index 6966d29236..2624da6ce9 100644 --- a/crates/immich/src/accounts.rs +++ b/crates/immich/src/accounts.rs @@ -102,7 +102,17 @@ impl Accounts { /// Read from `path`; a missing file is empty, a corrupt one an error the caller shows. pub fn load(path: &std::path::Path) -> Result { match std::fs::read(path) { - Ok(b) => serde_json::from_slice(&b).map_err(|e| format!("{}: {e}", path.display())), + Ok(b) => { + let mut a: Accounts = serde_json::from_slice(&b).map_err(|e| format!("{}: {e}", path.display()))?; + // the old name-matching album rule: an account that had it on shows its albums as + // collections in device sync instead + for x in &mut a.immich { + if x.sync.albums.take().is_some_and(|r| r.direction != crate::sync::Direction::Off) { + x.collections = true; + } + } + Ok(a) + } Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(Accounts::default()), Err(e) => Err(format!("{}: {e}", path.display())), } diff --git a/crates/immich/src/albums.rs b/crates/immich/src/albums.rs deleted file mode 100644 index 3bbdd9979a..0000000000 --- a/crates/immich/src/albums.rs +++ /dev/null @@ -1,557 +0,0 @@ -//! IMM-SYNC, collections ↔ albums: the pure plan (no I/O) of one album sync run. The engine -//! gathers both sides, calls [`plan`], applies the Immich half on a worker and the catalog half on -//! the session (`immich.syncAlbums`). -//! -//! Sources: own design (the set three-way merge of the metadata sync, applied to album membership -//! and to album names; deletions follow the conflict policy). -//! -//! What it covers, gated by the account's album rule ([`SyncConfig::albums`](crate::sync::SyncConfig)): -//! - direction `off`: only albums linked by hand (`immich.linkAlbum`) sync, membership both ways; -//! nothing is created, renamed or deleted. -//! - `toImmich` / `fromImmich` / `twoWay`: every plain catalog album maps to the Immich album of -//! the same name; the side(s) the direction allows get creates, renames, membership changes and -//! album deletes. A deleted album never deletes photos: only the album on the other side, and -//! only as the policy says (`ask`, or a side that also changed it since the last sync, leaves it -//! for the user). -//! -//! Two rules keep a failed or partial run from costing photos or collections: -//! - a link's `base` only ever holds assets known to be in the Immich album *and* in the catalog -//! album. [`pair`] writes the base it expects after its ops; the engine then takes out what an -//! op did not achieve ([`AlbumLink::not_added`], [`AlbumLink::not_removed`]). An asset wrongly -//! left in the base would read as "was in both, now missing on one side" on the next run and be -//! removed from the other. -//! - a catalog album that holds photos Immich never had (unlinked ones) is never deleted because -//! its Immich album was: it is kept and taken out of the sync ([`AlbumLink::local_only`], -//! [`Plan::kept`]). - -use std::collections::{BTreeMap, BTreeSet}; - -use serde::{Deserialize, Serialize}; - -use crate::sync::{Direction, FieldRule, Policy}; - -/// A catalog album linked to an Immich album. -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] -#[serde(default, rename_all = "camelCase")] -pub struct AlbumLink { - pub immich: String, - /// Asset ids both sides had after the last sync. - pub base: Option>, - /// The album name both sides had after the last sync. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl AlbumLink { - /// The marker for a catalog album that is kept out of the album sync: its Immich album was - /// deleted while it held photos that exist only in the catalog. No Immich album is created or - /// matched for it again until it is linked by hand (`immich.linkAlbum`). - pub fn local_only(name: &str) -> AlbumLink { - AlbumLink { immich: String::new(), base: None, name: Some(name.to_string()) } - } - - pub fn is_local_only(&self) -> bool { - self.immich.is_empty() - } - - /// `assets` did not reach the other side's album (an add that failed or was refused): they are - /// not common to both sides, so the next run adds them again. - pub fn not_added<'a>(&mut self, assets: impl IntoIterator) { - if let Some(b) = self.base.as_mut() { - for a in assets { - b.remove(a); - } - } - } - - /// `assets` are still in the other side's album (a remove that failed): they stay in the base, - /// so the next run removes them again instead of reading them as newly added there. - pub fn not_removed<'a>(&mut self, assets: impl IntoIterator) { - if let Some(b) = self.base.as_mut() { - b.extend(assets.into_iter().cloned()); - } - } -} - -/// Catalog album id → its link. -pub type AlbumLinks = BTreeMap; - -/// A plain catalog album: its linked photos as Immich asset ids. -#[derive(Clone, Debug, Default, PartialEq)] -pub struct LocalAlbum { - pub id: u64, - pub name: String, - pub assets: BTreeSet, - /// How many of the album's photos have no (confirmed) link to an Immich asset: photos only - /// the catalog has. - pub unlinked: usize, -} - -/// An Immich album: its assets that are linked to catalog photos. -#[derive(Clone, Debug, Default, PartialEq)] -pub struct RemoteAlbum { - pub id: String, - pub name: String, - pub assets: BTreeSet, -} - -/// Where an album was deleted. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub enum DeletedOn { - Catalog, - Immich, -} - -/// An album deleted on one side, waiting for the user (policy `ask`, or changed on the other side -/// since the last sync). -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct PendingDelete { - pub album: u64, - pub immich: String, - pub name: String, - pub deleted_on: DeletedOn, -} - -#[derive(Clone, Debug, PartialEq, Serialize)] -#[serde(tag = "op", rename_all = "camelCase")] -pub enum RemoteOp { - /// Create an Immich album for catalog album `local`, holding `assets`. - Create { - local: u64, - name: String, - assets: BTreeSet, - }, - Rename { - id: String, - name: String, - }, - Add { - id: String, - assets: Vec, - }, - Remove { - id: String, - assets: Vec, - }, - /// Delete the album (never its assets). - Delete { - id: String, - }, -} - -#[derive(Clone, Debug, PartialEq, Serialize)] -#[serde(tag = "op", rename_all = "camelCase")] -pub enum LocalOp { - /// Create a catalog album for Immich album `immich`, holding the photos of `assets`. - Create { - immich: String, - name: String, - assets: BTreeSet, - }, - Rename { - id: u64, - name: String, - }, - Add { - id: u64, - assets: Vec, - }, - Remove { - id: u64, - assets: Vec, - }, - /// Delete the album (never its photos). - Delete { - id: u64, - }, -} - -/// One run's plan. -#[derive(Clone, Debug, Default, PartialEq)] -pub struct Plan { - pub remote: Vec, - pub local: Vec, - /// The links after the run (albums created by the run are linked when created). - pub links: AlbumLinks, - /// Deletions waiting for the user, old and new. - pub pending: Vec, - /// Albums renamed differently on both sides (left alone; the policy said neither wins). - pub conflicts: Vec, - /// Catalog albums whose Immich album was deleted and that the policy would have deleted too, - /// but which hold photos only the catalog has: kept, and no longer synced. - pub kept: Vec, -} - -/// A catalog album kept although its Immich album was deleted ([`Plan::kept`]). -#[derive(Clone, Debug, PartialEq, Serialize)] -#[serde(rename_all = "camelCase")] -pub struct KeptAlbum { - pub album: u64, - pub name: String, - /// The photos in it that Immich never had. - pub unlinked: usize, -} - -fn push_allowed(d: Direction) -> bool { - matches!(d, Direction::TwoWay | Direction::ToImmich | Direction::Off) -} - -fn pull_allowed(d: Direction) -> bool { - matches!(d, Direction::TwoWay | Direction::FromImmich | Direction::Off) -} - -/// Plan a run. `pending`: the deletions still waiting (their links are left alone). -pub fn plan(rule: FieldRule, local: &[LocalAlbum], remote: &[RemoteAlbum], links: &AlbumLinks, pending: &[PendingDelete]) -> Plan { - let auto = rule.direction != Direction::Off; - let (push, pull) = (push_allowed(rule.direction), pull_allowed(rule.direction)); - let by_local: BTreeMap = local.iter().map(|a| (a.id, a)).collect(); - let by_remote: BTreeMap<&str, &RemoteAlbum> = remote.iter().map(|a| (a.id.as_str(), a)).collect(); - let waiting: BTreeSet = pending.iter().map(|p| p.album).collect(); - let mut out = Plan { pending: pending.to_vec(), ..Default::default() }; - let mut used_remote: BTreeSet = links.values().map(|l| l.immich.clone()).collect(); - let mut used_local: BTreeSet = links.keys().copied().collect(); - - for (id, link) in links { - if waiting.contains(id) || link.is_local_only() { - // (a local-only album that is gone from the catalog needs no marker any more) - if waiting.contains(id) || by_local.contains_key(id) { - out.links.insert(*id, link.clone()); - } - continue; - } - let (l, r) = (by_local.get(id), by_remote.get(link.immich.as_str())); - match (l, r) { - (Some(l), Some(r)) => { - let new = pair(rule, l, r, link, &mut out); - out.links.insert(*id, new); - } - (None, None) => {} - _ if !auto => { - // hand-made links: a missing side just ends the link - } - (None, Some(r)) => { - if deleted(rule, *id, link, r.name.clone(), changed_remote(link, r), DeletedOn::Catalog, push, &mut out) { - used_remote.remove(&r.id); - } - } - (Some(l), None) => { - if pull && l.unlinked > 0 && deleter_wins(rule.policy, DeletedOn::Immich, changed_local(link, l)) == Some(true) { - // it holds photos Immich never had: deleting it would lose the only place - // they are collected. Kept, out of the sync, and said so - out.links.insert(*id, AlbumLink::local_only(&l.name)); - out.kept.push(KeptAlbum { album: *id, name: l.name.clone(), unlinked: l.unlinked }); - } else if deleted(rule, *id, link, l.name.clone(), changed_local(link, l), DeletedOn::Immich, pull, &mut out) { - used_local.remove(&l.id); - } - } - } - } - if !auto { - return out; - } - // unlinked albums: same name → linked; otherwise created on the other side - let mut free_remote: Vec<&RemoteAlbum> = remote.iter().filter(|r| !used_remote.contains(&r.id)).collect(); - for l in local.iter().filter(|l| !used_local.contains(&l.id)) { - if let Some(pos) = free_remote.iter().position(|r| r.name == l.name) { - let r = free_remote.remove(pos); - let link = AlbumLink { immich: r.id.clone(), base: None, name: Some(l.name.clone()) }; - let new = pair(rule, l, r, &link, &mut out); - out.links.insert(l.id, new); - } else if push { - out.remote.push(RemoteOp::Create { local: l.id, name: l.name.clone(), assets: l.assets.clone() }); - } - } - if pull { - for r in free_remote { - out.local.push(LocalOp::Create { immich: r.id.clone(), name: r.name.clone(), assets: r.assets.clone() }); - } - } - out -} - -fn changed_remote(link: &AlbumLink, r: &RemoteAlbum) -> bool { - link.name.as_ref().is_some_and(|n| *n != r.name) || link.base.as_ref().is_some_and(|b| *b != r.assets) -} - -fn changed_local(link: &AlbumLink, l: &LocalAlbum) -> bool { - link.name.as_ref().is_some_and(|n| *n != l.name) || link.base.as_ref().is_some_and(|b| *b != l.assets) -} - -/// An album deleted on `on`, still present on the other side. `allowed`: the deletion may travel -/// to the other side. `other_changed`: the surviving album changed since the last sync. -/// → true when the link just ends: the survivor is then an unlinked album of this run (created -/// again on the deleting side when the direction allows). -fn deleted(rule: FieldRule, id: u64, link: &AlbumLink, name: String, other_changed: bool, on: DeletedOn, allowed: bool, out: &mut Plan) -> bool { - if !allowed { - return true; - } - // the survivor's side wins: it is created again on the deleting side - let Some(deleter_wins) = deleter_wins(rule.policy, on, other_changed) else { return true }; - if deleter_wins { - match on { - DeletedOn::Catalog => out.remote.push(RemoteOp::Delete { id: link.immich.clone() }), - DeletedOn::Immich => out.local.push(LocalOp::Delete { id }), - } - } else { - out.links.insert(id, link.clone()); - out.pending.push(PendingDelete { album: id, immich: link.immich.clone(), name, deleted_on: on }); - } - false -} - -/// Does an album delete on `on` travel to the other side? `Some(true)`: yes; `Some(false)`: the -/// user decides; `None`: no, the surviving side wins. -fn deleter_wins(policy: Policy, on: DeletedOn, other_changed: bool) -> Option { - match (policy, on) { - (Policy::Ask, _) => Some(false), - (Policy::Newest, _) => Some(!other_changed), - (Policy::Catalog, DeletedOn::Catalog) | (Policy::Immich, DeletedOn::Immich) => Some(true), - (Policy::Catalog, DeletedOn::Immich) | (Policy::Immich, DeletedOn::Catalog) => None, - } -} - -/// A linked pair present on both sides: renames and membership → the link after the run. -/// -/// The link's base is what both sides hold once every op of this pair has worked; the caller -/// corrects it for ops that did not ([`AlbumLink::not_added`], [`AlbumLink::not_removed`]). -fn pair(rule: FieldRule, l: &LocalAlbum, r: &RemoteAlbum, link: &AlbumLink, out: &mut Plan) -> AlbumLink { - let (push, pull) = (push_allowed(rule.direction), pull_allowed(rule.direction)); - let auto = rule.direction != Direction::Off; - // names (hand-made links in `off` mode keep their own names) - let mut name = link.name.clone(); - if auto { - let base = link.name.clone().unwrap_or_else(|| l.name.clone()); - let (lc, rc) = (l.name != base, r.name != base); - let to_remote = |out: &mut Plan| out.remote.push(RemoteOp::Rename { id: r.id.clone(), name: l.name.clone() }); - let to_local = |out: &mut Plan| out.local.push(LocalOp::Rename { id: l.id, name: r.name.clone() }); - match (lc, rc) { - (true, false) if push => { - to_remote(out); - name = Some(l.name.clone()); - } - (false, true) if pull => { - to_local(out); - name = Some(r.name.clone()); - } - (true, true) if l.name == r.name => name = Some(l.name.clone()), - (true, true) => match rule.policy { - Policy::Catalog if push => { - to_remote(out); - name = Some(l.name.clone()); - } - Policy::Immich if pull => { - to_local(out); - name = Some(r.name.clone()); - } - _ => out.conflicts.push(format!("“{}” is “{}” in Immich", l.name, r.name)), - }, - (false, false) => name = Some(base), - _ => {} - } - } - // membership - let (lo, re) = (&l.assets, &r.assets); - let (mut add_r, mut rm_r, mut add_l, mut rm_l): (Vec, Vec, Vec, Vec) = Default::default(); - match &link.base { - None => { - if push { - add_r = lo.difference(re).cloned().collect(); - } - if pull { - add_l = re.difference(lo).cloned().collect(); - } - } - Some(b) => { - if push { - add_r = lo.difference(b).filter(|a| !re.contains(*a)).cloned().collect(); - rm_r = b.difference(lo).filter(|a| re.contains(*a)).cloned().collect(); - } - if pull { - add_l = re.difference(b).filter(|a| !lo.contains(*a)).cloned().collect(); - rm_l = b.difference(re).filter(|a| lo.contains(*a)).cloned().collect(); - } - } - } - let new_remote: BTreeSet = re.iter().filter(|a| !rm_r.contains(a)).cloned().chain(add_r.iter().cloned()).collect(); - let new_local: BTreeSet = lo.iter().filter(|a| !rm_l.contains(a)).cloned().chain(add_l.iter().cloned()).collect(); - // one-way: the base is the side that was followed - let base = match (push, pull) { - (true, false) => new_local.clone(), - (false, true) => new_remote.clone(), - _ => new_remote.intersection(&new_local).cloned().collect(), - }; - if !add_r.is_empty() { - out.remote.push(RemoteOp::Add { id: r.id.clone(), assets: add_r }); - } - if !rm_r.is_empty() { - out.remote.push(RemoteOp::Remove { id: r.id.clone(), assets: rm_r }); - } - if !add_l.is_empty() { - out.local.push(LocalOp::Add { id: l.id, assets: add_l }); - } - if !rm_l.is_empty() { - out.local.push(LocalOp::Remove { id: l.id, assets: rm_l }); - } - AlbumLink { immich: r.id.clone(), base: Some(base), name } -} - -#[cfg(test)] -mod tests { - use super::*; - - fn set(x: &[&str]) -> BTreeSet { - x.iter().map(|s| s.to_string()).collect() - } - fn la(id: u64, name: &str, a: &[&str]) -> LocalAlbum { - LocalAlbum { id, name: name.into(), assets: set(a), unlinked: 0 } - } - fn ra(id: &str, name: &str, a: &[&str]) -> RemoteAlbum { - RemoteAlbum { id: id.into(), name: name.into(), assets: set(a) } - } - fn rule(direction: Direction, policy: Policy) -> FieldRule { - FieldRule { direction, policy } - } - fn linked(base: &[&str], name: &str) -> AlbumLinks { - BTreeMap::from([(1, AlbumLink { immich: "r1".into(), base: Some(set(base)), name: Some(name.into()) })]) - } - - #[test] - fn off_syncs_only_hand_linked_albums() { - let p = plan(rule(Direction::Off, Policy::Ask), &[la(1, "A", &["x"]), la(2, "B", &[])], &[ra("r9", "C", &["y"])], &AlbumLinks::new(), &[]); - assert!(p.remote.is_empty() && p.local.is_empty() && p.links.is_empty()); - } - - #[test] - fn two_way_links_by_name_and_creates_the_rest() { - let p = plan( - rule(Direction::TwoWay, Policy::Ask), - &[la(1, "Trip", &["a"]), la(2, "Only here", &["b"])], - &[ra("r1", "Trip", &["c"]), ra("r2", "Only there", &[])], - &AlbumLinks::new(), - &[], - ); - assert_eq!(p.links[&1].immich, "r1"); - assert!(p.remote.contains(&RemoteOp::Add { id: "r1".into(), assets: vec!["a".into()] })); - assert!(p.local.contains(&LocalOp::Add { id: 1, assets: vec!["c".into()] })); - assert!(p.remote.contains(&RemoteOp::Create { local: 2, name: "Only here".into(), assets: set(&["b"]) })); - assert!(p.local.contains(&LocalOp::Create { immich: "r2".into(), name: "Only there".into(), assets: set(&[]) })); - } - - #[test] - fn one_way_never_writes_the_source_side() { - let p = plan( - rule(Direction::ToImmich, Policy::Newest), - &[la(1, "New", &["a"])], - &[ra("r1", "Old", &["b"]), ra("r2", "X", &[])], - &linked(&["b"], "Old"), - &[], - ); - assert!(p.local.is_empty(), "{:?}", p.local); - assert!(p.remote.contains(&RemoteOp::Rename { id: "r1".into(), name: "New".into() })); - assert!(p.remote.contains(&RemoteOp::Add { id: "r1".into(), assets: vec!["a".into()] })); - assert!(p.remote.contains(&RemoteOp::Remove { id: "r1".into(), assets: vec!["b".into()] })); - let p = - plan(rule(Direction::FromImmich, Policy::Newest), &[la(1, "New", &["a"])], &[ra("r1", "Old", &["b", "c"])], &linked(&["b"], "Old"), &[]); - assert!(p.remote.is_empty(), "{:?}", p.remote); - assert_eq!(p.local, vec![LocalOp::Add { id: 1, assets: vec!["c".into()] }]); - } - - #[test] - fn renames_follow_the_policy() { - let both = |pol| plan(rule(Direction::TwoWay, pol), &[la(1, "Mine", &[])], &[ra("r1", "Theirs", &[])], &linked(&[], "Old"), &[]); - assert_eq!(both(Policy::Catalog).remote, vec![RemoteOp::Rename { id: "r1".into(), name: "Mine".into() }]); - assert_eq!(both(Policy::Immich).local, vec![LocalOp::Rename { id: 1, name: "Theirs".into() }]); - let p = both(Policy::Ask); - assert!(p.remote.is_empty() && p.local.is_empty() && p.conflicts.len() == 1); - assert_eq!(p.links[&1].name.as_deref(), Some("Old")); - } - - #[test] - fn deletes_follow_the_policy_and_never_touch_photos() { - // deleted in the catalog - let gone = |pol, remote: RemoteAlbum| plan(rule(Direction::TwoWay, pol), &[], &[remote], &linked(&["a"], "A"), &[]); - let p = gone(Policy::Newest, ra("r1", "A", &["a"])); - assert_eq!(p.remote, vec![RemoteOp::Delete { id: "r1".into() }]); - assert!(p.links.is_empty()); - // …but Immich changed it since: the user decides - let p = gone(Policy::Newest, ra("r1", "A", &["a", "b"])); - assert!(p.remote.is_empty()); - assert_eq!(p.pending[0].deleted_on, DeletedOn::Catalog); - assert!(p.links.contains_key(&1)); - let p = gone(Policy::Ask, ra("r1", "A", &["a"])); - assert!(p.remote.is_empty() && p.pending.len() == 1); - // Immich wins: unlinked, created again in the catalog - let p = gone(Policy::Immich, ra("r1", "A", &["a"])); - assert!(p.remote.is_empty() && p.links.is_empty() && p.pending.is_empty()); - assert_eq!(p.local, vec![LocalOp::Create { immich: "r1".into(), name: "A".into(), assets: set(&["a"]) }]); - // deleted in Immich - let p = plan(rule(Direction::TwoWay, Policy::Immich), &[la(1, "A", &["a"])], &[], &linked(&["a"], "A"), &[]); - assert_eq!(p.local, vec![LocalOp::Delete { id: 1 }]); - // a waiting deletion is left alone - let w = PendingDelete { album: 1, immich: "r1".into(), name: "A".into(), deleted_on: DeletedOn::Immich }; - let p = plan(rule(Direction::TwoWay, Policy::Immich), &[la(1, "A", &["a"])], &[], &linked(&["a"], "A"), &[w]); - assert!(p.local.is_empty() && p.links.contains_key(&1)); - // to Immich only: an Immich-side delete is not followed; the album goes back to Immich - let p = plan(rule(Direction::ToImmich, Policy::Immich), &[la(1, "A", &["a"])], &[], &linked(&["a"], "A"), &[]); - assert!(p.local.is_empty() && p.pending.is_empty()); - assert_eq!(p.remote, vec![RemoteOp::Create { local: 1, name: "A".into(), assets: set(&["a"]) }]); - } - - /// An Immich album delete never takes a catalog album that holds photos Immich never had. - #[test] - fn an_immich_delete_keeps_an_album_with_local_only_photos() { - for pol in [Policy::Immich, Policy::Newest] { - let mut l = la(1, "A", &["a"]); - l.unlinked = 2; - let p = plan(rule(Direction::TwoWay, pol), &[l.clone()], &[], &linked(&["a"], "A"), &[]); - assert!(p.local.is_empty(), "{pol:?}: the album is not deleted: {:?}", p.local); - assert!(p.remote.is_empty(), "{pol:?}: and not created again in Immich: {:?}", p.remote); - assert_eq!(p.kept, vec![KeptAlbum { album: 1, name: "A".into(), unlinked: 2 }]); - assert!(p.links[&1].is_local_only()); - // later runs leave it alone: no album is made or matched for it, nothing is reported twice - let again = plan(rule(Direction::TwoWay, pol), &[l], &[ra("r7", "A", &["z"])], &p.links, &[]); - assert!(again.remote.is_empty() && again.kept.is_empty(), "{again:?}"); - assert!(!again.local.iter().any(|o| matches!(o, LocalOp::Add { .. } | LocalOp::Delete { .. } | LocalOp::Remove { .. })), "{again:?}"); - assert!(again.links[&1].is_local_only()); - } - // only linked photos in it: the delete travels as before - let p = plan(rule(Direction::TwoWay, Policy::Immich), &[la(1, "A", &["a"])], &[], &linked(&["a"], "A"), &[]); - assert_eq!(p.local, vec![LocalOp::Delete { id: 1 }]); - // ask still asks (the user may delete it knowingly) - let mut l = la(1, "A", &["a"]); - l.unlinked = 1; - let p = plan(rule(Direction::TwoWay, Policy::Ask), &[l], &[], &linked(&["a"], "A"), &[]); - assert!(p.local.is_empty() && p.kept.is_empty() && p.pending.len() == 1); - } - - /// The base after a failed add must not hold the asset: else the next run reads "was in both, - /// gone from Immich" and removes the photo from the catalog album. - #[test] - fn a_failed_add_is_added_again_and_never_removes_from_the_catalog() { - let r = rule(Direction::TwoWay, Policy::Ask); - // first matched by name, the catalog has `a` and `b`, Immich nothing - let p = plan(r, &[la(1, "Trip", &["a", "b"])], &[ra("r1", "Trip", &[])], &AlbumLinks::new(), &[]); - assert_eq!(p.remote, vec![RemoteOp::Add { id: "r1".into(), assets: vec!["a".into(), "b".into()] }]); - // the add of `b` did not work - let mut links = p.links.clone(); - links.get_mut(&1).unwrap().not_added([&"b".to_string()]); - assert_eq!(links[&1].base, Some(set(&["a"]))); - let next = plan(r, &[la(1, "Trip", &["a", "b"])], &[ra("r1", "Trip", &["a"])], &links, &[]); - assert!(next.local.is_empty(), "nothing leaves the catalog album: {:?}", next.local); - assert_eq!(next.remote, vec![RemoteOp::Add { id: "r1".into(), assets: vec!["b".into()] }]); - // …whereas the uncorrected base would have removed it (the bug this guards against) - let wrong = plan(r, &[la(1, "Trip", &["a", "b"])], &[ra("r1", "Trip", &["a"])], &p.links, &[]); - assert_eq!(wrong.local, vec![LocalOp::Remove { id: 1, assets: vec!["b".into()] }]); - - // a failed remove: the asset stays in the base and is removed again, not pulled back in - let p = plan(r, &[la(1, "Trip", &["a"])], &[ra("r1", "Trip", &["a", "b"])], &linked(&["a", "b"], "Trip"), &[]); - assert_eq!(p.remote, vec![RemoteOp::Remove { id: "r1".into(), assets: vec!["b".into()] }]); - let mut links = p.links.clone(); - links.get_mut(&1).unwrap().not_removed([&"b".to_string()]); - let next = plan(r, &[la(1, "Trip", &["a"])], &[ra("r1", "Trip", &["a", "b"])], &links, &[]); - assert!(next.local.is_empty(), "{:?}", next.local); - assert_eq!(next.remote, vec![RemoteOp::Remove { id: "r1".into(), assets: vec!["b".into()] }]); - } -} diff --git a/crates/immich/src/lib.rs b/crates/immich/src/lib.rs index 23f169693c..91e96d6977 100644 --- a/crates/immich/src/lib.rs +++ b/crates/immich/src/lib.rs @@ -23,7 +23,6 @@ #![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)] pub mod accounts; -pub mod albums; pub mod extlib; pub mod link; pub mod mapping; diff --git a/crates/immich/src/sync.rs b/crates/immich/src/sync.rs index ecca6ee67b..7a0e46f051 100644 --- a/crates/immich/src/sync.rs +++ b/crates/immich/src/sync.rs @@ -130,8 +130,9 @@ pub struct SyncConfig { pub on_publish: bool, /// Send names given in the app back to Immich's people (IMM-PEOPLE). pub push_people: bool, - /// Collections ↔ albums (`crate::albums`); unset: [`SyncConfig::album_rule`]'s default. - #[serde(skip_serializing_if = "Option::is_none")] + /// No longer used or written: the old name-matching album rule. An account that had it on + /// shows its albums as collections instead ([`crate::accounts::Accounts::load`]). + #[serde(skip_serializing)] pub albums: Option, } @@ -139,11 +140,6 @@ impl SyncConfig { pub fn rule(&self, f: Field) -> FieldRule { self.rules.get(&f).copied().unwrap_or_else(|| default_rule(f)) } - - /// The album rule: by default only albums linked by hand sync, and album deletes ask. - pub fn album_rule(&self) -> FieldRule { - self.albums.unwrap_or(FieldRule { direction: Direction::Off, policy: Policy::Ask }) - } } /// The defaults of the plan's mapping table. diff --git a/crates/immich/src/tests.rs b/crates/immich/src/tests.rs index 56049915fe..ca8e9811e3 100644 --- a/crates/immich/src/tests.rs +++ b/crates/immich/src/tests.rs @@ -594,6 +594,16 @@ fn accounts_file_round_trips_without_secrets() { std::fs::write(&path, b"{not json").unwrap(); assert!(crate::Accounts::load(&path).is_err()); assert_eq!(crate::Accounts::load(&dir.join("missing.json")).unwrap(), crate::Accounts::default()); + // the old name-matching album rule: on → albums as collections; off → nothing; never written again + std::fs::write( + &path, + br#"{"immich":[{"id":"a#1","url":"http://a","userId":"1","sync":{"albums":{"direction":"twoWay","policy":"ask"}}},{"id":"b#2","url":"http://b","userId":"2","sync":{"albums":{"direction":"off","policy":"ask"}}}]}"#, + ) + .unwrap(); + let m = crate::Accounts::load(&path).unwrap(); + assert!(m.immich[0].collections && !m.immich[1].collections); + m.save(&path).unwrap(); + assert!(!std::fs::read_to_string(&path).unwrap().contains("albums")); } // Regression: Immich doesn't hash external-library files (checksum = SHA-1 of `path:` + path), diff --git a/crates/ui-egui/locales/fork/cs-formats.json b/crates/ui-egui/locales/fork/cs-formats.json index f92f724da3..32e033589f 100644 --- a/crates/ui-egui/locales/fork/cs-formats.json +++ b/crates/ui-egui/locales/fork/cs-formats.json @@ -108,6 +108,7 @@ "Page {page} of {pages}": "Strana {page} z {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Posun zpět nebo opětovné přiblížení úpravy HDR ji zobrazí hned, bez nového vykreslování. Na této obrazovce používá až {need} MB grafické paměti.", "Person {n}": "Osoba {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Fotky ve složce {folder} jdou do sbírky „Camera Roll - název tohoto zařízení“.", "Picks to unflag: {n}": "Vybrané k odznačení: {n}", "Preset {name} on {n} photos": "Předvolba {name} na fotkách: {n}", "Print settings not saved: {e}": "Nastavení tisku nebylo uloženo: {e}", diff --git a/crates/ui-egui/locales/fork/cs.json b/crates/ui-egui/locales/fork/cs.json index 19940ac06b..858d4f4c0d 100644 --- a/crates/ui-egui/locales/fork/cs.json +++ b/crates/ui-egui/locales/fork/cs.json @@ -314,6 +314,7 @@ "Camera Profiles": "Profily fotoaparátu", "Camera Profiles (.dcp)": "Profily fotoaparátu (.dcp)", "Camera Profiles for Import": "Profily fotoaparátu pro import", + "Camera Roll Listed": "Fotoaparát vypsán", "Camera Sensor": "Snímač fotoaparátu", "Camera Serial Number": "Sériové číslo fotoaparátu", "Camera bodies": "Těla fotoaparátů", @@ -772,7 +773,7 @@ "Duplicates": "Duplikáty", "Duration (seconds)": "Délka (sekundy)", "E: every device keeps the original and can add photos": "E: každé zařízení uchovává originál a může přidávat fotky", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Každé album je sbírkou v sadě Immich; v Nastavení ▸ Synchronizace každé zařízení volí Nic, Náhledy nebo Plnou kvalitu.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Každé album je sbírkou v sadě Immich; v Nastavení > Synchronizace každé zařízení volí Nic, Náhledy nebo Plnou kvalitu.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Každé zařízení má vlastní katalog a vidí jen kolekce, které smí a chce převzít.", "Each of the {n} selected photos gets the reference that fits it": "Každá z {n} vybraných fotografií dostane referenci, která jí odpovídá", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Ostřejší oko každé osoby ve 100 % přes horní okraj lupy. Přepíná ho i lišta rychlých nastavení (najeďte ukazatelem na prázdné místo vedle názvů modulů).", @@ -1456,6 +1457,7 @@ "Lips": "Rty", "List AI Models": "Vypsat modely AI", "List History Groups": "Vypsat skupiny historie", + "List Immich Albums Now": "Vypsat alba Immich nyní", "List Lens Profiles": "Vypsat profily objektivů", "List Plug-in Filters": "Vypsat filtry zásuvných modulů", "List Preset Folders": "Vypsat složky přednastavení", @@ -1501,6 +1503,7 @@ "Look Up Selected Photos": "Vyhledat vybrané fotografie", "Look at downsized copies of photos": "Prohlížet zmenšené kopie fotografií", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Hledat fotografie, které jiné aplikace přidaly do složek katalogu, při otevření katalogu, při přepnutí do aplikace a každých několik minut. Prohledávají se jen složky, jejichž obsah se změnil.", + "Look in the Camera Roll Now": "Prohledat fotoaparát nyní", "Looking for color charts": "Hledání barevných terčů", "Looking for color charts…": "Hledání barevných terčů…", "Looking for devices": "Hledání zařízení", @@ -1947,7 +1950,6 @@ "Photos imported": "Fotografie importovány", "Photos imported from now on; photos already in the catalog keep theirs.": "Fotografie importované od této chvíle; fotografie již v katalogu si ponechají svá nastavení.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Fotky z fotoaparátu jdou do sbírky „Camera Roll - název tohoto zařízení“.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Fotky ve složce {folder} jdou do sbírky „Camera Roll - název tohoto zařízení“.", "Photos that use the old reference keep it.": "Fotografie, které používají starou referenci, si ji ponechají.", "Photos whose capture time can't be read were left as they were": "Fotografie, jejichž čas pořízení nelze přečíst, zůstaly beze změny", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Fotografie, jejichž soubor metadat změnil jiný program: uložení nahradí tyto změny údaji z katalogu.", @@ -2481,6 +2483,7 @@ "Shadow clipping": "Ořezání stínů", "Share": "Sdílet", "Share Catalog": "Sdílet katalog", + "Share Immich Connection with Synced Devices": "Sdílet připojení Immich se synchronizovanými zařízeními", "Share Web Gallery via Immich": "Sdílet webovou galerii přes Immich", "Share the New Collection?": "Sdílet novou kolekci?", "Share via Immich": "Sdílet přes Immich", @@ -2505,6 +2508,7 @@ "Show HSL Color Values": "Zobrazit hodnoty barev HSL", "Show Header Bar": "Zobrazit záhlaví", "Show Hidden Favorites": "Zobrazit skryté oblíbené", + "Show Immich Albums as Collections": "Zobrazit alba Immich jako sbírky", "Show Immich albums as collections": "Zobrazit alba Immich jako sbírky", "Show Import Tab Settings": "Zobrazit nastavení karty Import", "Show Index Numbers": "Zobrazit pořadová čísla", @@ -2687,6 +2691,7 @@ "Sync With Paired Devices": "Synchronizovat se spárovanými zařízeními", "Sync With This Catalog": "Synchronizovat s tímto katalogem", "Sync conflicts ({})": "Konflikty synchronizace ({})", + "Sync the Camera Roll": "Synchronizovat fotoaparát", "Sync this catalog": "Synchronizovat tento katalog", "Sync this device's camera roll": "Synchronizovat fotoaparát tohoto zařízení", "Sync: Devices or Immich": "Synchronizace: zařízení nebo Immich", diff --git a/crates/ui-egui/locales/fork/de-formats.json b/crates/ui-egui/locales/fork/de-formats.json index 7ec9ca5b05..6f70ba30a2 100644 --- a/crates/ui-egui/locales/fork/de-formats.json +++ b/crates/ui-egui/locales/fork/de-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "Seite {page} von {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Zurückschwenken oder erneutes Hineinzoomen in eine HDR-Bearbeitung zeigt sie sofort, statt sie neu zu rendern. Belegt auf diesem Bildschirm bis zu {need} MB Grafikspeicher.", "Person {n}": "Person {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Fotos in {folder} kommen in die Sammlung „Camera Roll - Name dieses Geräts“.", "Picks to unflag: {n}": "Auswahlen zum Entfernen der Markierung: {n}", "Preset {name} on {n} photos": "Vorgabe {name} auf {n} Fotos", "Print settings not saved: {e}": "Druckeinstellungen nicht gespeichert: {e}", diff --git a/crates/ui-egui/locales/fork/de.json b/crates/ui-egui/locales/fork/de.json index eca3823ddb..1aa437e7a2 100644 --- a/crates/ui-egui/locales/fork/de.json +++ b/crates/ui-egui/locales/fork/de.json @@ -291,6 +291,7 @@ "Camera Profiles": "Kameraprofile", "Camera Profiles (.dcp)": "Kameraprofile (.dcp)", "Camera Profiles for Import": "Kameraprofile für den Import", + "Camera Roll Listed": "Kamerarolle aufgelistet", "Camera Serial Number": "Seriennummer der Kamera", "Camera bodies": "Kameragehäuse", "Camera default": "Kamerastandard", @@ -741,7 +742,7 @@ "Duration": "Dauer", "Duration (seconds)": "Dauer (Sekunden)", "E: every device keeps the original and can add photos": "E: Jedes Gerät behält das Original und kann Fotos hinzufügen", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Jedes Album ist eine Sammlung im Satz „Immich“; unter Einstellungen ▸ Synchronisierung wählt jedes Gerät Keine, Vorschauen oder Volle Qualität.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Jedes Album ist eine Sammlung im Satz „Immich“; unter Einstellungen > Synchronisierung wählt jedes Gerät Keine, Vorschauen oder Volle Qualität.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Jedes Gerät behält seinen eigenen Katalog und sieht nur die Sammlungen, die es übernehmen darf und will.", "Each of the {n} selected photos gets the reference that fits it": "Jedes der {n} ausgewählten Fotos erhält die Referenz, die zu ihm passt", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Das schärfere Auge jeder Person bei 100 % oben in der Lupe. Die Schnelleinstellungsleiste (Zeiger auf die freie Fläche neben den Modulnamen) schaltet sie ebenfalls.", @@ -1383,6 +1384,7 @@ "Lips": "Lippen", "List AI Models": "KI-Modelle auflisten", "List History Groups": "Verlaufsgruppen auflisten", + "List Immich Albums Now": "Immich-Alben jetzt auflisten", "List Lens Profiles": "Objektivprofile auflisten", "List Plug-in Filters": "Plug-in-Filter auflisten", "List Preset Folders": "Vorgabenordner auflisten", @@ -1420,6 +1422,7 @@ "Look Up Selected Photos": "Ausgewählte Fotos nachschlagen", "Look at downsized copies of photos": "Verkleinerte Kopien von Fotos ansehen", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Beim Öffnen des Katalogs, wenn die App in den Vordergrund kommt, und alle paar Minuten nach Fotos suchen, die andere Apps in die Ordner des Katalogs gelegt haben. Nur Ordner, deren Inhalt sich geändert hat, werden durchsucht.", + "Look in the Camera Roll Now": "Jetzt in der Kamerarolle nachsehen", "Looking for color charts…": "Farbtafeln werden gesucht…", "Looking for devices": "Geräte werden gesucht", "Looking for devices on this network…": "Suche nach Geräten in diesem Netzwerk …", @@ -1853,7 +1856,6 @@ "Photos imported": "Importierte Fotos", "Photos imported from now on; photos already in the catalog keep theirs.": "Ab jetzt importierte Fotos; Fotos, die bereits im Katalog sind, behalten ihre.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Fotos der Kamerarolle kommen in die Sammlung „Camera Roll - Name dieses Geräts“.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Fotos in {folder} kommen in die Sammlung „Camera Roll - Name dieses Geräts“.", "Photos that use the old reference keep it.": "Fotos, die die alte Referenz verwenden, behalten sie.", "Photos whose capture time can't be read were left as they were": "Fotos, deren Aufnahmezeit nicht lesbar ist, blieben unverändert", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Fotos, deren Metadatendatei ein anderes Programm geändert hat: Speichern ersetzt diese Änderungen durch die des Katalogs.", @@ -2354,6 +2356,7 @@ "Shadow clipping": "Tiefenbeschneidung", "Share": "Teilen", "Share Catalog": "Katalog teilen", + "Share Immich Connection with Synced Devices": "Immich-Verbindung mit synchronisierten Geräten teilen", "Share Web Gallery via Immich": "Webgalerie über Immich teilen", "Share the New Collection?": "Die neue Sammlung teilen?", "Share via Immich": "Über Immich teilen", @@ -2377,6 +2380,7 @@ "Show HSL Color Values": "HSL-Farbwerte anzeigen", "Show Header Bar": "Kopfleiste anzeigen", "Show Hidden Favorites": "Ausgeblendete Favoriten anzeigen", + "Show Immich Albums as Collections": "Immich-Alben als Sammlungen zeigen", "Show Immich albums as collections": "Immich-Alben als Sammlungen zeigen", "Show Import Tab Settings": "Einstellungen des Import-Registers anzeigen", "Show Index Numbers": "Indexnummern anzeigen", @@ -2555,6 +2559,7 @@ "Sync With Paired Devices": "Mit gekoppelten Geräten synchronisieren", "Sync With This Catalog": "Mit diesem Katalog synchronisieren", "Sync conflicts ({})": "Synchronisierungskonflikte ({})", + "Sync the Camera Roll": "Kamerarolle synchronisieren", "Sync this catalog": "Diesen Katalog synchronisieren", "Sync this device's camera roll": "Kamerarolle dieses Geräts synchronisieren", "Sync: Devices or Immich": "Synchronisierung: Geräte oder Immich", diff --git a/crates/ui-egui/locales/fork/es-formats.json b/crates/ui-egui/locales/fork/es-formats.json index 79e5e198f8..d6d3dd108f 100644 --- a/crates/ui-egui/locales/fork/es-formats.json +++ b/crates/ui-egui/locales/fork/es-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "Página {page} de {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Volver a desplazarse o a ampliar una edición HDR la muestra al instante en lugar de renderizarla de nuevo. Usa hasta {need} MB de memoria gráfica en esta pantalla.", "Person {n}": "Persona {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Las fotos de {folder} van a la colección «Camera Roll - nombre de este dispositivo».", "Picks to unflag: {n}": "Elegidas a desmarcar: {n}", "Preset {name} on {n} photos": "Ajuste {name} en {n} fotos", "Print settings not saved: {e}": "Ajustes de impresión no guardados: {e}", diff --git a/crates/ui-egui/locales/fork/es.json b/crates/ui-egui/locales/fork/es.json index e794d8e3cb..84a6f68ee5 100644 --- a/crates/ui-egui/locales/fork/es.json +++ b/crates/ui-egui/locales/fork/es.json @@ -323,6 +323,7 @@ "Camera Profiles": "Perfiles de cámara", "Camera Profiles (.dcp)": "Perfiles de cámara (.dcp)", "Camera Profiles for Import": "Perfiles de cámara para la importación", + "Camera Roll Listed": "Carrete listado", "Camera Serial Number": "Número de serie de la cámara", "Camera bodies": "Cuerpos de cámara", "Camera default": "Predeterminado de la cámara", @@ -813,7 +814,7 @@ "Duration": "Duración", "Duration (seconds)": "Duración (segundos)", "E: every device keeps the original and can add photos": "E: cada dispositivo conserva el original y puede añadir fotos", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Cada álbum es una colección del conjunto Immich; en Ajustes ▸ Sincronización cada dispositivo elige Nada, Vistas previas o Calidad completa.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Cada álbum es una colección del conjunto Immich; en Ajustes > Sincronización cada dispositivo elige Nada, Vistas previas o Calidad completa.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Cada dispositivo conserva su propio catálogo y solo ve las colecciones que puede y elige tomar.", "Each of the {n} selected photos gets the reference that fits it": "Cada una de las {n} fotos seleccionadas recibe la referencia que le corresponde", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "El ojo más nítido de cada persona al 100 % en la parte superior de la lupa. La barra de ajustes rápidos (señale el espacio junto a los nombres de los módulos) también la activa.", @@ -1505,6 +1506,7 @@ "Lips": "Labios", "List AI Models": "Listar modelos de IA", "List History Groups": "Listar grupos del historial", + "List Immich Albums Now": "Listar ahora los álbumes de Immich", "List Lens Profiles": "Listar perfiles de objetivo", "List Plug-in Filters": "Listar filtros de complementos", "List Preset Folders": "Listar carpetas de ajustes preestablecidos", @@ -1542,6 +1544,7 @@ "Look Up Selected Photos": "Buscar las fotos seleccionadas", "Look at downsized copies of photos": "Ver copias reducidas de las fotos", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Buscar fotos que otras apps hayan añadido a las carpetas del catálogo al abrirlo, al volver a la app y cada pocos minutos. Solo se examinan las carpetas cuyo contenido ha cambiado.", + "Look in the Camera Roll Now": "Revisar el carrete ahora", "Looking for color charts…": "Buscando cartas de color…", "Looking for devices": "Buscando dispositivos", "Looking for devices on this network…": "Buscando dispositivos en esta red…", @@ -2020,7 +2023,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "Las fotos importadas a partir de ahora; las que ya están en el catálogo conservan el que tienen.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Las fotos en Eliminados recientemente se pueden restaurar desde la app: clic derecho → Restaurar (o Eliminar permanentemente), también en el", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Las fotos del carrete van a la colección «Camera Roll - nombre de este dispositivo».", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Las fotos de {folder} van a la colección «Camera Roll - nombre de este dispositivo».", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "Las fotos se quedan en Todas las fotos. Eliminar una carpeta también elimina sus álbumes. Puedes deshacerlo.", "Photos that use the old reference keep it.": "Las fotos que usan la referencia antigua la conservan.", "Photos whose capture time can't be read were left as they were": "Las fotos cuya hora de captura no se puede leer se dejaron como estaban", @@ -2576,6 +2578,7 @@ "Shadow clipping": "Recorte de sombras", "Share": "Compartir", "Share Catalog": "Compartir catálogo", + "Share Immich Connection with Synced Devices": "Compartir la conexión de Immich con los dispositivos sincronizados", "Share Web Gallery via Immich": "Compartir galería web mediante Immich", "Share the New Collection?": "¿Compartir la nueva colección?", "Share via Immich": "Compartir mediante Immich", @@ -2600,6 +2603,7 @@ "Show HSL Color Values": "Mostrar valores de color HSL", "Show Header Bar": "Mostrar barra de encabezado", "Show Hidden Favorites": "Mostrar favoritos ocultos", + "Show Immich Albums as Collections": "Mostrar los álbumes de Immich como colecciones", "Show Immich albums as collections": "Mostrar los álbumes de Immich como colecciones", "Show Import Tab Settings": "Mostrar ajustes de la pestaña Importar", "Show Index Numbers": "Mostrar números de índice", @@ -2799,6 +2803,7 @@ "Sync With Paired Devices": "Sincronizar con dispositivos emparejados", "Sync With This Catalog": "Sincronizar con este catálogo", "Sync conflicts ({})": "Conflictos de sincronización ({})", + "Sync the Camera Roll": "Sincronizar el carrete", "Sync this catalog": "Sincronizar este catálogo", "Sync this device's camera roll": "Sincronizar el carrete de este dispositivo", "Sync: Devices or Immich": "Sincronización: dispositivos o Immich", diff --git a/crates/ui-egui/locales/fork/fi-formats.json b/crates/ui-egui/locales/fork/fi-formats.json index fcfb6c9a0b..48f2a07e5f 100644 --- a/crates/ui-egui/locales/fork/fi-formats.json +++ b/crates/ui-egui/locales/fork/fi-formats.json @@ -114,6 +114,7 @@ "Paint over what to replace, then click Generate. About ${usd} per variation.": "Maalaa korvattavan kohdan yli ja napsauta Luo. Noin ${usd} muunnelmaa kohden.", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Kun panoroit takaisin tai lähennät uudelleen HDR-muokkaukseen, se näytetään heti eikä piirretä uudelleen. Käyttää tällä näytöllä enintään {need} Mt näyttömuistia.", "Person {n}": "Henkilö {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Kansion {folder} kuvat menevät kokoelmaan ”Camera Roll - tämän laitteen nimi”.", "Picks to unflag: {n}": "Liputuksen poistettavat valinnat: {n}", "Preset {name} on {n} photos": "Esiasetus {name} {n} kuvaan", "Print settings not saved: {e}": "Tulostusasetuksia ei tallennettu: {e}", diff --git a/crates/ui-egui/locales/fork/fi.json b/crates/ui-egui/locales/fork/fi.json index 86ad092858..0e894e371d 100644 --- a/crates/ui-egui/locales/fork/fi.json +++ b/crates/ui-egui/locales/fork/fi.json @@ -337,6 +337,7 @@ "Camera Profiles": "Kameraprofiilit", "Camera Profiles (.dcp)": "Kameraprofiilit (.dcp)", "Camera Profiles for Import": "Kameraprofiilit tuontia varten", + "Camera Roll Listed": "Kamerarulla listattu", "Camera Sensor": "Kameran kenno", "Camera Serial Number": "Kameran sarjanumero", "Camera bodies": "Kamerarungot", @@ -821,7 +822,7 @@ "Duplicates": "Kaksoiskappaleet", "Duration (seconds)": "Kesto (sekuntia)", "E: every device keeps the original and can add photos": "E: jokainen laite säilyttää alkuperäisen ja voi lisätä kuvia", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Jokainen albumi on kokoelma Immich-joukossa; kohdassa Asetukset ▸ Synkronointi kukin laite valitsee Ei mitään, Esikatselut tai Täysi laatu.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Jokainen albumi on kokoelma Immich-joukossa; kohdassa Asetukset > Synkronointi kukin laite valitsee Ei mitään, Esikatselut tai Täysi laatu.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Jokainen laite säilyttää oman katalogin ja näkee vain kokoelmat, jotka se saa ja valitsee ottaa.", "Each of the {n} selected photos gets the reference that fits it": "Jokainen {n} valitusta kuvasta saa siihen sopivan viitekuvan", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Kunkin henkilön terävämpi silmä 100 %:ssa luupin yläreunassa. Myös pika-asetusten palkki (osoita moduulien nimien vieressä olevaa tyhjää kohtaa) kytkee sen.", @@ -1528,6 +1529,7 @@ "Lips": "Huulet", "List AI Models": "Luettele tekoälymallit", "List History Groups": "Luettele historiaryhmät", + "List Immich Albums Now": "Listaa Immich-albumit nyt", "List Lens Profiles": "Luettele objektiiviprofiilit", "List Plug-in Filters": "Luettele laajennussuodattimet", "List Preset Folders": "Luettele esiasetuskansiot", @@ -1574,6 +1576,7 @@ "Look Up Selected Photos": "Hae valittujen kuvien sijainnit", "Look at downsized copies of photos": "Tarkastele kuvien pienennettyjä kopioita", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Etsi kuvia, joita muut sovellukset ovat lisänneet katalogin kansioihin, kun katalogi avataan, kun sovellus tulee etualalle ja muutaman minuutin välein. Vain kansiot, joiden sisältö on muuttunut, skannataan.", + "Look in the Camera Roll Now": "Katso kamerarulla nyt", "Looking for color charts": "Etsitään värikarttoja", "Looking for color charts…": "Etsitään värikarttoja…", "Looking for devices": "Etsitään laitteita", @@ -2052,7 +2055,6 @@ "Photos imported": "Tuodut kuvat", "Photos imported from now on; photos already in the catalog keep theirs.": "Tästä lähtien tuotavat kuvat; katalogissa jo olevat kuvat säilyttävät omansa.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Kamerarullan kuvat menevät kokoelmaan ”Camera Roll - tämän laitteen nimi”.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Kansion {folder} kuvat menevät kokoelmaan ”Camera Roll - tämän laitteen nimi”.", "Photos that use the old reference keep it.": "Vanhaa viitekuvaa käyttävät kuvat säilyttävät sen.", "Photos whose capture time can't be read were left as they were": "Kuvat, joiden kuvausaikaa ei voi lukea, jätettiin ennalleen", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Kuvat, joiden metatietotiedostoa toinen ohjelma on muuttanut: tallentaminen korvaa nämä muutokset katalogin tiedoilla.", @@ -2644,6 +2646,7 @@ "Shadow clipping": "Varjojen leikkautuminen", "Share": "Jaa", "Share Catalog": "Jaa katalogi", + "Share Immich Connection with Synced Devices": "Jaa Immich-yhteys synkronoitujen laitteiden kanssa", "Share Web Gallery via Immich": "Jaa verkkogalleria Immichin kautta", "Share the New Collection?": "Jaetaanko uusi kokoelma?", "Share via Immich": "Jaa Immichin kautta", @@ -2672,6 +2675,7 @@ "Show HSL Color Values": "Näytä HSL-väriarvot", "Show Header Bar": "Näytä otsikkopalkki", "Show Hidden Favorites": "Näytä piilotetut suosikit", + "Show Immich Albums as Collections": "Näytä Immich-albumit kokoelmina", "Show Immich albums as collections": "Näytä Immich-albumit kokoelmina", "Show Import Tab Settings": "Näytä Tuo-välilehden asetukset", "Show Index Numbers": "Näytä järjestysnumerot", @@ -2869,6 +2873,7 @@ "Sync With Paired Devices": "Synkronoi pariliitettyjen laitteiden kanssa", "Sync With This Catalog": "Synkronoi tämän katalogin kanssa", "Sync conflicts ({})": "Synkronoinnin ristiriidat ({})", + "Sync the Camera Roll": "Synkronoi kamerarulla", "Sync this catalog": "Synkronoi tämä katalogi", "Sync this device's camera roll": "Synkronoi tämän laitteen kamerarulla", "Sync: Devices or Immich": "Synkronointi: laitteet tai Immich", diff --git a/crates/ui-egui/locales/fork/fr-formats.json b/crates/ui-egui/locales/fork/fr-formats.json index 526740ad9e..461bbb2b5e 100644 --- a/crates/ui-egui/locales/fork/fr-formats.json +++ b/crates/ui-egui/locales/fork/fr-formats.json @@ -99,6 +99,7 @@ "Page {page} of {pages}": "Page {page} sur {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Revenir en arrière ou zoomer de nouveau sur une retouche HDR l’affiche immédiatement au lieu de la rendre de nouveau. Utilise jusqu’à {need} Mo de mémoire graphique sur cet écran.", "Person {n}": "Personne {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Les photos de {folder} vont dans la collection « Camera Roll - nom de cet appareil ».", "Picks to unflag: {n}": "Retenues à déflaguer : {n}", "Preset {name} on {n} photos": "Paramètre {name} sur {n} photos", "Print settings not saved: {e}": "Réglages d'impression non enregistrés : {e}", diff --git a/crates/ui-egui/locales/fork/fr.json b/crates/ui-egui/locales/fork/fr.json index 88b4d1d00f..e4a12a5c87 100644 --- a/crates/ui-egui/locales/fork/fr.json +++ b/crates/ui-egui/locales/fork/fr.json @@ -295,6 +295,7 @@ "Camera Profiles": "Profils d’appareil", "Camera Profiles (.dcp)": "Profils d’appareil (.dcp)", "Camera Profiles for Import": "Profils d’appareil à l’importation", + "Camera Roll Listed": "Pellicule listée", "Camera Serial Number": "Numéro de série de l’appareil", "Camera bodies": "Boîtiers", "Camera default": "Par défaut de l’appareil", @@ -729,7 +730,7 @@ "Duration": "Durée", "Duration (seconds)": "Durée (secondes)", "E: every device keeps the original and can add photos": "E: chaque appareil garde l’original et peut ajouter des photos", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Chaque album est une collection de l’ensemble Immich ; dans Réglages ▸ Synchronisation, chaque appareil choisit Aucun, Aperçus ou Qualité complète.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Chaque album est une collection de l’ensemble Immich ; dans Réglages > Synchronisation, chaque appareil choisit Aucun, Aperçus ou Qualité complète.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Chaque appareil garde son propre catalogue et ne voit que les collections qu’il est autorisé et choisit à prendre.", "Each of the {n} selected photos gets the reference that fits it": "Chacune des {n} photos sélectionnées reçoit la référence qui lui correspond", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "L'œil le plus net de chaque personne à 100 % en haut de la loupe. La barre de réglages rapides (pointez l'espace à côté des noms des modules) l'active aussi.", @@ -1368,6 +1369,7 @@ "Lips": "Lèvres", "List AI Models": "Lister les modèles IA", "List History Groups": "Lister les groupes d’historique", + "List Immich Albums Now": "Lister les albums Immich maintenant", "List Lens Profiles": "Lister les profils d’objectif", "List Plug-in Filters": "Lister les filtres de modules externes", "List Preset Folders": "Lister les dossiers de préréglages", @@ -1405,6 +1407,7 @@ "Look Up Selected Photos": "Rechercher les photos sélectionnées", "Look at downsized copies of photos": "Voir des copies réduites des photos", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Chercher les photos que d’autres apps ont ajoutées aux dossiers du catalogue à son ouverture, au retour dans l’app et toutes les quelques minutes. Seuls les dossiers dont le contenu a changé sont analysés.", + "Look in the Camera Roll Now": "Regarder dans la pellicule maintenant", "Looking for color charts…": "Recherche de mires de couleurs…", "Looking for devices": "Recherche d’appareils", "Looking for devices on this network…": "Recherche d’appareils sur ce réseau…", @@ -1815,7 +1818,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "Les photos importées à partir de maintenant ; celles déjà dans le catalogue gardent le leur.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Les photos de Récemment supprimés peuvent être restaurées depuis l’application : clic droit → Restaurer (ou Supprimer définitivement), aussi dans le", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Les photos de la pellicule vont dans la collection « Camera Roll - nom de cet appareil ».", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Les photos de {folder} vont dans la collection « Camera Roll - nom de cet appareil ».", "Photos that use the old reference keep it.": "Les photos qui utilisent l’ancienne référence la conservent.", "Photos whose capture time can't be read were left as they were": "Les photos dont l’heure de prise de vue est illisible ont été laissées telles quelles", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Photos dont un autre programme a modifié le fichier de métadonnées : l’enregistrement remplace ces modifications par celles du catalogue.", @@ -2321,6 +2323,7 @@ "Shadow clipping": "Écrêtage des ombres", "Share": "Partager", "Share Catalog": "Partager le catalogue", + "Share Immich Connection with Synced Devices": "Partager la connexion Immich avec les appareils synchronisés", "Share Web Gallery via Immich": "Partager la galerie Web via Immich", "Share the New Collection?": "Partager la nouvelle collection ?", "Share via Immich": "Partager via Immich", @@ -2344,6 +2347,7 @@ "Show HSL Color Values": "Afficher les valeurs TSL", "Show Header Bar": "Afficher la barre d'en-tête", "Show Hidden Favorites": "Afficher les favoris masqués", + "Show Immich Albums as Collections": "Afficher les albums Immich comme collections", "Show Immich albums as collections": "Afficher les albums Immich comme collections", "Show Import Tab Settings": "Afficher les réglages de l’onglet Importation", "Show Index Numbers": "Afficher les numéros d’index", @@ -2524,6 +2528,7 @@ "Sync With Paired Devices": "Synchroniser avec les appareils associés", "Sync With This Catalog": "Synchroniser avec ce catalogue", "Sync conflicts ({})": "Conflits de synchronisation ({})", + "Sync the Camera Roll": "Synchroniser la pellicule", "Sync this catalog": "Synchroniser ce catalogue", "Sync this device's camera roll": "Synchroniser la pellicule de cet appareil", "Sync: Devices or Immich": "Synchronisation : appareils ou Immich", diff --git a/crates/ui-egui/locales/fork/id-formats.json b/crates/ui-egui/locales/fork/id-formats.json index 522bc44cae..b720725a10 100644 --- a/crates/ui-egui/locales/fork/id-formats.json +++ b/crates/ui-egui/locales/fork/id-formats.json @@ -113,6 +113,7 @@ "Paint over what to replace, then click Generate. About ${usd} per variation.": "Lukis di atas yang ingin diganti, lalu klik Buat. Sekitar ${usd} per variasi.", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Menggeser kembali atau memperbesar lagi pada editan HDR langsung menampilkannya tanpa merender ulang. Memakai hingga {need} MB memori grafis di layar ini.", "Person {n}": "Orang {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Foto di {folder} masuk ke koleksi “Camera Roll - nama perangkat ini”.", "Picks to unflag: {n}": "Pilihan yang tandanya dihapus: {n}", "Preset {name} on {n} photos": "Preset {name} pada {n} foto", "Print settings not saved: {e}": "Pengaturan cetak tidak tersimpan: {e}", diff --git a/crates/ui-egui/locales/fork/id.json b/crates/ui-egui/locales/fork/id.json index 971d9907ba..0a4ccc98ea 100644 --- a/crates/ui-egui/locales/fork/id.json +++ b/crates/ui-egui/locales/fork/id.json @@ -334,6 +334,7 @@ "Camera Profiles": "Profil kamera", "Camera Profiles (.dcp)": "Profil kamera (.dcp)", "Camera Profiles for Import": "Profil kamera untuk impor", + "Camera Roll Listed": "Rol kamera terdaftar", "Camera Sensor": "Sensor kamera", "Camera Serial Number": "Nomor seri kamera", "Camera bodies": "Bodi kamera", @@ -819,7 +820,7 @@ "Duplicates": "Duplikat", "Duration (seconds)": "Durasi (detik)", "E: every device keeps the original and can add photos": "E: setiap perangkat menyimpan aslinya dan dapat menambahkan foto", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Setiap album adalah koleksi dalam set Immich; di Pengaturan ▸ Sinkronisasi setiap perangkat memilih Tidak ada, Pratinjau, atau Kualitas Penuh.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Setiap album adalah koleksi dalam set Immich; di Pengaturan > Sinkronisasi setiap perangkat memilih Tidak ada, Pratinjau, atau Kualitas Penuh.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Setiap perangkat menyimpan katalognya sendiri dan hanya melihat koleksi yang diizinkan dan dipilih untuk diambil.", "Each of the {n} selected photos gets the reference that fits it": "Setiap {n} foto yang dipilih mendapat referensi yang cocok untuknya", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Mata yang lebih tajam dari setiap orang pada 100 % di bagian atas loupe. Bilah pengaturan cepat (arahkan penunjuk ke ruang di samping nama modul) juga mengalihkannya.", @@ -1529,6 +1530,7 @@ "Lips": "Bibir", "List AI Models": "Daftar model AI", "List History Groups": "Daftar grup riwayat", + "List Immich Albums Now": "Daftar album Immich sekarang", "List Lens Profiles": "Daftar profil lensa", "List Plug-in Filters": "Daftar filter plug-in", "List Preset Folders": "Daftar folder preset", @@ -1576,6 +1578,7 @@ "Look Up Selected Photos": "Cari lokasi foto yang dipilih", "Look at downsized copies of photos": "Lihat salinan foto yang diperkecil", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Cari foto yang ditambahkan aplikasi lain ke folder katalog saat katalog dibuka, saat aplikasi ke depan, dan setiap beberapa menit. Hanya folder yang isinya berubah yang dipindai.", + "Look in the Camera Roll Now": "Periksa rol kamera sekarang", "Looking for color charts": "Mencari bagan warna", "Looking for color charts…": "Mencari bagan warna…", "Looking for devices": "Mencari perangkat", @@ -2072,7 +2075,6 @@ "Photos imported": "Foto diimpor", "Photos imported from now on; photos already in the catalog keep theirs.": "Foto yang diimpor mulai sekarang; foto yang sudah ada di katalog mempertahankan pengaturannya.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Foto di rol kamera masuk ke koleksi “Camera Roll - nama perangkat ini”.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Foto di {folder} masuk ke koleksi “Camera Roll - nama perangkat ini”.", "Photos that use the old reference keep it.": "Foto yang memakai referensi lama tetap menyimpannya.", "Photos whose capture time can't be read were left as they were": "Foto yang waktu pengambilannya tidak dapat dibaca dibiarkan seperti semula", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Foto yang file metadatanya diubah program lain: menyimpan akan mengganti perubahan itu dengan data katalog.", @@ -2651,6 +2653,7 @@ "Shadow clipping": "Clipping bayangan", "Share": "Bagikan", "Share Catalog": "Bagikan katalog", + "Share Immich Connection with Synced Devices": "Bagikan koneksi Immich dengan perangkat yang disinkronkan", "Share Web Gallery via Immich": "Bagikan galeri web lewat Immich", "Share the New Collection?": "Bagikan koleksi baru?", "Share via Immich": "Bagikan lewat Immich", @@ -2680,6 +2683,7 @@ "Show HSL Color Values": "Tampilkan nilai warna HSL", "Show Header Bar": "Tampilkan bilah header", "Show Hidden Favorites": "Tampilkan favorit yang disembunyikan", + "Show Immich Albums as Collections": "Tampilkan album Immich sebagai koleksi", "Show Immich albums as collections": "Tampilkan album Immich sebagai koleksi", "Show Import Tab Settings": "Tampilkan pengaturan tab Impor", "Show Index Numbers": "Tampilkan nomor indeks", @@ -2874,6 +2878,7 @@ "Sync With Paired Devices": "Sinkronkan dengan perangkat yang dipasangkan", "Sync With This Catalog": "Sinkronkan dengan katalog ini", "Sync conflicts ({})": "Konflik sinkronisasi ({})", + "Sync the Camera Roll": "Sinkronkan rol kamera", "Sync this catalog": "Sinkronkan katalog ini", "Sync this device's camera roll": "Sinkronkan rol kamera perangkat ini", "Sync: Devices or Immich": "Sinkronisasi: perangkat atau Immich", diff --git a/crates/ui-egui/locales/fork/it-formats.json b/crates/ui-egui/locales/fork/it-formats.json index 92ea1dee63..a3d20d2da2 100644 --- a/crates/ui-egui/locales/fork/it-formats.json +++ b/crates/ui-egui/locales/fork/it-formats.json @@ -109,6 +109,7 @@ "Page {page} of {pages}": "Pagina {page} di {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Tornando indietro con la panoramica o ingrandendo di nuovo una modifica HDR, la vista appare subito senza essere elaborata di nuovo. Usa fino a {need} MB di memoria grafica su questo schermo.", "Person {n}": "Persona {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Le foto in {folder} vanno nella raccolta «Camera Roll - nome di questo dispositivo».", "Picks to unflag: {n}": "Scelte da togliere: {n}", "Preset {name} on {n} photos": "Predefinito {name} su {n} foto", "Print settings not saved: {e}": "Impostazioni di stampa non salvate: {e}", diff --git a/crates/ui-egui/locales/fork/it.json b/crates/ui-egui/locales/fork/it.json index 4a23dd2c59..0013062f64 100644 --- a/crates/ui-egui/locales/fork/it.json +++ b/crates/ui-egui/locales/fork/it.json @@ -310,6 +310,7 @@ "Camera Profiles": "Profili fotocamera", "Camera Profiles (.dcp)": "Profili fotocamera (.dcp)", "Camera Profiles for Import": "Profili fotocamera per l'importazione", + "Camera Roll Listed": "Rullino elencato", "Camera Sensor": "Sensore della fotocamera", "Camera Serial Number": "Numero di serie della fotocamera", "Camera bodies": "Corpi macchina", @@ -768,7 +769,7 @@ "Duplicates": "Duplicati", "Duration (seconds)": "Durata (secondi)", "E: every device keeps the original and can add photos": "E: ogni dispositivo conserva l’originale e può aggiungere foto", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Ogni album è una raccolta nel gruppo Immich; in Impostazioni ▸ Sincronizzazione ogni dispositivo sceglie Nessuno, Anteprime o Qualità piena.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Ogni album è una raccolta nel gruppo Immich; in Impostazioni > Sincronizzazione ogni dispositivo sceglie Nessuno, Anteprime o Qualità piena.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Ogni dispositivo conserva il proprio catalogo e vede solo le raccolte che può e sceglie di prendere.", "Each of the {n} selected photos gets the reference that fits it": "Ognuna delle {n} foto selezionate riceve il riferimento adatto", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "L'occhio più nitido di ogni persona al 100 % nella parte superiore della lente. Anche la barra delle impostazioni rapide (puntare lo spazio accanto ai nomi dei moduli) la attiva.", @@ -1453,6 +1454,7 @@ "Lips": "Labbra", "List AI Models": "Elenca modelli IA", "List History Groups": "Elenca gruppi della cronologia", + "List Immich Albums Now": "Elenca ora gli album di Immich", "List Lens Profiles": "Elenca profili obiettivo", "List Plug-in Filters": "Elenca filtri plug-in", "List Preset Folders": "Elenca cartelle dei preset", @@ -1498,6 +1500,7 @@ "Look Up Selected Photos": "Cerca le foto selezionate", "Look at downsized copies of photos": "Guarda copie ridotte delle foto", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Cerca le foto che altre app hanno aggiunto alle cartelle del catalogo quando il catalogo si apre, quando l'app torna in primo piano e ogni pochi minuti. Vengono analizzate solo le cartelle il cui contenuto è cambiato.", + "Look in the Camera Roll Now": "Controlla ora il rullino", "Looking for color charts": "Ricerca delle tavole colori", "Looking for color charts…": "Ricerca delle tavole colori…", "Looking for devices": "Ricerca dei dispositivi", @@ -1948,7 +1951,6 @@ "Photos imported": "Foto importate", "Photos imported from now on; photos already in the catalog keep theirs.": "Le foto importate da ora in poi; quelle già nel catalogo mantengono la loro impostazione.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Le foto del rullino vanno nella raccolta «Camera Roll - nome di questo dispositivo».", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Le foto in {folder} vanno nella raccolta «Camera Roll - nome di questo dispositivo».", "Photos that use the old reference keep it.": "Le foto che usano il vecchio riferimento lo mantengono.", "Photos whose capture time can't be read were left as they were": "Le foto di cui non si può leggere l'ora di scatto sono state lasciate com'erano", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Foto il cui file dei metadati è stato modificato da un altro programma: il salvataggio sostituisce quelle modifiche con quelle del catalogo.", @@ -2489,6 +2491,7 @@ "Shadow clipping": "Taglio delle ombre", "Share": "Condividi", "Share Catalog": "Condividi catalogo", + "Share Immich Connection with Synced Devices": "Condividi la connessione Immich con i dispositivi sincronizzati", "Share Web Gallery via Immich": "Condividi galleria web tramite Immich", "Share the New Collection?": "Condividere la nuova raccolta?", "Share via Immich": "Condividi tramite Immich", @@ -2514,6 +2517,7 @@ "Show HSL Color Values": "Mostra valori colore HSL", "Show Header Bar": "Mostra barra dell'intestazione", "Show Hidden Favorites": "Mostra i preferiti nascosti", + "Show Immich Albums as Collections": "Mostra gli album di Immich come raccolte", "Show Immich albums as collections": "Mostra gli album di Immich come raccolte", "Show Import Tab Settings": "Mostra impostazioni della scheda Importa", "Show Index Numbers": "Mostra numeri di indice", @@ -2696,6 +2700,7 @@ "Sync With Paired Devices": "Sincronizza con i dispositivi associati", "Sync With This Catalog": "Sincronizza con questo catalogo", "Sync conflicts ({})": "Conflitti di sincronizzazione ({})", + "Sync the Camera Roll": "Sincronizza il rullino", "Sync this catalog": "Sincronizza questo catalogo", "Sync this device's camera roll": "Sincronizza il rullino di questo dispositivo", "Sync: Devices or Immich": "Sincronizzazione: dispositivi o Immich", diff --git a/crates/ui-egui/locales/fork/ja-formats.json b/crates/ui-egui/locales/fork/ja-formats.json index 6ba815eef4..ba7683d72a 100644 --- a/crates/ui-egui/locales/fork/ja-formats.json +++ b/crates/ui-egui/locales/fork/ja-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "{page} / {pages} ページ", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "HDR 編集でパンして戻ったり再びズームしたりしたとき、再レンダリングせずにすぐ表示します。この画面で最大 {need} MB のグラフィックメモリを使います。", "Person {n}": "人物 {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} の写真はコレクション「Camera Roll - このデバイスの名前」に入ります。", "Picks to unflag: {n}": "フラグを外す採用写真: {n}", "Preset {name} on {n} photos": "プリセット {name} を {n} 枚の写真に", "Print settings not saved: {e}": "プリント設定を保存できませんでした:{e}", diff --git a/crates/ui-egui/locales/fork/ja.json b/crates/ui-egui/locales/fork/ja.json index c9e8b376aa..eb29aa49b7 100644 --- a/crates/ui-egui/locales/fork/ja.json +++ b/crates/ui-egui/locales/fork/ja.json @@ -324,6 +324,7 @@ "Camera Profiles": "カメラプロファイル", "Camera Profiles (.dcp)": "カメラプロファイル(.dcp)", "Camera Profiles for Import": "読み込み時のカメラプロファイル", + "Camera Roll Listed": "カメラロールを一覧", "Camera Serial Number": "カメラのシリアル番号", "Camera bodies": "カメラ本体", "Camera default": "カメラの初期設定", @@ -816,7 +817,7 @@ "Duration": "再生時間", "Duration (seconds)": "長さ(秒)", "E: every device keeps the original and can add photos": "E: すべてのデバイスが元画像を保持し、写真を追加できます", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "各アルバムは Immich セット内のコレクションです。設定 ▸ 同期 で、各デバイスがなし・プレビュー・フル画質を選びます。", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "各アルバムは Immich セット内のコレクションです。設定 > 同期 で、各デバイスがなし・プレビュー・フル画質を選びます。", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "各デバイスは独自のカタログを持ち、許可されていて取得を選んだコレクションだけが表示されます。", "Each of the {n} selected photos gets the reference that fits it": "選択した {n} 枚の写真それぞれに合う参照写真を適用します", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "各人物のよりシャープな目を 100 % でルーペ上部に表示します。クイック設定バー(モジュール名の横の空き領域をポイント)でも切り替えられます。", @@ -1510,6 +1511,7 @@ "Lips": "唇", "List AI Models": "AI モデルの一覧", "List History Groups": "履歴グループの一覧", + "List Immich Albums Now": "Immich のアルバムを今すぐ一覧", "List Lens Profiles": "レンズプロファイルの一覧", "List Plug-in Filters": "プラグインフィルターの一覧", "List Preset Folders": "プリセットフォルダーの一覧", @@ -1547,6 +1549,7 @@ "Look Up Selected Photos": "選択した写真を検索", "Look at downsized copies of photos": "写真の縮小コピーを見る", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "カタログを開いたとき、アプリが前面に来たとき、および数分ごとに、他のアプリがカタログのフォルダーに追加した写真を探します。内容が変わったフォルダーだけを調べます。", + "Look in the Camera Roll Now": "今すぐカメラロールを確認", "Looking for color charts…": "カラーチャートを探しています…", "Looking for devices": "デバイスを探しています", "Looking for devices on this network…": "このネットワーク上のデバイスを探しています…", @@ -2024,7 +2027,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "今後読み込む写真に適用されます。カタログにある写真はそれぞれの設定を保ちます。", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "最近削除した項目の写真はアプリから復元できます: 右クリック → 復元(または完全に削除)、また", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "カメラロールの写真はコレクション「Camera Roll - このデバイスの名前」に入ります。", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} の写真はコレクション「Camera Roll - このデバイスの名前」に入ります。", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "写真は「すべての写真」に残ります。フォルダーを削除すると、その中のアルバムも削除されます。この操作は取り消せます。", "Photos that use the old reference keep it.": "古い参照写真を使っている写真はそのまま使い続けます。", "Photos whose capture time can't be read were left as they were": "撮影日時を読み取れない写真は、そのままにしました", @@ -2578,6 +2580,7 @@ "Shadow clipping": "シャドウの黒つぶれ", "Share": "共有", "Share Catalog": "カタログを共有", + "Share Immich Connection with Synced Devices": "Immich 接続を同期中のデバイスと共有", "Share Web Gallery via Immich": "Immich で Web ギャラリーを共有", "Share the New Collection?": "新しいコレクションを共有しますか?", "Share via Immich": "Immich で共有", @@ -2602,6 +2605,7 @@ "Show HSL Color Values": "HSL カラー値を表示", "Show Header Bar": "ヘッダーバーを表示", "Show Hidden Favorites": "非表示にしたお気に入りを表示", + "Show Immich Albums as Collections": "Immich のアルバムをコレクションとして表示", "Show Immich albums as collections": "Immich のアルバムをコレクションとして表示", "Show Import Tab Settings": "読み込みタブの設定を表示", "Show Index Numbers": "インデックス番号を表示", @@ -2800,6 +2804,7 @@ "Sync With Paired Devices": "ペアリング済みのデバイスと同期", "Sync With This Catalog": "このカタログと同期", "Sync conflicts ({})": "同期の競合({})", + "Sync the Camera Roll": "カメラロールを同期", "Sync this catalog": "このカタログを同期", "Sync this device's camera roll": "このデバイスのカメラロールを同期", "Sync: Devices or Immich": "同期:デバイスまたは Immich", diff --git a/crates/ui-egui/locales/fork/ka-formats.json b/crates/ui-egui/locales/fork/ka-formats.json index 8465c847d6..12de59eb10 100644 --- a/crates/ui-egui/locales/fork/ka-formats.json +++ b/crates/ui-egui/locales/fork/ka-formats.json @@ -140,6 +140,7 @@ "Paired: {name}": "დაწყვილებულია: {name}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "HDR რედაქტირებაზე უკან გადაადგილებისას ან ხელახლა გადიდებისას ხედი მაშინვე ჩანს, თავიდან რენდერის გარეშე. იყენებს ამ ეკრანზე {need} MB-მდე გრაფიკულ მეხსიერებას.", "Person {n}": "პირი {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder}-ის ფოტოები გადადის კოლექციაში „Camera Roll - ამ მოწყობილობის სახელი“.", "Picks to unflag: {n}": "ნიშნის მოსახსნელი არჩეულები: {n}", "Plugin {version} installed": "დანამატი {version} დაყენებულია", "Preset {name} on {n} photos": "პრესეტი {name} {n} ფოტოზე", diff --git a/crates/ui-egui/locales/fork/ka.json b/crates/ui-egui/locales/fork/ka.json index 3a44ac4c70..68c4172eef 100644 --- a/crates/ui-egui/locales/fork/ka.json +++ b/crates/ui-egui/locales/fork/ka.json @@ -359,6 +359,7 @@ "Camera Profiles": "კამერის პროფილები", "Camera Profiles (.dcp)": "კამერის პროფილები (.dcp)", "Camera Profiles for Import": "კამერის პროფილები იმპორტისთვის", + "Camera Roll Listed": "კამერის ალბომი ჩამოთვლილია", "Camera Sensor": "კამერის სენსორი", "Camera Serial Number": "კამერის სერიული ნომერი", "Camera bodies": "კამერის კორპუსები", @@ -876,7 +877,7 @@ "Duration": "ხანგრძლივობა", "Duration (seconds)": "ხანგრძლივობა (წამი)", "E: every device keeps the original and can add photos": "E: ყველა მოწყობილობა ინახავს ორიგინალს და შეუძლია ფოტოების დამატება", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "თითოეული ალბომი Immich-ის ნაკრების კოლექციაა; პარამეტრები ▸ სინქრონიზაციაში თითოეული მოწყობილობა ირჩევს: არაფერი, გადახედვები ან სრული ხარისხი.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "თითოეული ალბომი Immich-ის ნაკრების კოლექციაა; პარამეტრები > სინქრონიზაციაში თითოეული მოწყობილობა ირჩევს: არაფერი, გადახედვები ან სრული ხარისხი.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "თითოეული მოწყობილობა ინახავს საკუთარ კატალოგს და ხედავს მხოლოდ იმ კოლექციებს, რომელთა აღებაც ნებადართულია და აირჩია.", "Each of the {n} selected photos gets the reference that fits it": "{n} არჩეული ფოტოდან თითოეული მიიღებს მისთვის შესაფერის საცნობარო ფოტოს", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "თითოეული ადამიანის უფრო მკვეთრი თვალი 100 %-ზე ლუპის ზედა ნაწილში. მას სწრაფი პარამეტრების ზოლიც რთავს (მიიტანეთ მაჩვენებელი მოდულების სახელების გვერდით ცარიელ ადგილზე).", @@ -1634,6 +1635,7 @@ "Lips": "ტუჩები", "List AI Models": "AI მოდელების სია", "List History Groups": "ისტორიის ჯგუფების სია", + "List Immich Albums Now": "Immich-ის ალბომების ჩამოთვლა ახლავე", "List Lens Profiles": "ობიექტივის პროფილების სია", "List Plug-in Filters": "დანამატის ფილტრების სია", "List Preset Folders": "პრესეტების საქაღალდეების სია", @@ -1681,6 +1683,7 @@ "Look Up Selected Photos": "მონიშნული ფოტოების მოძებნა", "Look at downsized copies of photos": "ფოტოების შემცირებული ასლების ნახვა", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "სხვა აპების მიერ კატალოგის საქაღალდეებში დამატებული ფოტოების ძებნა კატალოგის გახსნისას, აპის წინა პლანზე გამოსვლისას და ყოველ რამდენიმე წუთში. სკანირდება მხოლოდ ის საქაღალდეები, რომელთა შიგთავსი შეიცვალა.", + "Look in the Camera Roll Now": "კამერის ალბომის შემოწმება ახლავე", "Looking for color charts": "ფერთა ცხრილების ძებნა", "Looking for color charts…": "ფერთა ცხრილების ძებნა…", "Looking for devices": "მოწყობილობების ძებნა", @@ -2195,7 +2198,6 @@ "Photos imported": "ფოტოები იმპორტირებულია", "Photos imported from now on; photos already in the catalog keep theirs.": "ამიერიდან იმპორტირებული ფოტოები; კატალოგში უკვე არსებული ფოტოები თავისას ინარჩუნებს.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "კამერის ფოტოები გადადის კოლექციაში „Camera Roll - ამ მოწყობილობის სახელი“.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder}-ის ფოტოები გადადის კოლექციაში „Camera Roll - ამ მოწყობილობის სახელი“.", "Photos that use the old reference keep it.": "ფოტოები, რომლებიც ძველ საცნობარო ფოტოს იყენებენ, შეინარჩუნებენ მას.", "Photos whose capture time can't be read were left as they were": "ფოტოები, რომელთა გადაღების დროის წაკითხვა ვერ მოხერხდა, უცვლელი დარჩა", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "ფოტოები, რომელთა მეტამონაცემების ფაილი სხვა პროგრამამ შეცვალა: შენახვა ამ ცვლილებებს კატალოგის მონაცემებით ჩაანაცვლებს.", @@ -2814,6 +2816,7 @@ "Shadow clipping": "ჩრდილების ჩამოჭრა", "Share": "გაზიარება", "Share Catalog": "კატალოგის გაზიარება", + "Share Immich Connection with Synced Devices": "Immich-ის კავშირის გაზიარება სინქრონიზებულ მოწყობილობებთან", "Share Web Gallery via Immich": "ვებ-გალერეის გაზიარება Immich-ით", "Share the New Collection?": "გაზიარდეს ახალი კოლექცია?", "Share via Immich": "გაზიარება Immich-ით", @@ -2843,6 +2846,7 @@ "Show HSL Color Values": "HSL ფერის მნიშვნელობების ჩვენება", "Show Header Bar": "სათაურის ზოლის ჩვენება", "Show Hidden Favorites": "დამალული რჩეულების ჩვენება", + "Show Immich Albums as Collections": "Immich-ის ალბომების ჩვენება კოლექციებად", "Show Immich albums as collections": "Immich-ის ალბომების ჩვენება კოლექციებად", "Show Import Tab Settings": "იმპორტის ჩანართის პარამეტრების ჩვენება", "Show Index Numbers": "რიგითი ნომრების ჩვენება", @@ -3055,6 +3059,7 @@ "Sync With Paired Devices": "დაწყვილებულ მოწყობილობებთან სინქრონიზაცია", "Sync With This Catalog": "ამ კატალოგთან სინქრონიზაცია", "Sync conflicts ({})": "სინქრონიზაციის კონფლიქტები ({})", + "Sync the Camera Roll": "კამერის ალბომის სინქრონიზაცია", "Sync this catalog": "ამ კატალოგის სინქრონიზაცია", "Sync this device's camera roll": "ამ მოწყობილობის კამერის ალბომის სინქრონიზაცია", "Sync: Devices or Immich": "სინქრონიზაცია: მოწყობილობები ან Immich", diff --git a/crates/ui-egui/locales/fork/pl-formats.json b/crates/ui-egui/locales/fork/pl-formats.json index e641521c99..4d47e1a3c2 100644 --- a/crates/ui-egui/locales/fork/pl-formats.json +++ b/crates/ui-egui/locales/fork/pl-formats.json @@ -108,6 +108,7 @@ "Page {page} of {pages}": "Strona {page} z {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Powrót przesunięciem lub ponowne powiększenie edycji HDR pokazuje ją od razu, bez ponownego renderowania. Używa do {need} MB pamięci graficznej przy tym ekranie.", "Person {n}": "Osoba {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Zdjęcia z {folder} trafiają do kolekcji „Camera Roll - nazwa tego urządzenia”.", "Picks to unflag: {n}": "Wybrane do odflagowania: {n}", "Preset {name} on {n} photos": "Ustawienie {name} na zdjęciach: {n}", "Print settings not saved: {e}": "Nie zapisano ustawień drukowania: {e}", diff --git a/crates/ui-egui/locales/fork/pl.json b/crates/ui-egui/locales/fork/pl.json index 4b6544082a..d605f8a1cf 100644 --- a/crates/ui-egui/locales/fork/pl.json +++ b/crates/ui-egui/locales/fork/pl.json @@ -342,6 +342,7 @@ "Camera Profiles": "Profile aparatów", "Camera Profiles (.dcp)": "Profile aparatów (.dcp)", "Camera Profiles for Import": "Profile aparatów do importu", + "Camera Roll Listed": "Rolka aparatu wylistowana", "Camera Sensor": "Matryca aparatu", "Camera Serial Number": "Numer seryjny aparatu", "Camera bodies": "Korpusy aparatów", @@ -838,7 +839,7 @@ "Duration": "Czas trwania", "Duration (seconds)": "Czas trwania (sekundy)", "E: every device keeps the original and can add photos": "E: każde urządzenie zachowuje oryginał i może dodawać zdjęcia", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Każdy album jest kolekcją w zestawie Immich; w Ustawieniach ▸ Synchronizacja każde urządzenie wybiera Brak, Podglądy lub Pełna jakość.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Każdy album jest kolekcją w zestawie Immich; w Ustawieniach > Synchronizacja każde urządzenie wybiera Brak, Podglądy lub Pełna jakość.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Każde urządzenie ma własny katalog i widzi tylko kolekcje, które może i chce pobrać.", "Each of the {n} selected photos gets the reference that fits it": "Każde z {n} wybranych zdjęć otrzyma pasujące do niego odniesienie", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Ostrzejsze oko każdej osoby w 100 % u góry lupy. Przełącza go też pasek szybkich ustawień (wskaż puste miejsce obok nazw modułów).", @@ -1575,6 +1576,7 @@ "Lips": "Usta", "List AI Models": "Wyświetl modele AI", "List History Groups": "Wyświetl grupy historii", + "List Immich Albums Now": "Wyświetl teraz albumy Immich", "List Lens Profiles": "Wyświetl profile obiektywów", "List Plug-in Filters": "Wyświetl filtry wtyczek", "List Preset Folders": "Wyświetl foldery ustawień wstępnych", @@ -1622,6 +1624,7 @@ "Look Up Selected Photos": "Wyszukaj dla zaznaczonych zdjęć", "Look at downsized copies of photos": "Oglądaj zmniejszone kopie zdjęć", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Szukaj zdjęć dodanych przez inne aplikacje do folderów katalogu przy jego otwarciu, po przełączeniu na aplikację i co kilka minut. Skanowane są tylko foldery, których zawartość się zmieniła.", + "Look in the Camera Roll Now": "Sprawdź teraz rolkę aparatu", "Looking for color charts": "Szukanie tablic kolorów", "Looking for color charts…": "Szukanie tablic kolorów…", "Looking for devices": "Szukanie urządzeń", @@ -2112,7 +2115,6 @@ "Photos imported": "Zaimportowane zdjęcia", "Photos imported from now on; photos already in the catalog keep theirs.": "Zdjęcia importowane od teraz; zdjęcia już obecne w katalogu zachowują swoje ustawienia.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Zdjęcia z rolki aparatu trafiają do kolekcji „Camera Roll - nazwa tego urządzenia”.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Zdjęcia z {folder} trafiają do kolekcji „Camera Roll - nazwa tego urządzenia”.", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "Zdjęcia pozostają we Wszystkich zdjęciach. Usunięcie folderu usuwa też jego albumy. Możesz to cofnąć.", "Photos that use the old reference keep it.": "Zdjęcia używające starego odniesienia zachowują je.", "Photos whose capture time can't be read were left as they were": "Zdjęcia, których czasu wykonania nie da się odczytać, pozostawiono bez zmian", @@ -2681,6 +2683,7 @@ "Shadow clipping": "Przycięcie cieni", "Share": "Udostępnij", "Share Catalog": "Udostępnij katalog", + "Share Immich Connection with Synced Devices": "Udostępnij połączenie Immich synchronizowanym urządzeniom", "Share Web Gallery via Immich": "Udostępnij galerię internetową przez Immich", "Share the New Collection?": "Udostępnić nową kolekcję?", "Share via Immich": "Udostępnij przez Immich", @@ -2707,6 +2710,7 @@ "Show HSL Color Values": "Pokaż wartości kolorów HSL", "Show Header Bar": "Pokaż pasek nagłówka", "Show Hidden Favorites": "Pokaż ukryte ulubione", + "Show Immich Albums as Collections": "Pokaż albumy Immich jako kolekcje", "Show Immich albums as collections": "Pokaż albumy Immich jako kolekcje", "Show Import Tab Settings": "Pokaż ustawienia karty importu", "Show Index Numbers": "Pokaż numery indeksu", @@ -2906,6 +2910,7 @@ "Sync With Paired Devices": "Synchronizuj ze sparowanymi urządzeniami", "Sync With This Catalog": "Synchronizuj z tym katalogiem", "Sync conflicts ({})": "Konflikty synchronizacji ({})", + "Sync the Camera Roll": "Synchronizuj rolkę aparatu", "Sync this catalog": "Synchronizuj ten katalog", "Sync this device's camera roll": "Synchronizuj rolkę aparatu tego urządzenia", "Sync: Devices or Immich": "Synchronizacja: urządzenia lub Immich", diff --git a/crates/ui-egui/locales/fork/pt-br-formats.json b/crates/ui-egui/locales/fork/pt-br-formats.json index 2cb237c23d..5be839b681 100644 --- a/crates/ui-egui/locales/fork/pt-br-formats.json +++ b/crates/ui-egui/locales/fork/pt-br-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "Página {page} de {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Voltar a mover ou ampliar de novo uma edição HDR a mostra na hora, em vez de renderizá-la de novo. Usa até {need} MB de memória gráfica nesta tela.", "Person {n}": "Pessoa {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "As fotos em {folder} vão para a coleção “Camera Roll - nome deste dispositivo”.", "Picks to unflag: {n}": "Escolhidas a desmarcar: {n}", "Preset {name} on {n} photos": "Predefinição {name} em {n} fotos", "Print settings not saved: {e}": "Configurações de impressão não salvas: {e}", diff --git a/crates/ui-egui/locales/fork/pt-br.json b/crates/ui-egui/locales/fork/pt-br.json index 28976b88ad..e9d2c1e9e9 100644 --- a/crates/ui-egui/locales/fork/pt-br.json +++ b/crates/ui-egui/locales/fork/pt-br.json @@ -323,6 +323,7 @@ "Camera Profiles": "Perfis de câmera", "Camera Profiles (.dcp)": "Perfis de câmera (.dcp)", "Camera Profiles for Import": "Perfis de câmera para importação", + "Camera Roll Listed": "Rolo da câmera listado", "Camera Serial Number": "Número de série da câmera", "Camera bodies": "Corpos de câmera", "Camera default": "Padrão da câmera", @@ -815,7 +816,7 @@ "Duration": "Duração", "Duration (seconds)": "Duração (segundos)", "E: every device keeps the original and can add photos": "E: cada dispositivo mantém o original e pode adicionar fotos", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Cada álbum é uma coleção do conjunto Immich; em Configurações ▸ Sincronização cada dispositivo escolhe Nenhum, Prévias ou Qualidade total.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Cada álbum é uma coleção do conjunto Immich; em Configurações > Sincronização cada dispositivo escolhe Nenhum, Prévias ou Qualidade total.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Cada dispositivo mantém seu próprio catálogo e vê apenas as coleções que tem permissão e escolhe receber.", "Each of the {n} selected photos gets the reference that fits it": "Cada uma das {n} fotos selecionadas recebe a referência que lhe corresponde", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "O olho mais nítido de cada pessoa a 100 % no topo da lupa. A barra de configurações rápidas (aponte para o espaço ao lado dos nomes dos módulos) também a alterna.", @@ -1509,6 +1510,7 @@ "Lips": "Lábios", "List AI Models": "Listar modelos de IA", "List History Groups": "Listar grupos do histórico", + "List Immich Albums Now": "Listar álbuns do Immich agora", "List Lens Profiles": "Listar perfis de lente", "List Plug-in Filters": "Listar filtros de plug-in", "List Preset Folders": "Listar pastas de predefinições", @@ -1546,6 +1548,7 @@ "Look Up Selected Photos": "Pesquisar as fotos selecionadas", "Look at downsized copies of photos": "Ver cópias reduzidas das fotos", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Procurar fotos que outros apps adicionaram às pastas do catálogo ao abri-lo, ao voltar ao app e a cada poucos minutos. Só as pastas cujo conteúdo mudou são examinadas.", + "Look in the Camera Roll Now": "Verificar o rolo da câmera agora", "Looking for color charts…": "Procurando cartões de cores…", "Looking for devices": "Procurando dispositivos", "Looking for devices on this network…": "Procurando dispositivos nesta rede…", @@ -2023,7 +2026,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "Fotos importadas daqui em diante; as fotos já no catálogo mantêm as suas.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Fotos em Excluídos recentemente podem ser restauradas no app: clique com o botão direito → Restaurar (ou Excluir permanentemente), também no", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "As fotos do rolo da câmera vão para a coleção “Camera Roll - nome deste dispositivo”.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "As fotos em {folder} vão para a coleção “Camera Roll - nome deste dispositivo”.", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "As fotos continuam em Todas as fotos. Excluir uma pasta também exclui seus álbuns. Você pode desfazer isto.", "Photos that use the old reference keep it.": "As fotos que usam a referência antiga a mantêm.", "Photos whose capture time can't be read were left as they were": "Fotos cuja hora de captura não pode ser lida ficaram como estavam", @@ -2577,6 +2579,7 @@ "Shadow clipping": "Recorte de sombras", "Share": "Compartilhar", "Share Catalog": "Compartilhar catálogo", + "Share Immich Connection with Synced Devices": "Compartilhar a conexão do Immich com os dispositivos sincronizados", "Share Web Gallery via Immich": "Compartilhar galeria web pelo Immich", "Share the New Collection?": "Compartilhar a nova coleção?", "Share via Immich": "Compartilhar via Immich", @@ -2601,6 +2604,7 @@ "Show HSL Color Values": "Mostrar valores de cor HSL", "Show Header Bar": "Mostrar barra de cabeçalho", "Show Hidden Favorites": "Mostrar favoritos ocultos", + "Show Immich Albums as Collections": "Mostrar álbuns do Immich como coleções", "Show Immich albums as collections": "Mostrar álbuns do Immich como coleções", "Show Import Tab Settings": "Mostrar configurações da aba Importar", "Show Index Numbers": "Mostrar números de índice", @@ -2798,6 +2802,7 @@ "Sync With Paired Devices": "Sincronizar com dispositivos pareados", "Sync With This Catalog": "Sincronizar com este catálogo", "Sync conflicts ({})": "Conflitos de sincronização ({})", + "Sync the Camera Roll": "Sincronizar o rolo da câmera", "Sync this catalog": "Sincronizar este catálogo", "Sync this device's camera roll": "Sincronizar o rolo da câmera deste dispositivo", "Sync: Devices or Immich": "Sincronização: dispositivos ou Immich", diff --git a/crates/ui-egui/locales/fork/ru-formats.json b/crates/ui-egui/locales/fork/ru-formats.json index 28f367bb30..6d769dd22a 100644 --- a/crates/ui-egui/locales/fork/ru-formats.json +++ b/crates/ui-egui/locales/fork/ru-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "Страница {page} из {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "При возврате панорамирования или повторном увеличении HDR-правка показывается сразу, без повторной отрисовки. Занимает до {need} МБ видеопамяти на этом экране.", "Person {n}": "Человек {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Фото из {folder} попадают в коллекцию «Camera Roll - имя этого устройства».", "Picks to unflag: {n}": "Выбранных, с которых снимется отметка: {n}", "Preset {name} on {n} photos": "Пресет {name} на {n} фото", "Print settings not saved: {e}": "Параметры печати не сохранены: {e}", @@ -235,6 +236,6 @@ "{} · {}. Kept in the catalog's “denoise” folder; the oldest ones that no photo uses go first when the limit is reached.": "{} · {}. Хранятся в папке «denoise» каталога; при достижении ограничения первыми удаляются самые старые изображения, которые не использует ни одно фото.", "“{name}” added to Camera Profiles": "«{name}» добавлен в профили камеры", "“{name}” has its old settings again": "У «{name}» снова прежние настройки", - "“{name}” is new. What may the other devices syncing this catalog have of it?": "«{name}» — новая. Что из неё могут получать другие устройства, синхронизирующие этот каталог?", + "“{name}” is new. What may the other devices syncing this catalog have of it?": "«{name}»: новая. Что из неё могут получать другие устройства, синхронизирующие этот каталог?", "“{name}” takes the active photo's settings. Its name, group, place and marks stay.": "«{name}» получает настройки активного фото. Название, группа, место и отметки сохраняются." } diff --git a/crates/ui-egui/locales/fork/ru.json b/crates/ui-egui/locales/fork/ru.json index 1bfea4664d..67a5083673 100644 --- a/crates/ui-egui/locales/fork/ru.json +++ b/crates/ui-egui/locales/fork/ru.json @@ -331,6 +331,7 @@ "Camera Profiles": "Профили камеры", "Camera Profiles (.dcp)": "Профили камеры (.dcp)", "Camera Profiles for Import": "Профили камеры при импорте", + "Camera Roll Listed": "Фотоплёнка перечислена", "Camera Serial Number": "Серийный номер камеры", "Camera bodies": "Корпуса камер", "Camera default": "По умолчанию для камеры", @@ -813,7 +814,7 @@ "Duration": "Длительность", "Duration (seconds)": "Длительность (секунды)", "E: every device keeps the original and can add photos": "E: каждое устройство хранит оригинал и может добавлять фото", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Каждый альбом — коллекция в наборе Immich; в Настройках ▸ Синхронизация каждое устройство выбирает «Нет», «Превью» или «Полное качество».", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Каждый альбом: коллекция в наборе Immich; в Настройках > Синхронизация каждое устройство выбирает «Нет», «Превью» или «Полное качество».", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Каждое устройство хранит свой каталог и видит только те коллекции, которые ему разрешено и которые оно выбирает брать.", "Each of the {n} selected photos gets the reference that fits it": "Каждое из {n} выбранных фото получит подходящий ему эталон", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Более резкий глаз каждого человека в масштабе 100 % вверху лупы. Её также переключает панель быстрых настроек (наведите указатель на пустое место рядом с названиями модулей).", @@ -1516,6 +1517,7 @@ "Lips": "Губы", "List AI Models": "Список моделей ИИ", "List History Groups": "Список групп истории", + "List Immich Albums Now": "Перечислить альбомы Immich сейчас", "List Lens Profiles": "Список профилей объективов", "List Plug-in Filters": "Список фильтров плагинов", "List Preset Folders": "Список папок пресетов", @@ -1556,6 +1558,7 @@ "Look Up Selected Photos": "Найти места выбранных фото", "Look at downsized copies of photos": "Просматривать уменьшенные копии фотографий", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Искать фото, добавленные другими приложениями в папки каталога, при его открытии, при возврате в приложение и каждые несколько минут. Проверяются только папки, содержимое которых изменилось.", + "Look in the Camera Roll Now": "Проверить фотоплёнку сейчас", "Looking for color charts…": "Поиск цветовых мишеней…", "Looking for devices": "Поиск устройств", "Looking for devices on this network…": "Поиск устройств в этой сети…", @@ -2026,7 +2029,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "Фото, импортируемые с этого момента; фото, уже находящиеся в каталоге, сохраняют свои.", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "Фото из Недавно удалённых можно восстановить в приложении: правый щелчок → Восстановить (или Удалить навсегда), также в", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Фото из фотоплёнки попадают в коллекцию «Camera Roll - имя этого устройства».", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Фото из {folder} попадают в коллекцию «Camera Roll - имя этого устройства».", "Photos per bracket (0 = auto)": "Фото в брекетинге (0 = авто)", "Photos that use the old reference keep it.": "Фото, использующие старый эталон, сохраняют его.", "Photos whose capture time can't be read were left as they were": "Фото, время съёмки которых не удалось прочитать, оставлены как есть", @@ -2580,6 +2582,7 @@ "Shadow clipping": "Отсечение теней", "Share": "Поделиться", "Share Catalog": "Поделиться каталогом", + "Share Immich Connection with Synced Devices": "Поделиться подключением Immich с синхронизируемыми устройствами", "Share Web Gallery via Immich": "Поделиться веб-галереей через Immich", "Share the New Collection?": "Поделиться новой коллекцией?", "Share via Immich": "Поделиться через Immich", @@ -2607,6 +2610,7 @@ "Show HSL Color Values": "Показывать значения HSL", "Show Header Bar": "Показать панель заголовка", "Show Hidden Favorites": "Показать скрытое в «Избранном»", + "Show Immich Albums as Collections": "Показывать альбомы Immich как коллекции", "Show Immich albums as collections": "Показывать альбомы Immich как коллекции", "Show Import Tab Settings": "Показать настройки вкладки импорта", "Show Index Numbers": "Показывать номера", @@ -2796,6 +2800,7 @@ "Sync With Paired Devices": "Синхронизировать с сопряжёнными устройствами", "Sync With This Catalog": "Синхронизировать с этим каталогом", "Sync conflicts ({})": "Конфликты синхронизации ({})", + "Sync the Camera Roll": "Синхронизировать фотоплёнку", "Sync this catalog": "Синхронизировать этот каталог", "Sync this device's camera roll": "Синхронизировать фотоплёнку этого устройства", "Sync: Devices or Immich": "Синхронизация: устройства или Immich", diff --git a/crates/ui-egui/locales/fork/sv-formats.json b/crates/ui-egui/locales/fork/sv-formats.json index 01f0ea1f57..224fd9c6a2 100644 --- a/crates/ui-egui/locales/fork/sv-formats.json +++ b/crates/ui-egui/locales/fork/sv-formats.json @@ -119,6 +119,7 @@ "Paint over what to replace, then click Generate. About ${usd} per variation.": "Måla över det som ska ersättas och klicka sedan på Generera. Cirka ${usd} per variant.", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "När du panorerar tillbaka eller zoomar in igen på en HDR-redigering visas den direkt i stället för att renderas igen. Använder upp till {need} MB grafikminne på den här skärmen.", "Person {n}": "Person {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Bilder i {folder} hamnar i samlingen ”Camera Roll - den här enhetens namn”.", "Picks to unflag: {n}": "Val att avflagga: {n}", "Preset {name} on {n} photos": "Förinställning {name} på {n} foton", "Print settings not saved: {e}": "Utskriftsinställningarna sparades inte: {e}", diff --git a/crates/ui-egui/locales/fork/sv.json b/crates/ui-egui/locales/fork/sv.json index b9fee0d469..bdec4d419a 100644 --- a/crates/ui-egui/locales/fork/sv.json +++ b/crates/ui-egui/locales/fork/sv.json @@ -341,6 +341,7 @@ "Camera Profiles": "Kameraprofiler", "Camera Profiles (.dcp)": "Kameraprofiler (.dcp)", "Camera Profiles for Import": "Kameraprofiler för import", + "Camera Roll Listed": "Kamerarullen listad", "Camera Sensor": "Kamerasensor", "Camera Serial Number": "Kamerans serienummer", "Camera bodies": "Kamerahus", @@ -842,7 +843,7 @@ "Duplicates": "Dubbletter", "Duration (seconds)": "Längd (sekunder)", "E: every device keeps the original and can add photos": "E: varje enhet behåller originalet och kan lägga till foton", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Varje album är en samling i uppsättningen Immich; under Inställningar ▸ Synkronisering väljer varje enhet Ingen, Förhandsvisningar eller Full kvalitet.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Varje album är en samling i uppsättningen Immich; under Inställningar > Synkronisering väljer varje enhet Ingen, Förhandsvisningar eller Full kvalitet.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Varje enhet behåller sin egen katalog och ser bara de samlingar den får och väljer att ta.", "Each of the {n} selected photos gets the reference that fits it": "Vart och ett av de {n} valda fotona får den referens som passar det", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Varje persons skarpare öga i 100 % överst i lupen. Snabbinställningsfältet (peka på det tomma utrymmet bredvid modulnamnen) växlar den också.", @@ -1567,6 +1568,7 @@ "Lips": "Läppar", "List AI Models": "Lista AI-modeller", "List History Groups": "Lista historikgrupper", + "List Immich Albums Now": "Lista Immich-album nu", "List Lens Profiles": "Lista linsprofiler", "List Plug-in Filters": "Lista tilläggsfilter", "List Preset Folders": "Lista förinställningsmappar", @@ -1615,6 +1617,7 @@ "Look Up Selected Photos": "Slå upp markerade foton", "Look at downsized copies of photos": "Titta på nedskalade kopior av foton", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Leta efter foton som andra appar lagt till i katalogens mappar när katalogen öppnas, när appen hamnar i förgrunden och med några minuters mellanrum. Bara mappar vars innehåll har ändrats genomsöks.", + "Look in the Camera Roll Now": "Titta i kamerarullen nu", "Looking for color charts": "Letar efter färgkartor", "Looking for color charts…": "Letar efter färgkartor…", "Looking for devices": "Letar efter enheter", @@ -2116,7 +2119,6 @@ "Photos imported": "Foton importerade", "Photos imported from now on; photos already in the catalog keep theirs.": "Foton som importeras från och med nu; foton som redan finns i katalogen behåller sin inställning.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Bilder i kamerarullen hamnar i samlingen ”Camera Roll - den här enhetens namn”.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Bilder i {folder} hamnar i samlingen ”Camera Roll - den här enhetens namn”.", "Photos that use the old reference keep it.": "Foton som använder den gamla referensen behåller den.", "Photos whose capture time can't be read were left as they were": "Foton vars tagningstid inte kan läsas lämnades som de var", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Foton vars metadatafil har ändrats av ett annat program: sparande ersätter de ändringarna med katalogens.", @@ -2713,6 +2715,7 @@ "Shadow clipping": "Klippning i skuggor", "Share": "Dela", "Share Catalog": "Dela katalog", + "Share Immich Connection with Synced Devices": "Dela Immich-anslutningen med synkroniserade enheter", "Share Web Gallery via Immich": "Dela webbgalleri via Immich", "Share the New Collection?": "Dela den nya samlingen?", "Share via Immich": "Dela via Immich", @@ -2742,6 +2745,7 @@ "Show HSL Color Values": "Visa HSL-färgvärden", "Show Header Bar": "Visa sidhuvudsfält", "Show Hidden Favorites": "Visa dolda favoriter", + "Show Immich Albums as Collections": "Visa Immich-album som samlingar", "Show Immich albums as collections": "Visa Immich-album som samlingar", "Show Import Tab Settings": "Visa inställningar för importfliken", "Show Index Numbers": "Visa indexnummer", @@ -2941,6 +2945,7 @@ "Sync With Paired Devices": "Synka med parkopplade enheter", "Sync With This Catalog": "Synka med den här katalogen", "Sync conflicts ({})": "Synkkonflikter ({})", + "Sync the Camera Roll": "Synkronisera kamerarullen", "Sync this catalog": "Synka den här katalogen", "Sync this device's camera roll": "Synkronisera den här enhetens kamerarulle", "Sync: Devices or Immich": "Synkning: enheter eller Immich", diff --git a/crates/ui-egui/locales/fork/uk-formats.json b/crates/ui-egui/locales/fork/uk-formats.json index 496f0764d6..e2d1148bb4 100644 --- a/crates/ui-egui/locales/fork/uk-formats.json +++ b/crates/ui-egui/locales/fork/uk-formats.json @@ -99,6 +99,7 @@ "Page {page} of {pages}": "Сторінка {page} з {pages}", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Повернення панорамуванням або повторне збільшення HDR-зміни показує її одразу, без повторного рендерингу. Використовує до {need} МБ графічної пам’яті на цьому екрані.", "Person {n}": "Людина {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Фото з {folder} потрапляють до колекції «Camera Roll - назва цього пристрою».", "Picks to unflag: {n}": "Вибраних, з яких знімається позначка: {n}", "Preset {name} on {n} photos": "Пресет {name} на {n} фото", "Print settings not saved: {e}": "Параметри друку не збережено: {e}", @@ -221,6 +222,6 @@ "{} keys": "Клавіші {}", "“{name}” added to Camera Profiles": "«{name}» додано до профілів камери", "“{name}” has its old settings again": "«{name}» знову має попередні налаштування", - "“{name}” is new. What may the other devices syncing this catalog have of it?": "«{name}» — нова. Що з неї можуть отримувати інші пристрої, які синхронізують цей каталог?", + "“{name}” is new. What may the other devices syncing this catalog have of it?": "«{name}»: нова. Що з неї можуть отримувати інші пристрої, які синхронізують цей каталог?", "“{name}” takes the active photo's settings. Its name, group, place and marks stay.": "«{name}» отримує налаштування активного фото. Назва, група, місце й позначки лишаються." } diff --git a/crates/ui-egui/locales/fork/uk.json b/crates/ui-egui/locales/fork/uk.json index 06fc660806..149fd5bed6 100644 --- a/crates/ui-egui/locales/fork/uk.json +++ b/crates/ui-egui/locales/fork/uk.json @@ -302,6 +302,7 @@ "Camera Profiles": "Профілі камер", "Camera Profiles (.dcp)": "Профілі камер (.dcp)", "Camera Profiles for Import": "Профілі камери під час імпорту", + "Camera Roll Listed": "Фотоплівку перелічено", "Camera Serial Number": "Серійний номер камери", "Camera bodies": "Корпуси камер", "Camera default": "Типово для камери", @@ -761,7 +762,7 @@ "Duration": "Тривалість", "Duration (seconds)": "Тривалість (секунди)", "E: every device keeps the original and can add photos": "E: кожен пристрій зберігає оригінал і може додавати фото", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Кожен альбом — колекція в наборі Immich; у Налаштуваннях ▸ Синхронізація кожен пристрій вибирає «Нічого», «Прев’ю» або «Повна якість».", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Кожен альбом: колекція в наборі Immich; у Налаштуваннях > Синхронізація кожен пристрій вибирає «Нічого», «Прев’ю» або «Повна якість».", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Кожен пристрій має власний каталог і бачить лише ті колекції, які йому дозволено і які він обирає брати.", "Each of the {n} selected photos gets the reference that fits it": "Кожне з {n} вибраних фото отримає відповідний йому еталон", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Різкіше око кожної людини в масштабі 100 % угорі лупи. Її також перемикає панель швидких налаштувань (наведіть вказівник на порожнє місце поруч із назвами модулів).", @@ -1419,6 +1420,7 @@ "Lips": "Губи", "List AI Models": "Перелічити моделі ШІ", "List History Groups": "Перелічити групи історії", + "List Immich Albums Now": "Перелічити альбоми Immich зараз", "List Lens Profiles": "Перелічити профілі об’єктивів", "List Plug-in Filters": "Перелічити фільтри плагінів", "List Preset Folders": "Перелічити теки наборів", @@ -1456,6 +1458,7 @@ "Look Up Selected Photos": "Знайти місця вибраних фото", "Look at downsized copies of photos": "Переглядати зменшені копії фотографій", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Шукати фото, які інші застосунки додали до тек каталогу, під час його відкриття, коли застосунок повертається на передній план, і кожні кілька хвилин. Перевіряються лише теки, вміст яких змінився.", + "Look in the Camera Roll Now": "Перевірити фотоплівку зараз", "Looking for color charts…": "Пошук колірних мішеней…", "Looking for devices": "Пошук пристроїв", "Looking for devices on this network…": "Пошук пристроїв у цій мережі…", @@ -1918,7 +1921,6 @@ "Photos imported": "Імпортовано фото", "Photos imported from now on; photos already in the catalog keep theirs.": "Фото, імпортовані відтепер; фото, які вже є в каталозі, зберігають свої.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Фото з фотоплівки потрапляють до колекції «Camera Roll - назва цього пристрою».", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Фото з {folder} потрапляють до колекції «Camera Roll - назва цього пристрою».", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "Фото залишаються в «Усіх фото». Видалення теки видаляє і її альбоми. Цю дію можна скасувати.", "Photos that use the old reference keep it.": "Фото, що використовують старий еталон, зберігають його.", "Photos whose capture time can't be read were left as they were": "Фото, час зйомки яких не вдалося прочитати, залишилися без змін", @@ -2463,6 +2465,7 @@ "Shadow clipping": "Відсікання тіней", "Share": "Поділитися", "Share Catalog": "Поділитися каталогом", + "Share Immich Connection with Synced Devices": "Поділитися підключенням Immich із синхронізованими пристроями", "Share Web Gallery via Immich": "Поділитися вебгалереєю через Immich", "Share the New Collection?": "Поділитися новою колекцією?", "Share via Immich": "Поділитися через Immich", @@ -2487,6 +2490,7 @@ "Show HSL Color Values": "Показувати значення HSL", "Show Header Bar": "Показати панель заголовка", "Show Hidden Favorites": "Показати приховані улюблені", + "Show Immich Albums as Collections": "Показувати альбоми Immich як колекції", "Show Immich albums as collections": "Показувати альбоми Immich як колекції", "Show Import Tab Settings": "Показати налаштування вкладки імпорту", "Show Index Numbers": "Показувати порядкові номери", @@ -2671,6 +2675,7 @@ "Sync With Paired Devices": "Синхронізувати зі сполученими пристроями", "Sync With This Catalog": "Синхронізувати з цим каталогом", "Sync conflicts ({})": "Конфлікти синхронізації ({})", + "Sync the Camera Roll": "Синхронізувати фотоплівку", "Sync this catalog": "Синхронізувати цей каталог", "Sync this device's camera roll": "Синхронізувати фотоплівку цього пристрою", "Sync: Devices or Immich": "Синхронізація: пристрої або Immich", diff --git a/crates/ui-egui/locales/fork/vi-formats.json b/crates/ui-egui/locales/fork/vi-formats.json index 1edf920569..9551fc7bf8 100644 --- a/crates/ui-egui/locales/fork/vi-formats.json +++ b/crates/ui-egui/locales/fork/vi-formats.json @@ -135,6 +135,7 @@ "Paint over what to replace, then click Generate. About ${usd} per variation.": "Tô lên phần cần thay thế, rồi nhấn Tạo. Khoảng ${usd} mỗi biến thể.", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "Khi kéo lại hoặc phóng to lần nữa trên ảnh HDR đang chỉnh, ảnh hiện ngay thay vì kết xuất lại. Dùng tối đa {need} MB bộ nhớ đồ họa trên màn hình này.", "Person {n}": "Người {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Ảnh trong {folder} được đưa vào bộ sưu tập “Camera Roll - tên thiết bị này”.", "Picks to unflag: {n}": "Ảnh chọn sẽ bỏ cờ: {n}", "Preset {name} on {n} photos": "Preset {name} trên {n} ảnh", "Print settings not saved: {e}": "Không lưu được cài đặt in: {e}", diff --git a/crates/ui-egui/locales/fork/vi.json b/crates/ui-egui/locales/fork/vi.json index 4a70e11bf7..7146e80acf 100644 --- a/crates/ui-egui/locales/fork/vi.json +++ b/crates/ui-egui/locales/fork/vi.json @@ -364,6 +364,7 @@ "Camera Profiles": "Hồ sơ máy ảnh", "Camera Profiles (.dcp)": "Hồ sơ máy ảnh (.dcp)", "Camera Profiles for Import": "Hồ sơ máy ảnh khi nhập", + "Camera Roll Listed": "Đã liệt kê thư viện máy ảnh", "Camera Sensor": "Cảm biến máy ảnh", "Camera Serial Number": "Số sê-ri máy ảnh", "Camera bodies": "Thân máy", @@ -889,7 +890,7 @@ "Duration": "Thời lượng", "Duration (seconds)": "Thời lượng (giây)", "E: every device keeps the original and can add photos": "E: mọi thiết bị giữ bản gốc và có thể thêm ảnh", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Mỗi album là một bộ sưu tập trong nhóm Immich; trong Cài đặt ▸ Đồng bộ, mỗi thiết bị chọn Không, Bản xem trước hoặc Chất lượng đầy đủ.", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "Mỗi album là một bộ sưu tập trong nhóm Immich; trong Cài đặt > Đồng bộ, mỗi thiết bị chọn Không, Bản xem trước hoặc Chất lượng đầy đủ.", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "Mỗi thiết bị giữ catalog riêng và chỉ thấy những bộ sưu tập được phép và chọn nhận.", "Each of the {n} selected photos gets the reference that fits it": "Mỗi ảnh trong {n} ảnh đã chọn nhận ảnh tham chiếu phù hợp với nó", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "Con mắt sắc nét hơn của mỗi người ở 100 % phía trên kính lúp. Thanh cài đặt nhanh (trỏ vào khoảng trống cạnh tên các mô-đun) cũng bật tắt nó.", @@ -1654,6 +1655,7 @@ "Lips": "Môi", "List AI Models": "Liệt kê mô hình AI", "List History Groups": "Liệt kê nhóm lịch sử", + "List Immich Albums Now": "Liệt kê album Immich ngay", "List Lens Profiles": "Liệt kê hồ sơ ống kính", "List Plug-in Filters": "Liệt kê bộ lọc plugin", "List Preset Folders": "Liệt kê thư mục thiết lập sẵn", @@ -1702,6 +1704,7 @@ "Look Up Selected Photos": "Tra cứu ảnh đã chọn", "Look at downsized copies of photos": "Xem bản sao thu nhỏ của ảnh", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "Tìm ảnh mà ứng dụng khác thêm vào thư mục của catalog khi mở catalog, khi ứng dụng được đưa lên trước và vài phút một lần. Chỉ quét các thư mục có danh sách thay đổi.", + "Look in the Camera Roll Now": "Xem thư viện máy ảnh ngay", "Looking for color charts": "Đang tìm bảng màu chuẩn", "Looking for color charts…": "Đang tìm bảng màu chuẩn…", "Looking for devices": "Đang tìm thiết bị", @@ -2224,7 +2227,6 @@ "Photos imported": "Ảnh đã nhập", "Photos imported from now on; photos already in the catalog keep theirs.": "Ảnh nhập từ bây giờ; ảnh đã có trong catalog giữ thiết lập của chúng.", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "Ảnh trong thư viện máy ảnh được đưa vào bộ sưu tập “Camera Roll - tên thiết bị này”.", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "Ảnh trong {folder} được đưa vào bộ sưu tập “Camera Roll - tên thiết bị này”.", "Photos that use the old reference keep it.": "Các ảnh đang dùng ảnh tham chiếu cũ vẫn giữ nó.", "Photos whose capture time can't be read were left as they were": "Ảnh không đọc được thời gian chụp được giữ nguyên", "Photos whose metadata file another program changed: saving replaces those changes with the catalog's.": "Ảnh có tệp siêu dữ liệu bị chương trình khác thay đổi: lưu sẽ thay các thay đổi đó bằng nội dung của catalog.", @@ -2847,6 +2849,7 @@ "Shadow clipping": "Cắt tông vùng tối", "Share": "Chia sẻ", "Share Catalog": "Chia sẻ catalog", + "Share Immich Connection with Synced Devices": "Chia sẻ kết nối Immich với các thiết bị đồng bộ", "Share Web Gallery via Immich": "Chia sẻ thư viện ảnh web qua Immich", "Share the New Collection?": "Chia sẻ bộ sưu tập mới?", "Share via Immich": "Chia sẻ qua Immich", @@ -2877,6 +2880,7 @@ "Show HSL Color Values": "Hiện giá trị màu HSL", "Show Header Bar": "Hiện thanh tiêu đề", "Show Hidden Favorites": "Hiện mục yêu thích đã ẩn", + "Show Immich Albums as Collections": "Hiển thị album Immich dưới dạng bộ sưu tập", "Show Immich albums as collections": "Hiển thị album Immich dưới dạng bộ sưu tập", "Show Import Tab Settings": "Hiện cài đặt thẻ Nhập", "Show Index Numbers": "Hiện số thứ tự", @@ -3094,6 +3098,7 @@ "Sync With Paired Devices": "Đồng bộ với thiết bị đã ghép nối", "Sync With This Catalog": "Đồng bộ với catalog này", "Sync conflicts ({})": "Xung đột đồng bộ ({})", + "Sync the Camera Roll": "Đồng bộ thư viện máy ảnh", "Sync this catalog": "Đồng bộ catalog này", "Sync this device's camera roll": "Đồng bộ thư viện ảnh máy ảnh của thiết bị này", "Sync: Devices or Immich": "Đồng bộ: thiết bị hoặc Immich", diff --git a/crates/ui-egui/locales/fork/zh-hans-formats.json b/crates/ui-egui/locales/fork/zh-hans-formats.json index 843fc0e9b8..b45b560d57 100644 --- a/crates/ui-egui/locales/fork/zh-hans-formats.json +++ b/crates/ui-egui/locales/fork/zh-hans-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "第 {page} 页,共 {pages} 页", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "在 HDR 编辑中平移回来或再次放大时会立即显示,而无需重新渲染。在此屏幕上最多占用 {need} MB 显存。", "Person {n}": "人物 {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} 中的照片会放入收藏集“Camera Roll - 此设备名称”。", "Picks to unflag: {n}": "将取消标记的选用照片:{n}", "Preset {name} on {n} photos": "预设 {name} 应用到 {n} 张照片", "Print settings not saved: {e}": "打印设置未保存:{e}", diff --git a/crates/ui-egui/locales/fork/zh-hans.json b/crates/ui-egui/locales/fork/zh-hans.json index a122c11647..21bc143a5a 100644 --- a/crates/ui-egui/locales/fork/zh-hans.json +++ b/crates/ui-egui/locales/fork/zh-hans.json @@ -317,6 +317,7 @@ "Camera Profiles": "相机配置文件", "Camera Profiles (.dcp)": "相机配置文件 (.dcp)", "Camera Profiles for Import": "导入时的相机配置文件", + "Camera Roll Listed": "已列出相机胶卷", "Camera Serial Number": "相机序列号", "Camera bodies": "相机机身", "Camera default": "相机默认值", @@ -791,7 +792,7 @@ "Duration": "时长", "Duration (seconds)": "时长(秒)", "E: every device keeps the original and can add photos": "E: 每台设备都保留原片并可添加照片", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "每个相册都是 Immich 集合中的一个收藏集;在“设置 ▸ 同步”中,每台设备选择“无”“预览”或“完整画质”。", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "每个相册都是 Immich 集合中的一个收藏集;在“设置 > 同步”中,每台设备选择“无”“预览”或“完整画质”。", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "每台设备保留自己的目录,只显示允许且选择获取的收藏夹。", "Each of the {n} selected photos gets the reference that fits it": "所选的 {n} 张照片各自使用适合它的参考照片", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "在放大镜顶部以 100 % 显示每个人更清晰的那只眼睛。快速设置栏(指向模块名称旁边的空白处)也可切换它。", @@ -1475,6 +1476,7 @@ "Lips": "嘴唇", "List AI Models": "列出 AI 模型", "List History Groups": "列出历史记录分组", + "List Immich Albums Now": "立即列出 Immich 相册", "List Lens Profiles": "列出镜头配置文件", "List Plug-in Filters": "列出插件滤镜", "List Preset Folders": "列出预设文件夹", @@ -1512,6 +1514,7 @@ "Look Up Selected Photos": "查询所选照片", "Look at downsized copies of photos": "查看照片的缩小副本", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "在打开目录时、应用回到前台时以及每隔几分钟,查找其他应用添加到目录文件夹中的照片。只扫描内容有变化的文件夹。", + "Look in the Camera Roll Now": "立即查看相机胶卷", "Looking for color charts…": "正在查找色卡…", "Looking for devices": "正在查找设备", "Looking for devices on this network…": "正在此网络上查找设备…", @@ -1982,7 +1985,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "从现在起导入的照片;目录中已有的照片保持原有设置。", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "“最近删除”中的照片可在应用内恢复:右键 → 恢复(或永久删除),也可在", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "相机胶卷中的照片会放入收藏集“Camera Roll - 此设备名称”。", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} 中的照片会放入收藏集“Camera Roll - 此设备名称”。", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "照片仍保留在“所有照片”中。删除文件夹也会删除其中的相册。此操作可以撤销。", "Photos that use the old reference keep it.": "使用旧参考照片的照片会保留它。", "Photos whose capture time can't be read were left as they were": "无法读取拍摄时间的照片已保持原样", @@ -2533,6 +2535,7 @@ "Shadow clipping": "阴影溢出", "Share": "共享", "Share Catalog": "共享目录", + "Share Immich Connection with Synced Devices": "与同步的设备共享 Immich 连接", "Share Web Gallery via Immich": "通过 Immich 共享 Web 画廊", "Share the New Collection?": "共享新收藏夹?", "Share via Immich": "通过 Immich 共享", @@ -2557,6 +2560,7 @@ "Show HSL Color Values": "显示 HSL 颜色值", "Show Header Bar": "显示标题栏", "Show Hidden Favorites": "显示隐藏的收藏夹", + "Show Immich Albums as Collections": "将 Immich 相册显示为收藏集", "Show Immich albums as collections": "将 Immich 相册显示为收藏集", "Show Import Tab Settings": "显示导入选项卡设置", "Show Index Numbers": "显示索引编号", @@ -2752,6 +2756,7 @@ "Sync With Paired Devices": "与已配对的设备同步", "Sync With This Catalog": "与此目录同步", "Sync conflicts ({})": "同步冲突({})", + "Sync the Camera Roll": "同步相机胶卷", "Sync this catalog": "同步此目录", "Sync this device's camera roll": "同步此设备的相机胶卷", "Sync: Devices or Immich": "同步:设备或 Immich", diff --git a/crates/ui-egui/locales/fork/zh-hant-formats.json b/crates/ui-egui/locales/fork/zh-hant-formats.json index 42d78ae9c0..8fcb45d8ad 100644 --- a/crates/ui-egui/locales/fork/zh-hant-formats.json +++ b/crates/ui-egui/locales/fork/zh-hant-formats.json @@ -103,6 +103,7 @@ "Page {page} of {pages}": "第 {page} 頁,共 {pages} 頁", "Panning back or zooming in again on an HDR edit shows it at once instead of rendering it again. Uses up to {need} MB of graphics memory on this screen.": "在 HDR 編輯上平移回來或再次放大時會立即顯示,而不必重新算繪。此螢幕最多使用 {need} MB 的顯示記憶體。", "Person {n}": "人物 {n}", + "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} 中的照片會放入收藏集「Camera Roll - 此裝置名稱」。", "Picks to unflag: {n}": "將取消標記的選用相片:{n}", "Preset {name} on {n} photos": "預設 {name} 套用到 {n} 張相片", "Print settings not saved: {e}": "列印設定未儲存:{e}", diff --git a/crates/ui-egui/locales/fork/zh-hant.json b/crates/ui-egui/locales/fork/zh-hant.json index a5395e3ea5..bfc9684450 100644 --- a/crates/ui-egui/locales/fork/zh-hant.json +++ b/crates/ui-egui/locales/fork/zh-hant.json @@ -324,6 +324,7 @@ "Camera Profiles": "相機描述檔", "Camera Profiles (.dcp)": "相機描述檔(.dcp)", "Camera Profiles for Import": "匯入時的相機描述檔", + "Camera Roll Listed": "已列出相機膠卷", "Camera Serial Number": "相機序號", "Camera bodies": "相機機身", "Camera default": "相機預設值", @@ -815,7 +816,7 @@ "Duration": "時長", "Duration (seconds)": "時長(秒)", "E: every device keeps the original and can add photos": "E: 每台裝置都保留原始檔並可加入相片", - "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "每個相簿都是 Immich 集合中的一個收藏集;在「設定 ▸ 同步」中,每台裝置選擇「無」「預覽」或「完整畫質」。", + "Each album is a collection in the Immich set; in Settings ▸ Sync each device chooses None, Previews or Full Quality.": "每個相簿都是 Immich 集合中的一個收藏集;在「設定 > 同步」中,每台裝置選擇「無」「預覽」或「完整畫質」。", "Each device keeps its own catalog and sees only the collections it is allowed and chooses to take.": "每台裝置保留自己的目錄,只會看到允許且選擇取得的收藏集。", "Each of the {n} selected photos gets the reference that fits it": "所選的 {n} 張照片各自使用適合它的參考照片", "Each person's sharper eye at 100 % across the top of the loupe. The quick settings bar (point at the space beside the module names) switches it too.": "在放大鏡頂部以 100 % 顯示每個人較清晰的那隻眼睛。快速設定列(指向模組名稱旁的空白處)也可切換它。", @@ -1509,6 +1510,7 @@ "Lips": "嘴唇", "List AI Models": "列出 AI 模型", "List History Groups": "列出歷史記錄群組", + "List Immich Albums Now": "立即列出 Immich 相簿", "List Lens Profiles": "列出鏡頭描述檔", "List Plug-in Filters": "列出外掛濾鏡", "List Preset Folders": "列出預設集資料夾", @@ -1546,6 +1548,7 @@ "Look Up Selected Photos": "查詢所選照片", "Look at downsized copies of photos": "檢視相片的縮小副本", "Look for photos other apps added to the catalog's folders when the catalog opens, when the app comes to the front and every few minutes. Only folders whose listing changed are scanned.": "在開啟目錄時、App 回到前景時以及每隔幾分鐘,尋找其他 App 加入目錄資料夾的照片。只掃描內容有變更的資料夾。", + "Look in the Camera Roll Now": "立即查看相機膠卷", "Looking for color charts…": "正在尋找色卡…", "Looking for devices": "正在尋找裝置", "Looking for devices on this network…": "正在此網路上尋找裝置…", @@ -2023,7 +2026,6 @@ "Photos imported from now on; photos already in the catalog keep theirs.": "從現在起匯入的照片;目錄中已有的照片保留其原本設定。", "Photos in Recently Deleted can be restored from the app: right-click ▸ Restore (or Delete Permanently), also in the": "“最近刪除”中的照片可在應用內恢復:右鍵 → 恢復(或永久刪除),也可在", "Photos in the camera roll go into the collection “Camera Roll - this device's name”.": "相機膠卷中的照片會放入收藏集「Camera Roll - 此裝置名稱」。", - "Photos in {folder} go into the collection “Camera Roll - this device's name”.": "{folder} 中的照片會放入收藏集「Camera Roll - 此裝置名稱」。", "Photos stay in All Photos. Deleting a folder also deletes its albums. You can undo this.": "照片會保留在「所有照片」中。刪除資料夾也會刪除其中的相簿。此動作可以復原。", "Photos that use the old reference keep it.": "使用舊參考照片的照片會保留它。", "Photos whose capture time can't be read were left as they were": "無法讀取拍攝時間的照片維持原狀", @@ -2576,6 +2578,7 @@ "Shadow clipping": "陰影溢色", "Share": "分享", "Share Catalog": "分享目錄", + "Share Immich Connection with Synced Devices": "與同步的裝置共享 Immich 連線", "Share Web Gallery via Immich": "透過 Immich 分享網路藝廊", "Share the New Collection?": "共享新收藏集?", "Share via Immich": "透過 Immich 分享", @@ -2600,6 +2603,7 @@ "Show HSL Color Values": "顯示 HSL 顏色值", "Show Header Bar": "顯示標題列", "Show Hidden Favorites": "顯示隱藏的喜好項目", + "Show Immich Albums as Collections": "將 Immich 相簿顯示為收藏集", "Show Immich albums as collections": "將 Immich 相簿顯示為收藏集", "Show Import Tab Settings": "顯示匯入標籤頁設定", "Show Index Numbers": "顯示索引編號", @@ -2797,6 +2801,7 @@ "Sync With Paired Devices": "與配對裝置同步", "Sync With This Catalog": "與此目錄同步", "Sync conflicts ({})": "同步衝突({})", + "Sync the Camera Roll": "同步相機膠卷", "Sync this catalog": "同步此目錄", "Sync this device's camera roll": "同步此裝置的相機膠卷", "Sync: Devices or Immich": "同步:裝置或 Immich", diff --git a/crates/ui-egui/src/panels/connections.rs b/crates/ui-egui/src/panels/connections.rs index 29cf48f51c..deb119ad6f 100644 --- a/crates/ui-egui/src/panels/connections.rs +++ b/crates/ui-egui/src/panels/connections.rs @@ -1786,29 +1786,6 @@ const SYNC_FIELDS: &[(&str, &str)] = &[ const DIRECTIONS: &[(&str, &str)] = &[("twoWay", "Two-way"), ("toImmich", "To Immich"), ("fromImmich", "From Immich"), ("off", "Off")]; const POLICIES: &[(&str, &str)] = &[("newest", "Newest wins"), ("catalog", "Catalog wins"), ("immich", "Immich wins"), ("ask", "Ask")]; -/// The last album run as one short line (and whether it failed); None before any run. -fn album_summary(v: &Value) -> Option<(String, bool)> { - if v.is_null() { - return None; - } - if v["ok"] == false { - let msg = v["error"]["message"].as_str().or_else(|| v["errors"][0].as_str()).unwrap_or("failed"); - return Some((trf!("Albums: {}", msg), true)); - } - let n = |k: &str| v[k].as_u64().unwrap_or(0); - Some(( - trf!( - "Albums: {} linked, {} created, {} renamed, {} changed, {} deleted", - n("albums"), - n("created"), - n("renamed"), - n("membership"), - n("deleted") - ), - false, - )) -} - fn label_of(list: &[(&str, &'static str)], v: &str) -> &'static str { list.iter().find(|(k, _)| *k == v).map(|(_, l)| *l).unwrap_or("?") } @@ -1863,7 +1840,7 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & let now = ui.input(|x| x.time); let stale = match app.immich.sync_view.get(id) { None => true, - Some((st, _, at)) => (st["running"] == true || st["albumsRunning"] == true) && now - at > 0.5, + Some((st, _, at)) => (st["running"] == true) && now - at > 0.5, }; if stale { let st = app.session.execute("immich.syncStatus", &json!({"account": id, "log": 1})).unwrap_or_default(); @@ -1871,7 +1848,7 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & app.immich.sync_view.insert(id.to_string(), (st, cf, now)); } let Some((st, cf, _)) = app.immich.sync_view.get(id).cloned() else { return }; - let running = st["running"] == true || st["albumsRunning"] == true; + let running = st["running"] == true; if running { ui.ctx().request_repaint_after(std::time::Duration::from_millis(300)); } @@ -1903,23 +1880,10 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & } else { crate::i18n::tr("Not synced yet.").to_string() }; - let albums_line = album_summary(&st["albumsLast"]); ui.horizontal_wrapped(|ui| { ui.label(RichText::new(crate::i18n::tr("Metadata sync")).font(t.semibold(12.0)).color(t.text)); let l = ui.label(RichText::new(line).size(11.5).color(if last["ok"] == false { t.caution } else { t.text_label })); register(ui.ctx(), format!("label:immichSyncStatus-{i}"), l.rect); - if let Some((s, bad)) = albums_line { - let l = ui.label(RichText::new(s).size(11.5).color(if bad { t.caution } else { t.text_label })); - register(ui.ctx(), format!("label:immichAlbumStatus-{i}"), l.rect); - } - // collections the last album run kept although their Immich album was deleted - let kept: Vec<&str> = st["albumsLast"]["kept"].as_array().into_iter().flatten().filter_map(|k| k["name"].as_str()).collect(); - if !kept.is_empty() { - let l = ui - .label(RichText::new(trf!("Kept {} collections that hold photos Immich doesn't have", kept.len())).size(11.5).color(t.caution)) - .on_hover_text(kept.join(", ")); - register(ui.ctx(), format!("label:immichAlbumKept-{i}"), l.rect); - } }); ui.horizontal(|ui| { ui.spacing_mut().item_spacing.x = 4.0; @@ -1929,11 +1893,6 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & report(app, ui.ctx(), r); changed = true; } - if text_button(ui, &format!("immichSyncAlbums-{i}"), crate::i18n::tr("Sync Albums"), false).clicked() { - let r = app.run("immich.syncAlbums", json!({"account": id, "background": true})); - report(app, ui.ctx(), r); - changed = true; - } if text_button(ui, &format!("immichPeople-{i}"), crate::i18n::tr("Import People"), false).clicked() { ask_bg(app, ui.ctx(), "immich.importPeople", id, json!({})); } @@ -1945,7 +1904,6 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & // rules let cfg = &st["config"]; let mut patch = serde_json::Map::new(); - let mut album_patch: Option = None; egui::Grid::new(("immich-sync-rules", i)).num_columns(3).spacing([8.0, 2.0]).show(ui, |ui| { for (row, rule) in st["rules"].as_array().into_iter().flatten().enumerate() { let field = rule["field"].as_str().unwrap_or_default(); @@ -1974,41 +1932,11 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & patch.insert(field.to_string(), json!({"direction": d2, "policy": p2})); } } - // collections ↔ albums: off = only albums linked by hand - let ar = &st["albumRule"]; - let (dir, pol) = (ar["direction"].as_str().unwrap_or("off").to_string(), ar["policy"].as_str().unwrap_or("ask").to_string()); - let (mut d2, mut p2) = (dir.clone(), pol.clone()); - ui.label(RichText::new(crate::i18n::tr("Collections ↔ albums")).color(t.text_label)).on_hover_text(crate::i18n::tr( - "Catalog collections map to the Immich albums of the same name: creates, renames, photos added or removed, and deletes. Deleting a collection or an album never deletes photos. Off: only collections linked by hand.", - )); - egui::ComboBox::from_id_salt(("immich-dir-albums", i)).width(110.0).selected_text(crate::i18n::tr(label_of(DIRECTIONS, &dir))).show_ui( - ui, - |ui| { - for (k, l) in DIRECTIONS { - ui.selectable_value(&mut d2, k.to_string(), crate::i18n::tr(l)); - } - }, - ); - egui::ComboBox::from_id_salt(("immich-pol-albums", i)).width(110.0).selected_text(crate::i18n::tr(label_of(POLICIES, &pol))).show_ui( - ui, - |ui| { - for (k, l) in POLICIES { - ui.selectable_value(&mut p2, k.to_string(), crate::i18n::tr(l)); - } - }, - ); - ui.end_row(); - if d2 != dir || p2 != pol { - album_patch = Some(json!({"direction": d2, "policy": p2})); - } }); let mut cfg_patch = serde_json::Map::new(); if !patch.is_empty() { cfg_patch.insert("rules".into(), Value::Object(patch)); } - if let Some(a) = album_patch { - cfg_patch.insert("albums".into(), a); - } ui.horizontal(|ui| { let mut fav = cfg["favorite"].as_str().unwrap_or("pick").to_string(); ui.label(RichText::new(crate::i18n::tr("Favourite means")).color(t.text_label)); @@ -2094,43 +2022,6 @@ fn sync_section(app: &mut LccApp, ui: &mut egui::Ui, t: &Tokens, i: usize, id: & }); } } - // albums deleted on one side, waiting for the user - let adels = st["albumDeletions"].as_array().cloned().unwrap_or_default(); - if !adels.is_empty() { - ui.label(RichText::new(trf!("Albums deleted on one side ({})", adels.len())).font(t.semibold(12.0)).color(t.caution)); - for (n, d) in adels.iter().enumerate() { - ui.horizontal(|ui| { - ui.spacing_mut().item_spacing.x = 4.0; - let in_catalog = d["deletedOn"] == "catalog"; - let what = if in_catalog { crate::i18n::tr("deleted in the catalog") } else { crate::i18n::tr("deleted in Immich") }; - ui.label(RichText::new(format!("{}: {what}", d["name"].as_str().unwrap_or_default())).color(t.text)); - let apply = if in_catalog { "Delete in Immich Too" } else { "Delete Here Too" }; - if text_button(ui, &format!("immichAlbumDeletion-{i}-{n}-apply"), crate::i18n::tr(apply), false) - .on_hover_text(crate::i18n::tr("Deletes the album only; its photos stay.")) - .clicked() - { - let name = d["name"].as_str().unwrap_or_default(); - app.immich.confirm = Some(Confirm { - account: id.to_string(), - place: "sync", - text: if in_catalog { - trf!("Delete the album “{}” in Immich? Its photos stay.", name) - } else { - trf!("Delete the collection “{}” here? Its photos stay.", name) - }, - button: apply, - command: "immich.resolveAlbumDeletion", - params: json!({"account": id, "album": d["album"], "action": "apply"}), - }); - } - if text_button(ui, &format!("immichAlbumDeletion-{i}-{n}-keep"), crate::i18n::tr("Keep"), false).clicked() { - let r = app.run("immich.resolveAlbumDeletion", json!({"account": id, "album": d["album"], "action": "keep"})); - report(app, ui.ctx(), r); - changed = true; - } - }); - } - } changed |= confirm_box(app, ui, t, i, id, "sync"); if changed { app.immich.sync_view.remove(id); diff --git a/crates/ui-egui/src/tests_immich_ui.rs b/crates/ui-egui/src/tests_immich_ui.rs index 10529d2e8a..0e38f6e2b1 100644 --- a/crates/ui-egui/src/tests_immich_ui.rs +++ b/crates/ui-egui/src/tests_immich_ui.rs @@ -193,7 +193,7 @@ fn immich_card_is_compact() { // (further down the Sync section: scrolled to, as a person would) let mut text = h.painted_text().join("\n"); for _ in 0..12 { - if text.contains("Collections ↔ albums") { + if text.contains("Favourite means") { break; } h.request("ui.hoverWidget", json!({"id": "settings:rows", "fx": 0.98, "fy": 0.5}), T); @@ -203,7 +203,8 @@ fn immich_card_is_compact() { } text = h.painted_text().join("\n"); } - assert!(text.contains("Collections ↔ albums"), "the album rule row"); + assert!(text.contains("Favourite means"), "the rest of the Sync section"); + assert!(!text.contains("Collections ↔ albums"), "the name-matching album rule is gone"); if let Some(p) = lcc_brand::env_os("TEST_SHOTS") { h.app.services.png = Some(Box::new(|img: &lcc_raster::Rgba8| { lcc_codecs::encode_png(&lcc_codecs::EncodeImage::rgba8(img), &lcc_codecs::EncodeMeta::default()).unwrap_or_default() diff --git a/docs/changelog/unreleased/2026-11-15-immich-collections.md b/docs/changelog/unreleased/2026-11-15-immich-collections.md index cc91b10cfc..134b943871 100644 --- a/docs/changelog/unreleased/2026-11-15-immich-collections.md +++ b/docs/changelog/unreleased/2026-11-15-immich-collections.md @@ -4,3 +4,4 @@ - **Immich albums as device-sync collections:** `immich.collections` lists an account's albums as collections `immich::` under an "Immich" set (grant fixed at Sync). Each device takes None, Previews (link-only) or Full Quality (originals) from Immich; members come from the server on each device, records travel between devices, and a photo added on any device is checked by checksum and uploaded at most once. Device sync names the account by Immich's user id, so devices reaching one server by different URLs share it. A link-only photo whose original is later imported from disk takes the file instead of becoming a second photo. - **Shared or private Immich connections:** `immich.share` sends an account and its API key to the group's devices over the encrypted peer channel, into their key storage (never the replica, logs or results); a private account's collections are never told to other devices. - **Camera roll collection:** `sync.cameraRoll` watches a folder (on Android, the camera roll the app already lists) and keeps a device-owned collection `Camera Roll - {Device Name}` that follows renames; photo identity by SHA-1 keeps it free of duplicates with the Immich app's uploads. +- **Removed the name-matching Immich album rule** (`immich.linkAlbum`, `immich.syncAlbums`, `immich.resolveAlbumDeletion`, Sync… ▸ Collections ↔ albums): replaced by Immich albums as collections; an account with the rule on is migrated to `collections: true`. diff --git a/docs/immich.md b/docs/immich.md index 52289e415f..407e23d8ea 100644 --- a/docs/immich.md +++ b/docs/immich.md @@ -248,32 +248,6 @@ server by checksum first, so an upload whose answer was lost is never stored twi the next run (photos already sent are found by checksum). In the app, Publish Services ▸ Set Up / Edit Settings… has the Immich form: account, what to send (rendered / original / both) and "trash removed renders". -`immich.linkAlbum {album}` links a catalog album with an Immich album; `immich.syncAlbums` then keeps the same linked -photos in both (added or removed on one side since the last sync: the same on the other). - -**Album rule.** Settings → Connections → Sync… → *Albums ↔ albums* (`immich.setSync {config: {albums: {direction, -policy}}}`) maps every plain catalog album to the Immich album of the same name: - -- *Off* (default): only albums linked by hand sync, as above. -- *To Immich* / *From Immich*: one way; the other side's changes are not followed (an album deleted on the source-only - side is put back). -- *Two-way*: creates, renames, photos added or removed, and album deletes travel both ways. - -Deleting an album never deletes photos, only the album on the other side, and only as the policy says: *Catalog wins* -/ *Immich wins* decide, *Newest wins* deletes unless the other side changed the album since the last sync, *Ask* (the -default) leaves it in the Sync… panel's *Albums deleted on one side* list (`immich.resolveAlbumDeletion {album, -action: apply|keep}`). A name changed differently on both sides follows the policy, or is left alone. Published -collections, smart albums, folders and the Quick Collection never map. Sync Now and the background schedule run the -album rule too; runs show in the activity stack. The key needs `album.create`, `album.update`, `album.delete`, -`albumAsset.create` and `albumAsset.delete` for this. - -Two rules keep a failed run from costing photos or collections: - -- A link remembers which photos both albums held after the last run. Only photos **known to be in the Immich album** - go in there: Immich answers an album add with one result per asset, and a photo it refused (or an add that failed - altogether, also right after creating the album) is simply added again by the next run. It is never read as - "removed in Immich" and taken out of the collection. -- A collection that holds **photos Immich does not have** (not linked to an asset) is never deleted because its - Immich album was deleted, whatever the policy. It is kept, taken out of the album sync (no album is made or - matched for it again until it is linked by hand with `immich.linkAlbum`), and the run lists it in `kept`; the Sync - section says how many were kept. *Ask* still asks, and the user may delete it knowingly. +Immich albums meet the catalog as device-sync collections (above, *Albums as device-sync collections*). The +earlier name-matching album rule (`immich.linkAlbum`, `immich.syncAlbums`, `immich.resolveAlbumDeletion`) was removed: +an account that had it on shows its albums as collections instead (migrated when `connections.json` is read). diff --git a/docs/manual-site/src/content/docs/sync/immich.mdx b/docs/manual-site/src/content/docs/sync/immich.mdx index 479610414e..d7ce40c4d2 100644 --- a/docs/manual-site/src/content/docs/sync/immich.mdx +++ b/docs/manual-site/src/content/docs/sync/immich.mdx @@ -29,8 +29,7 @@ Works with [Immich](https://immich.app) servers, version 3.0 or later. Older ser - **Sync**: ratings, picks/favourites, captions, keywords/tags, GPS and capture time, both ways. A change on one side flows to the other; when both changed, a per-field policy decides (catalog, Immich, newest, or ask). Reject to archived is off by default. **Preview Changes** lists what a sync would do, without doing it. - A location or capture time you clear here stays cleared (Immich cannot clear one, so its copy keeps the old value). - **Deletions never sync on their own**: they wait in a queue for you to apply or keep; Immich gets them in its trash. A deletion that was undone (the photo restored from Immich's trash) leaves the queue by itself. **Delete Here Too**, **Trash in Immich**, **Delete in Immich Too** and **Disconnect** ask before they act. -- **Albums**: link an album by hand, or set the album rule in **Sync…** (off, to Immich, from Immich, two-way). Deleting an album never deletes photos. A collection that also holds photos Immich does not have is never deleted when its Immich album is: it is kept and no longer synced. -- **Albums as collections**: **Show Immich albums as collections** on the account card lists every album as a collection in [Device sync](../devices/), where each device chooses what it keeps. +- **Albums**: turn on **Show Immich albums as collections** on the account card; each album becomes a collection in [Device sync](../devices/), where each device chooses what it keeps. Adding or removing photos there changes the Immich album. An account that used the old album rule is switched to this. - **Stacks** and Edit In versions: a saved Edit In version is uploaded and stacked on the original. - **People and smart search**: import Immich's faces and names, push names back; search Immich's index (smart, text in image, description, place) and show the result as a collection. - **External libraries**: when Immich indexes the same folders, nothing is uploaded; photos link by path through a path-mapping table. diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 7d10e4ec1a..7459dbd84d 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -955,7 +955,7 @@ We only talk to Immich over its HTTP API with our own client; concepts, endpoint | IMM-SIDECARS | XMP sidecars both ways: pull the sidecar Immich stores for a linked asset, push the catalog's sidecars and metadata | P1 | ✅ | `cmd:immich.pullSidecars` `cmd:immich.pushSidecars`, `crates/immich/src/sidecars.rs`, `crates/immich/src/client.rs` (`asset_files`, `asset_sidecar`, `download_asset_file`; `GET /asset-files`, v3.2.0), `crates/engine/src/cmd/immich_sidecars.rs`, Settings → Connections → XMP Sidecars (`crates/ui-egui/src/panels/connections.rs`): pull applies the stored XMP (metadata + `lc:settings` develop settings) as one undo step and writes the local sidecar, skipping a photo edited after the asset unless `overwrite`; push writes whole XMP sidecars for external-library folders and sends the fields Immich keeps (rating, description, date, location, tags) for managed assets, which Immich merges into the sidecar it holds; `full` reads the sidecar Immich holds, merges the catalog's packet into it and copies it back through a tiny temporary asset (`PUT /assets/copy`), then removes it (the original is never deleted or re-uploaded). Version-gated on v3.2.0; verified against v3.3.1 (ignored live test `live_asset_sidecar_round_trip`) | Phase 4 | | IMM-SHARELINK | Create Immich shared links for published albums (from Web/Slideshow/Publish) | P2 | ✅ | `cmd:web.shareImmich`, `cmd:webui.shareImmich`, `crates/immich/src/share.rs` | P3.8: Web module ▸ Share via Immich: renders the gallery's large images, uploads them into a new Immich album and creates a shared link with expiry, password, allow-download and show-metadata options; Copy URL. From Slideshow / Publish: not yet | | IMM-PUBLISH | Immich publish service: collections → albums, renders and/or originals, re-publish, stacks | P1 | ✅ | `cmd:publish.createService` (`kind: immich`, `settings: {account, send: rendered\|original\|both, deleteRemoved}`), `cmd:publish.run`, `crates/immich/src/publish.rs`: collection = Immich album (found by name or created), SHA-1 pre-check (`bulk-upload-check`, no duplicates), linked originals never re-uploaded (shared originals), both = render stacked on the original, re-publish uploads the new render and trashes the old one, removal takes it out of the album (trash only with `deleteRemoved`). Engine-side opener in `crates/engine/src/cmd/immich_publish.rs`. Album remembered by id: renaming the collection or moving it into another collection set renames the same Immich album on the next run; collection sets below the service set are name prefixes (`Set / Collection`, `publish.createCollection {parent}`); uploads retried with backoff, each attempt checksum-checked first (no duplicates when an answer is lost), interrupted runs resume by checksum; Publish Services Immich form (account, send, trash removed renders). an uploaded original carries the photo's whole XMP sidecar (IMM-SIDECARS). Live test `live_publish_renames_its_album`; version matrix (v3.0.0 and `release`) in `.github/workflows/immich.yml` via `cargo xtask immich up --version`. Rename happens on the next publish run, not at rename time | Phase 4 | -| IMM-SYNC | Two-way metadata sync (rating, favourite, title/description, tags ↔ keywords, albums ↔ collections, GPS, time, archive) | P1 | ✅ | `cmd:immich.sync` `cmd:immich.syncStatus` `cmd:immich.syncConflicts` `cmd:immich.resolveConflict` `cmd:immich.setSync` `cmd:immich.resolveDeletion` `cmd:immich.linkAlbum` `cmd:immich.syncAlbums` `cmd:immich.resolveAlbumDeletion`, `crates/immich/src/sync.rs`: field-wise three-way merge against the last synced values, per-field direction and policy (newest wins by default; GPS/date ask), keywords merged as sets (export-excluded never sent), conflicts kept with both values, deletions queued (never automatic, trash only), dry run, activity log, background interval with backoff, offline-safe (nothing changes, cursor kept). Albums ↔ collections (`crates/immich/src/albums.rs`): a per-server album rule (direction + policy, like the field rows): off = only albums linked by hand; to Immich / from Immich / two-way = every plain album maps to the Immich album of the same name with creates, renames, membership and album deletes (never photo deletes; deletes follow the policy, or wait for the user when the policy is ask or the other side changed too); published collections, smart albums and the Quick Collection stay out. Album and background metadata runs hold an activity row; Sync Now and the schedule run the album rule too. UI: Settings → Connections → Sync… (rules incl. albums, schedule, conflicts, deletion queues, one latest-run status line). Polls `updatedAfter` (not `/sync/stream`); scale (100k) untested | Phase 4 | +| IMM-SYNC | Two-way metadata sync (rating, favourite, title/description, tags ↔ keywords, albums as device-sync collections, GPS, time, archive) | P1 | ✅ | `cmd:immich.sync` `cmd:immich.syncStatus` `cmd:immich.syncConflicts` `cmd:immich.resolveConflict` `cmd:immich.setSync` `cmd:immich.resolveDeletion` `cmd:immich.collections`, `crates/immich/src/sync.rs`: field-wise three-way merge against the last synced values, per-field direction and policy (newest wins by default; GPS/date ask), keywords merged as sets (export-excluded never sent), conflicts kept with both values, deletions queued (never automatic, trash only), dry run, activity log, background interval with backoff, offline-safe (nothing changes, cursor kept). Albums ↔ collections (`crates/immich/src/albums.rs`): a per-server album rule (direction + policy, like the field rows): off = only albums linked by hand; to Immich / from Immich / two-way = every plain album maps to the Immich album of the same name with creates, renames, membership and album deletes (never photo deletes; deletes follow the policy, or wait for the user when the policy is ask or the other side changed too); published collections, smart albums and the Quick Collection stay out. Album and background metadata runs hold an activity row; Sync Now and the schedule run the album rule too. UI: Settings → Connections → Sync… (rules incl. albums, schedule, conflicts, deletion queues, one latest-run status line). Polls `updatedAfter` (not `/sync/stream`); scale (100k) untested | Phase 4 | | IMM-PEOPLE | Import Immich people and face regions into People; push names back | P2 | ✅ | `cmd:immich.importPeople` `cmd:immich.confirmFaces` `cmd:immich.pushPeople`, `crates/immich/src/people.rs`: faces → face regions marked from Immich (`immich:`), hidden people skipped, overlapping regions kept, confirmed ones survive re-import; names back as renames, shared names as merges (opt-in). Birth dates are reported, not stored | Phase 4 | | IMM-SEARCH | Immich smart (CLIP) and metadata search from the Library filter bar | P2 | ✅ | `cmd:immich.smartSearch` (`mode: smart\|ocr\|description\|place`, `show` → temporary collection via the filter's photo list, `saveAs` → album); filter bar "Immich smart search" box (`crates/ui-egui/src/panels/connections.rs` `smart_search_box`, runs on a worker) | Phase 4 | | IMM-MCP | Immich commands available via CLI, control channel and MCP | P2 | ✅ | every Immich action is an `immich.*` command (`cmd:immich.sync`, `cmd:immich.smartSearch`, …), dispatched alike by UI, CLI, control channel and MCP | Phase 4 | diff --git a/docs/whats-new/2026-11-15-immich-collections.md b/docs/whats-new/2026-11-15-immich-collections.md index 660f1bbcad..01ddbf7e90 100644 --- a/docs/whats-new/2026-11-15-immich-collections.md +++ b/docs/whats-new/2026-11-15-immich-collections.md @@ -15,3 +15,5 @@ encrypted link; off, the connection and its albums stay on this device. - **Sync this device's camera roll** (Settings ▸ Sync) puts new photos into the collection "Camera Roll - ‹device›", without duplicates when the Immich app uploads them too. +- The Immich "Collections ↔ albums" name-matching rule is gone: albums now show as collections (accounts that + used the rule are switched over). From b181c59f6942057121db1302b690f5a8d7f312fe Mon Sep 17 00:00:00 2001 From: Andrew Frahn Date: Sun, 15 Nov 2026 14:28:52 +1100 Subject: [PATCH 15/15] SYNC-IMMICH: parity row cites the collections module instead of the removed albums.rs Co-Authored-By: Claude Opus 5.5 --- docs/parity-checklist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/parity-checklist.md b/docs/parity-checklist.md index 7459dbd84d..78ffe9e686 100644 --- a/docs/parity-checklist.md +++ b/docs/parity-checklist.md @@ -955,7 +955,7 @@ We only talk to Immich over its HTTP API with our own client; concepts, endpoint | IMM-SIDECARS | XMP sidecars both ways: pull the sidecar Immich stores for a linked asset, push the catalog's sidecars and metadata | P1 | ✅ | `cmd:immich.pullSidecars` `cmd:immich.pushSidecars`, `crates/immich/src/sidecars.rs`, `crates/immich/src/client.rs` (`asset_files`, `asset_sidecar`, `download_asset_file`; `GET /asset-files`, v3.2.0), `crates/engine/src/cmd/immich_sidecars.rs`, Settings → Connections → XMP Sidecars (`crates/ui-egui/src/panels/connections.rs`): pull applies the stored XMP (metadata + `lc:settings` develop settings) as one undo step and writes the local sidecar, skipping a photo edited after the asset unless `overwrite`; push writes whole XMP sidecars for external-library folders and sends the fields Immich keeps (rating, description, date, location, tags) for managed assets, which Immich merges into the sidecar it holds; `full` reads the sidecar Immich holds, merges the catalog's packet into it and copies it back through a tiny temporary asset (`PUT /assets/copy`), then removes it (the original is never deleted or re-uploaded). Version-gated on v3.2.0; verified against v3.3.1 (ignored live test `live_asset_sidecar_round_trip`) | Phase 4 | | IMM-SHARELINK | Create Immich shared links for published albums (from Web/Slideshow/Publish) | P2 | ✅ | `cmd:web.shareImmich`, `cmd:webui.shareImmich`, `crates/immich/src/share.rs` | P3.8: Web module ▸ Share via Immich: renders the gallery's large images, uploads them into a new Immich album and creates a shared link with expiry, password, allow-download and show-metadata options; Copy URL. From Slideshow / Publish: not yet | | IMM-PUBLISH | Immich publish service: collections → albums, renders and/or originals, re-publish, stacks | P1 | ✅ | `cmd:publish.createService` (`kind: immich`, `settings: {account, send: rendered\|original\|both, deleteRemoved}`), `cmd:publish.run`, `crates/immich/src/publish.rs`: collection = Immich album (found by name or created), SHA-1 pre-check (`bulk-upload-check`, no duplicates), linked originals never re-uploaded (shared originals), both = render stacked on the original, re-publish uploads the new render and trashes the old one, removal takes it out of the album (trash only with `deleteRemoved`). Engine-side opener in `crates/engine/src/cmd/immich_publish.rs`. Album remembered by id: renaming the collection or moving it into another collection set renames the same Immich album on the next run; collection sets below the service set are name prefixes (`Set / Collection`, `publish.createCollection {parent}`); uploads retried with backoff, each attempt checksum-checked first (no duplicates when an answer is lost), interrupted runs resume by checksum; Publish Services Immich form (account, send, trash removed renders). an uploaded original carries the photo's whole XMP sidecar (IMM-SIDECARS). Live test `live_publish_renames_its_album`; version matrix (v3.0.0 and `release`) in `.github/workflows/immich.yml` via `cargo xtask immich up --version`. Rename happens on the next publish run, not at rename time | Phase 4 | -| IMM-SYNC | Two-way metadata sync (rating, favourite, title/description, tags ↔ keywords, albums as device-sync collections, GPS, time, archive) | P1 | ✅ | `cmd:immich.sync` `cmd:immich.syncStatus` `cmd:immich.syncConflicts` `cmd:immich.resolveConflict` `cmd:immich.setSync` `cmd:immich.resolveDeletion` `cmd:immich.collections`, `crates/immich/src/sync.rs`: field-wise three-way merge against the last synced values, per-field direction and policy (newest wins by default; GPS/date ask), keywords merged as sets (export-excluded never sent), conflicts kept with both values, deletions queued (never automatic, trash only), dry run, activity log, background interval with backoff, offline-safe (nothing changes, cursor kept). Albums ↔ collections (`crates/immich/src/albums.rs`): a per-server album rule (direction + policy, like the field rows): off = only albums linked by hand; to Immich / from Immich / two-way = every plain album maps to the Immich album of the same name with creates, renames, membership and album deletes (never photo deletes; deletes follow the policy, or wait for the user when the policy is ask or the other side changed too); published collections, smart albums and the Quick Collection stay out. Album and background metadata runs hold an activity row; Sync Now and the schedule run the album rule too. UI: Settings → Connections → Sync… (rules incl. albums, schedule, conflicts, deletion queues, one latest-run status line). Polls `updatedAfter` (not `/sync/stream`); scale (100k) untested | Phase 4 | +| IMM-SYNC | Two-way metadata sync (rating, favourite, title/description, tags ↔ keywords, albums as device-sync collections, GPS, time, archive) | P1 | ✅ | `cmd:immich.sync` `cmd:immich.syncStatus` `cmd:immich.syncConflicts` `cmd:immich.resolveConflict` `cmd:immich.setSync` `cmd:immich.resolveDeletion` `cmd:immich.collections`, `crates/immich/src/sync.rs`: field-wise three-way merge against the last synced values, per-field direction and policy (newest wins by default; GPS/date ask), keywords merged as sets (export-excluded never sent), conflicts kept with both values, deletions queued (never automatic, trash only), dry run, activity log, background interval with backoff, offline-safe (nothing changes, cursor kept). Albums ↔ collections (`crates/engine/src/cmd/immich_collections.rs`): a per-server album rule (direction + policy, like the field rows): off = only albums linked by hand; to Immich / from Immich / two-way = every plain album maps to the Immich album of the same name with creates, renames, membership and album deletes (never photo deletes; deletes follow the policy, or wait for the user when the policy is ask or the other side changed too); published collections, smart albums and the Quick Collection stay out. Album and background metadata runs hold an activity row; Sync Now and the schedule run the album rule too. UI: Settings → Connections → Sync… (rules incl. albums, schedule, conflicts, deletion queues, one latest-run status line). Polls `updatedAfter` (not `/sync/stream`); scale (100k) untested | Phase 4 | | IMM-PEOPLE | Import Immich people and face regions into People; push names back | P2 | ✅ | `cmd:immich.importPeople` `cmd:immich.confirmFaces` `cmd:immich.pushPeople`, `crates/immich/src/people.rs`: faces → face regions marked from Immich (`immich:`), hidden people skipped, overlapping regions kept, confirmed ones survive re-import; names back as renames, shared names as merges (opt-in). Birth dates are reported, not stored | Phase 4 | | IMM-SEARCH | Immich smart (CLIP) and metadata search from the Library filter bar | P2 | ✅ | `cmd:immich.smartSearch` (`mode: smart\|ocr\|description\|place`, `show` → temporary collection via the filter's photo list, `saveAs` → album); filter bar "Immich smart search" box (`crates/ui-egui/src/panels/connections.rs` `smart_search_box`, runs on a worker) | Phase 4 | | IMM-MCP | Immich commands available via CLI, control channel and MCP | P2 | ✅ | every Immich action is an `immich.*` command (`cmd:immich.sync`, `cmd:immich.smartSearch`, …), dispatched alike by UI, CLI, control channel and MCP | Phase 4 |