Fix classifier version for new caps

This commit is contained in:
Christoph Hagen 2023-03-20 11:06:59 +01:00
parent e7a54ec8ec
commit 289e927c6a

View File

@ -71,10 +71,6 @@ final class CapServer {
}
}
var nextClassifierVersion: Int {
caps.values.compactMap { $0.classifierVersion }.max() ?? 1
}
var capCount: Int {
caps.count
}
@ -469,7 +465,7 @@ final class CapServer {
}
var cap = cap
cap.count = 0
cap.classifierVersion = nextClassifierVersion
cap.classifierVersion = nil
caps[cap.id] = cap
saveCapCountHTML()
updateGridCapCount()
@ -547,6 +543,7 @@ final class CapServer {
.compactMap(Int.init)
let version = classifierVersion
for cap in trainedCaps {
// Set current classifier
if caps[cap]?.classifierVersion == nil {
caps[cap]?.classifierVersion = version
}