Keep colour labels in the sidecar so they survive and travel
A rating and a flag are written to DarkRoom's sidecar as well as the catalog, because the catalog is a disposable index and the sidecar is how a judgement reaches the photographer's other devices. A label had no place there, so once labels could be set, one would have lived only in the catalog of the device it was set on and gone with it. The sidecar version now carries `label` (0 none, 1-5 as the catalog codes it), written only when set. It merges under the rating's rule, so a device that never labelled a frame cannot clear another device's label, and a code this build does not know reads as none rather than as some other colour. A judgement write carries the catalog's label with the stars, and the scan takes a sidecar's label into the catalog when it has one. An older build keeps the line as an unknown key and writes it back.
This commit is contained in:
@@ -492,7 +492,7 @@ fn collect_sidecar_writes(
|
||||
.collect::<Vec<_>>()
|
||||
.join(",");
|
||||
let sql = format!(
|
||||
"SELECT i.source_ref, v.uuid, v.rating, v.flag
|
||||
"SELECT i.source_ref, v.uuid, v.rating, v.flag, coalesce(v.label, 0)
|
||||
FROM images i
|
||||
JOIN versions v ON v.image_id = i.id AND v.is_default = 1
|
||||
WHERE i.id IN ({placeholders})"
|
||||
@@ -512,6 +512,7 @@ fn collect_sidecar_writes(
|
||||
amendment: library::Amendment::Judgement {
|
||||
rating: r.get::<_, i64>(2)? as u8,
|
||||
flag: r.get::<_, i64>(3)? as u8,
|
||||
label: r.get::<_, i64>(4)?.clamp(0, 5) as u8,
|
||||
},
|
||||
})
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user