From 59ea469fb68182b1ab1c3135e88f2e4aca4efb20 Mon Sep 17 00:00:00 2001 From: maru Date: Thu, 9 May 2024 05:59:48 -0400 Subject: [PATCH] Don't import legacy saves if system exists in database --- db/db.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/db.go b/db/db.go index 31ad9a8..e84f031 100644 --- a/db/db.go +++ b/db/db.go @@ -73,6 +73,12 @@ func Init(username, password, protocol, address, database string) error { continue } + var count int + err = handle.QueryRow("SELECT COUNT(*) FROM systemSaveData WHERE uuid = ?", uuid).Scan(&count) + if err != nil || count != 0 { + continue + } + // store new system data systemData, err := LegacyReadSystemSaveData(uuid) if err != nil {