From a02cdb5cce72c2f982a2693eeb7f65c99369028c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Mon, 16 Sep 2024 20:19:18 +0800 Subject: [PATCH] fix --- LunaTranslator/LunaTranslator/gui/showword.py | 12 ++++++------ .../LunaTranslator/myutils/traceplaytime.py | 2 ++ plugins/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/LunaTranslator/LunaTranslator/gui/showword.py b/LunaTranslator/LunaTranslator/gui/showword.py index 4e7f9069..a3685ca8 100644 --- a/LunaTranslator/LunaTranslator/gui/showword.py +++ b/LunaTranslator/LunaTranslator/gui/showword.py @@ -300,15 +300,15 @@ class AnkiWindow(QWidget): model_htmlback = self.backtext.toPlainText() model_css = self.csstext.toPlainText() with open( - gobject.getuserconfigdir("anki/back.html"), "w", encoding="utf8" + gobject.getuserconfigdir("anki_2/back.html"), "w", encoding="utf8" ) as ff: ff.write(model_htmlback) with open( - gobject.getuserconfigdir("anki/front.html"), "w", encoding="utf8" + gobject.getuserconfigdir("anki_2/front.html"), "w", encoding="utf8" ) as ff: ff.write(model_htmlfront) with open( - gobject.getuserconfigdir("anki/style.css"), "w", encoding="utf8" + gobject.getuserconfigdir("anki_2/style.css"), "w", encoding="utf8" ) as ff: ff.write(model_css) @@ -637,11 +637,11 @@ class AnkiWindow(QWidget): def tryloadankitemplates(self): try: - with open("userconfig/anki/back.html", "r", encoding="utf8") as ff: + with open("userconfig/anki_2/back.html", "r", encoding="utf8") as ff: model_htmlback = ff.read() - with open("userconfig/anki/front.html", "r", encoding="utf8") as ff: + with open("userconfig/anki_2/front.html", "r", encoding="utf8") as ff: model_htmlfront = ff.read() - with open("userconfig/anki/style.css", "r", encoding="utf8") as ff: + with open("userconfig/anki_2/style.css", "r", encoding="utf8") as ff: model_css = ff.read() except: with open("files/anki/back.html", "r", encoding="utf8") as ff: diff --git a/LunaTranslator/LunaTranslator/myutils/traceplaytime.py b/LunaTranslator/LunaTranslator/myutils/traceplaytime.py index f06cb9a6..cde05f50 100644 --- a/LunaTranslator/LunaTranslator/myutils/traceplaytime.py +++ b/LunaTranslator/LunaTranslator/myutils/traceplaytime.py @@ -62,6 +62,7 @@ class playtimemanager: self.sqlsavegameinfo.execute( "INSERT INTO gameinternalid_v2 VALUES(NULL,?)", (gameuid,) ) + self.sqlsavegameinfo.commit() else: return ret[0] @@ -78,6 +79,7 @@ class playtimemanager: "UPDATE traceplaytime_v4 SET timestop = ? WHERE (gameinternalid = ? and timestart = ?)", (end, gameinternalid, start), ) + self.sqlsavegameinfo.commit() def checkgameplayingthread(self): self.__currentexe = None diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index 3b911987..c4bddf51 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -29,7 +29,7 @@ include(generate_product_version) set(VERSION_MAJOR 5) set(VERSION_MINOR 36) -set(VERSION_PATCH 3) +set(VERSION_PATCH 4) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)