PM-Oberfläche: Favoriten/Navigator/Aufgaben, Tabs, PM-Filter, PM-Kacheln, IPTC-Layout wie PM, ⌘I Mass-Edit, ⌘U Upload, Code-Ersetzung live, 8 Farbklassen, paralleles + gecachtes Metadaten-Laden, BILDER/INPUT+SENT

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
Lichtkasten DevandClaude Opus 5.5 committed 2026-11-03 23:51:33 +00:00
1 parent d100249c12
commit c0ee93995f
18 files changed
+1311 -515

No files matched your search

@@ -29,21 +29,29 @@ public enum FileKind: String, Sendable, Codable {
public var supportsIIM: Bool { self == .jpeg || self == .tiff || self == .dng }
}
/// Photo Mechanic color classes 1–8 (keys 1–8). Classes 1–5 map to Lightroom's label colors.
public enum ColorLabel: String, CaseIterable, Codable, Sendable {
case red = "Red", yellow = "Yellow", green = "Green", blue = "Blue", purple = "Purple"
case cyan = "Cyan", orange = "Orange", gray = "Gray"
/// Value written to Lightroom's xmp:Label (LR default label set, German UI uses the same English keys
/// only if the label set is "Lightroom-Standard"; see README).
/// Value written to xmp:Label (Lightroom default label set understands Red…Purple).
public var xmpValue: String { rawValue }
/// Photo Mechanic color class number for compatibility.
/// Photo Mechanic color class number.
public var pmColorClass: Int { (ColorLabel.allCases.firstIndex(of: self) ?? 0) + 1 }
/// PM's default class names.
public var pmName: String {
["Winner", "Winner alt", "Superior", "Superior alt", "Typical", "Typical alt", "Extras", "Trash"][pmColorClass - 1]
}
public var germanName: String {
switch self {
case .red: return "Rot"
case .yellow: return "Gelb"
case .green: return "Grün"
case .blue: return "Blau"
case .purple: return "Lila"
case .purple: return "Magenta"
case .cyan: return "Cyan"
case .orange: return "Orange"
case .gray: return "Grau"
}
}
@@ -51,7 +59,8 @@ public enum ColorLabel: String, CaseIterable, Codable, Sendable {
let l = xmp.lowercased()
let map: [String: ColorLabel] = ["red": .red, "rot": .red, "yellow": .yellow, "gelb": .yellow,
"green": .green, "grün": .green, "blue": .blue, "blau": .blue,
"purple": .purple, "lila": .purple, "violett": .purple]
"purple": .purple, "lila": .purple, "violett": .purple, "magenta": .purple,
"cyan": .cyan, "orange": .orange, "gray": .gray, "grey": .gray, "grau": .gray]
guard let c = map[l] else { return nil }
self = c
}
@@ -132,8 +141,9 @@ public struct PhotoItem: Identifiable, Hashable, Sendable {
func xmp(_ tag: String) -> MetadataValue? { xmpSource[tag] ?? fileMeta[tag] }
rating = xmp("XMP-xmp:Rating")?.int ?? 0
label = xmp("XMP-xmp:Label").flatMap { ColorLabel(xmp: $0.string) }
?? xmp("XMP-photomech:ColorClass")?.int.flatMap { ColorLabel(pmColorClass: $0) }
// PM color class first (it knows all 8 classes), then Lightroom's label.
label = xmp("XMP-photomech:ColorClass")?.int.flatMap { ColorLabel(pmColorClass: $0) }
?? xmp("XMP-xmp:Label").flatMap { ColorLabel(xmp: $0.string) }
tagged = xmp("XMP-photomech:Tagged")?.bool ?? false
var values = IPTCValues()