diff --git a/Sources/App/CapServer.swift b/Sources/App/CapServer.swift index 23e6307..14c261f 100644 --- a/Sources/App/CapServer.swift +++ b/Sources/App/CapServer.swift @@ -235,12 +235,20 @@ final class CapServer { log("Failed to get image urls for cap \(cap.id)") return } + + if images.count != cap.count { + log("\(images.count) instead of \(cap.count) images for cap \(cap.id)") + } + + // Get list of existing images var sorted: [(id: Int, url: URL)] = images.compactMap { guard let id = Int($0.deletingPathExtension().lastPathComponent.components(separatedBy: "-").last!) else { return nil } return (id, $0) }.sorted { $0.id < $1.id } + + // Check that all images are available for version in 0..