Ingest: Laufnummer auch bei Abbruch oder Fehler speichern

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:11:44 +00:00
1 parent 1f63714b73
commit be6bd49da5
2 files changed
+11 -2

No files matched your search

@@ -142,6 +142,7 @@ public enum IngestService {
/// Copies the photos (and their XMP sidecars) from `sources` like PM's Ingest.
public static func run(sources: [URL], settings: IngestSettings, exiftool: ExifTool,
onFolder: (@Sendable (URL) -> Void)? = nil,
onSequence: (@Sendable (Int) -> Void)? = nil,
progress: @escaping @Sendable (IngestProgress) -> Void) async throws -> IngestResult {
let fm = FileManager.default
guard !settings.primaryDestination.isEmpty else { throw UploadError.failed("Kein Ziel für den Ingest gewählt.") }
@@ -194,7 +195,11 @@ public enum IngestService {
progress(IngestProgress(done: 0, total: total, currentFile: "Starte …"))
// also after a cancel/error: what was copied is not copied again next time
defer { if settings.incremental { saveHistory(history) } }
// also after a cancel/error the next number is handed back, so the next ingest continues there
defer {
if settings.incremental { saveHistory(history) }
if settings.sequenceEnabled { onSequence?(seq) }
}
for e in entries {
try Task.checkCancellation()
let item = e.item