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)
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user