Review-Korrekturen zu „Kartenimport, Metadaten und Versand absichern“

- Ingest-Verlauf wieder wie PM: Name + Größe + Datum, unabhängig von Ziel und Ordnermuster.
  Beim Sichten gelöschte Fotos kommen nicht zurück, neuer Spieltags-Ordner importiert keine alte Karte
  erneut, keine SHA-256-Prüfsumme mehr über die ganze Karte. Alter Verlauf (ingest-history.json) gilt wieder.
  Schutz vor Namenskollisionen, Rollback und Backup-Prüfung bleiben.
- FTP: „Vorhandene Datei auf dem Server ersetzen“ (wie PM, Standard an) – Korrekturen lassen sich erneut
  senden, kein Auflisten des Server-Ordners vor jeder Datei. Aus = Upload stoppt bei belegtem Namen.
- LR-Export: Pfadabgleich unabhängig von Unicode-Schreibweise (Umlaute), Groß/Klein und Symlinks
- Ordner-Scan: einzelne unlesbare oder verschwundene Dateien werden übersprungen statt alles abzubrechen
- Agentur-Check: Mindestgröße nur für die gelieferten Bilder, RAWs blockieren nicht; Senden nutzt die
  aktuellen Bilddaten
- Datum ohne Uhrzeit lässt IPTC TimeCreated stehen

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-05 08:46:36 +00:00
1 parent 427b6fa7b0
commit c9d43aba9c
11 files changed
+91 -129

No files matched your search

+2 -2
View File
@@ -413,9 +413,9 @@ final class BugfixTests: XCTestCase {
XCTAssertTrue(lib.sets.first?.enabled ?? false)
}
func testDateOnlyUpdateClearsIIMTimeCreated() {
func testDateOnlyUpdateKeepsIIMTimeCreated() {
let arguments = MetadataWriter.dateArguments("2026-11-03", writeIIM: true)
XCTAssertTrue(arguments.contains("-IPTC:TimeCreated="))
XCTAssertFalse(arguments.contains { $0.hasPrefix("-IPTC:TimeCreated") })
}
func testDateCreatedKeepsTimeOfDay() {
@@ -23,7 +23,7 @@ final class FTPUploaderTests: XCTestCase {
try script.write(to: curl, atomically: true, encoding: .utf8)
try FileManager.default.setAttributes([.posixPermissions: 0o700], ofItemAtPath: curl.path)
let uploader = FTPUploader(curlExecutable: curl.path)
let destination = FTPDestination(host: "example.test")
let destination = FTPDestination(host: "example.test", replaceExisting: false)
let photo = directory.appendingPathComponent("photo.jpg")
try Data([0]).write(to: photo)
@@ -54,41 +54,30 @@ final class IngestRecoveryTests: XCTestCase {
}
}
func testIncrementalRepairsMissingBackupAndPreservesEditedPrimary() async throws {
func testIncrementalSkipsPhotosDeletedWhileCulling() async throws {
let dirs = try fixture()
let src = try makePhoto(in: dirs.source)
_ = try makePhoto(in: dirs.source)
let history = dirs.root.appendingPathComponent("history.json")
let primary = dirs.primary.appendingPathComponent("photo-4.png")
let backup = dirs.backup.appendingPathComponent("photo-4.png")
_ = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history, sequence: 4)
let edited = Data("edited primary".utf8)
try edited.write(to: primary)
let copy = dirs.primary.appendingPathComponent("photo-4.png")
try FileManager.default.removeItem(at: copy) // reject deleted in INPUT
let complete = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history, sequence: 5)
XCTAssertEqual(complete.skipped, 1)
try FileManager.default.removeItem(at: backup)
_ = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history, sequence: 5)
XCTAssertEqual(try Data(contentsOf: primary), edited)
XCTAssertEqual(try Data(contentsOf: backup), try Data(contentsOf: src))
let again = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history, sequence: 5)
XCTAssertEqual(again.skipped, 1)
XCTAssertTrue(again.copied.isEmpty)
XCTAssertFalse(FileManager.default.fileExists(atPath: copy.path))
XCTAssertFalse(FileManager.default.fileExists(atPath: dirs.primary.appendingPathComponent("photo-5.png").path))
}
func testIncrementalDoesNotAcceptReplacedBackup() async throws {
func testIncrementalIgnoresChangedFolderPattern() async throws {
let dirs = try fixture()
let src = try makePhoto(in: dirs.source)
_ = try makePhoto(in: dirs.source)
let history = dirs.root.appendingPathComponent("history.json")
_ = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history, sequence: 4)
let previousBackup = dirs.backup.appendingPathComponent("photo-4.png")
let unrelated = Data(repeating: 1, count: try Data(contentsOf: src).count)
try unrelated.write(to: previousBackup)
_ = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history, sequence: 5)
XCTAssertEqual(try Data(contentsOf: previousBackup), unrelated)
for dir in [dirs.primary, dirs.backup] {
XCTAssertEqual(try Data(contentsOf: dir.appendingPathComponent("photo-4-1.png")), try Data(contentsOf: src))
}
_ = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history)
let next = try await ingest(source: dirs.source, primary: dirs.primary, backup: dirs.backup, history: history,
folderPattern: "Spieltag 2")
XCTAssertEqual(next.skipped, 1)
XCTAssertTrue(next.copied.isEmpty)
}
private func makePhoto(in source: URL) throws -> URL {
@@ -99,14 +88,15 @@ final class IngestRecoveryTests: XCTestCase {
}
@discardableResult
private func ingest(source: URL, primary: URL, backup: URL, history: URL? = nil, sequence: Int? = nil) async throws -> IngestResult {
private func ingest(source: URL, primary: URL, backup: URL, history: URL? = nil, sequence: Int? = nil,
folderPattern: String = "") async throws -> IngestResult {
guard let exe = ExifTool.locate() else { throw XCTSkip("ExifTool fehlt") }
var settings = IngestSettings()
settings.primaryDestination = primary.path
settings.backupDestination = backup.path
settings.secondaryEnabled = true
settings.incremental = history != nil
settings.folderPattern = ""
settings.folderPattern = folderPattern
if let sequence {
settings.startSequence = sequence
settings.renamePattern = "photo-{seqn}"