From 289e927c6aae1ffbdd7c7b07aa154c2d38da00be Mon Sep 17 00:00:00 2001 From: Christoph Hagen Date: Mon, 20 Mar 2023 11:06:59 +0100 Subject: [PATCH] Fix classifier version for new caps --- Sources/App/CapServer.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Sources/App/CapServer.swift b/Sources/App/CapServer.swift index 25b1844..92f2b8d 100644 --- a/Sources/App/CapServer.swift +++ b/Sources/App/CapServer.swift @@ -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 }