Fix: Absturz beim Entfernen von Teams (Bindings per ID); Matchday nur per Schalter (Einstellungen, Bild-Menü ⌘⌥M, Trikot-Erkennung); Ereignis/Datum vom aktuellen Bild; 'Spieler:innen'
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012bGzgsxrmbBhDzeMV2L57D
This commit is contained in:
1 parent
cea5decdb6
commit
2989e51553
7 files changed
+60
-23
No files matched your search
@@ -1199,13 +1199,17 @@ final class AppState: ObservableObject {
|
||||
return map.values.sorted { ($0.count, $1.name) > ($1.count, $0.name) }
|
||||
}
|
||||
|
||||
/// Event and date for the Matchday header (most common IPTC event in the folder).
|
||||
/// Event and date for the Matchday header: those of the current image (SENT holds several games),
|
||||
/// else the most common event in the folder.
|
||||
var matchdayEvent: (event: String, date: String) {
|
||||
let f = DateFormatter(); f.dateFormat = "dd.MM.yyyy"
|
||||
if let c = cursorItem, let e = c.iptc.text["event"], !e.isEmpty {
|
||||
return (e, c.captureDate.map { f.string(from: $0) } ?? "")
|
||||
}
|
||||
var counts: [String: Int] = [:]
|
||||
for i in items { if let e = i.iptc.text["event"], !e.isEmpty { counts[e, default: 0] += 1 } }
|
||||
let event = counts.max { $0.value < $1.value }?.key ?? (folder?.lastPathComponent ?? "")
|
||||
let f = DateFormatter(); f.dateFormat = "dd.MM.yyyy"
|
||||
let date = items.compactMap(\.captureDate).min().map { f.string(from: $0) } ?? ""
|
||||
let date = (cursorItem?.captureDate ?? items.compactMap(\.captureDate).min()).map { f.string(from: $0) } ?? ""
|
||||
return (event, date)
|
||||
}
|
||||
|
||||
|
||||
@@ -67,14 +67,19 @@ struct LightroomSettings: Codable, Hashable {
|
||||
|
||||
/// Jersey number recognition settings (teams of the current match).
|
||||
struct JerseySettings: Codable, Hashable {
|
||||
enum CodingKeys: String, CodingKey {
|
||||
case teams, useShirt, useShorts, minConfidence, autoAfterIngest, separator
|
||||
case matchday = "matchdayEnabled" // new key: the old default (on) is not carried over
|
||||
}
|
||||
|
||||
var teams: [JerseyTeam] = []
|
||||
var useShirt = true
|
||||
var useShorts = true
|
||||
var minConfidence = 0.35
|
||||
var autoAfterIngest = false
|
||||
var separator = ", "
|
||||
/// Matchday view (team header, player list, team-colored cards) when two teams are set up
|
||||
var matchday = true
|
||||
/// Matchday view (team header, player list, team-colored cards) – opt-in, needs two teams
|
||||
var matchday = false
|
||||
|
||||
init() {}
|
||||
init(from decoder: Decoder) throws {
|
||||
|
||||
Reference in new issue
Block a user