Compare commits

...

2 Commits

Author SHA1 Message Date
Christoph Hagen
f3ee7a4fb4 Create folders for images 2023-01-17 15:09:03 +01:00
Christoph Hagen
026336f24d Don't attempt to fetch missing images in changed list 2023-01-17 15:08:44 +01:00

View File

@ -144,6 +144,7 @@ final class ClassifierCreator {
return nil
}
let changedImageList = await getChangedImageList()
.filter { $0.image < imageCounts[$0.cap] ?? 0 } // Filter non-existent images
if changedImageList.isEmpty {
print("[INFO] No changed images to load")
@ -180,6 +181,9 @@ final class ClassifierCreator {
}
private func loadImage(cap: Int, image: Int) async -> Bool {
guard createFolderIfMissing(imageDirectory.appendingPathComponent(String(format: "%04d", cap))) else {
return false
}
let url = imageUrl(base: server.appendingPathComponent("images"), cap: cap, image: image)
let tempFile: URL, response: URLResponse
do {