diff --git a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py index b533b94e..50487de0 100644 --- a/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py +++ b/LunaTranslator/LunaTranslator/gui/dialog_savedgame.py @@ -716,30 +716,33 @@ class dialog_setting_game_internal(QWidget): ), ) for key in globalconfig["metadata"]: - idname = globalconfig["metadata"][key]["target"] - vndbid = QLineEdit(str(savehook_new_data[gameuid][idname])) - if globalconfig["metadata"][key].get("idtype", 1) == 0: - vndbid.setValidator(QIntValidator()) - vndbid.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed) - - vndbid.textEdited.connect( - functools.partial(idtypecheck, key, idname, gameuid) - ) - vndbid.returnPressed.connect( - functools.partial(gamdidchangedtask, key, idname, gameuid) - ) - _vbox_internal = [ - vndbid, - getIconButton( - functools.partial(self.openrefmainpage, key, idname, gameuid), - icon="fa.chrome", - ), - getIconButton( - functools.partial(gamdidchangedtask, key, idname, gameuid), - icon="fa.search", - ), - ] + try: + idname = globalconfig["metadata"][key]["target"] + vndbid = QLineEdit(str(savehook_new_data[gameuid][idname])) + if globalconfig["metadata"][key].get("idtype", 1) == 0: + vndbid.setValidator(QIntValidator()) + vndbid.setSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed) + vndbid.textEdited.connect( + functools.partial(idtypecheck, key, idname, gameuid) + ) + vndbid.returnPressed.connect( + functools.partial(gamdidchangedtask, key, idname, gameuid) + ) + _vbox_internal = [ + vndbid, + getIconButton( + functools.partial(self.openrefmainpage, key, idname, gameuid), + icon="fa.chrome", + ), + getIconButton( + functools.partial(gamdidchangedtask, key, idname, gameuid), + icon="fa.search", + ), + ] + except: + print_exc() + continue try: __settting = targetmod[key].querysettingwindow _vbox_internal.insert( diff --git a/LunaTranslator/LunaTranslator/myutils/utils.py b/LunaTranslator/LunaTranslator/myutils/utils.py index fa975f37..915e748f 100644 --- a/LunaTranslator/LunaTranslator/myutils/utils.py +++ b/LunaTranslator/LunaTranslator/myutils/utils.py @@ -140,7 +140,7 @@ def guessmaybetitle(gamepath, title): os.path.basename(os.path.dirname(gamepath)), os.path.basename(gamepath)[:-4], ]: - if not title: + if not _: continue _ = _.replace("(同人ゲーム)", "").replace("(18禁ゲーム)", "") _ = re.sub(r"\[RJ(.*?)\]", "", _) @@ -160,6 +160,7 @@ def guessmaybetitle(gamepath, title): if (len(t) < 10) and (all(ord(c) < 128 for c in t)): continue lst.append(t) + print(lst) return lst @@ -178,7 +179,11 @@ def trysearchforid(gameuid, searchargs: list): for key in __: vid = None for arg in searchargs: - vid = targetmod[key].getidbytitle(arg) + try: + vid = targetmod[key].getidbytitle(arg) + except: + print_exc() + continue if vid: break if not vid: diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index ddc83a37..9c8fda08 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -28,8 +28,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/version) include(generate_product_version) set(VERSION_MAJOR 5) -set(VERSION_MINOR 3) -set(VERSION_PATCH 3) +set(VERSION_MINOR 5) +set(VERSION_PATCH 0) add_library(pch pch.cpp) target_precompile_headers(pch PUBLIC pch.h)