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:
1 parent
427b6fa7b0
commit
c9d43aba9c
11 files changed
+91
-129
No files matched your search
@@ -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}"
|
||||
|
||||
Reference in new issue
Block a user