This commit is contained in:
恍兮惚兮 2024-08-03 16:49:55 +08:00
parent e04c89262a
commit 084a322de9
3 changed files with 2 additions and 25 deletions

View File

@ -33,7 +33,6 @@ from myutils.utils import (
checkpostlangmatch,
loadpostsettingwindowmethod_private,
titlechangedtask,
idtypecheck,
selectdebugfile,
targetmod,
loopbackrecorder,
@ -778,17 +777,13 @@ class dialog_setting_game_internal(QWidget):
idname = targetmod[key].idname
vndbid = QLineEdit()
if globalconfig["metadata"][key].get("idtype", 1) == 0:
vndbid.setValidator(QIntValidator())
vndbid.setText(str(savehook_new_data[gameuid].get(idname, "0")))
else:
vndbid.setText(str(savehook_new_data[gameuid].get(idname, "")))
vndbid.setText(str(savehook_new_data[gameuid].get(idname, "")))
vndbid.setSizePolicy(
QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed
)
vndbid.textEdited.connect(
functools.partial(idtypecheck, key, idname, gameuid)
functools.partial(savehook_new_data[gameuid].__setitem__, idname)
)
vndbid.returnPressed.connect(
functools.partial(gamdidchangedtask, key, idname, gameuid)

View File

@ -232,22 +232,6 @@ def trysearchforid(gameuid, searchargs: list):
threading.Thread(target=trysearchforid_1, args=(gameuid, searchargs)).start()
def idtypecheck(key, idname, gameuid, vid):
if vid == "":
return
try:
if globalconfig["metadata"][key].get("idtype", 1) == 0:
try:
vid = int(vid)
except:
print(vid)
return
savehook_new_data[gameuid][idname] = vid
except:
print_exc()
def gamdidchangedtask(key, idname, gameuid):
vid = savehook_new_data[gameuid][idname]
dispatchsearchfordata(gameuid, key, vid)

View File

@ -242,7 +242,6 @@
"searchfordatatasks": [],
"useproxy": false,
"target": "vid",
"idtype": 0,
"args": {
"Token": ""
}
@ -262,7 +261,6 @@
"searchfordatatasks": [],
"useproxy": true,
"target": "bgmsid",
"idtype": 0,
"args": {
"access-token": ""
}