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, checkpostlangmatch,
loadpostsettingwindowmethod_private, loadpostsettingwindowmethod_private,
titlechangedtask, titlechangedtask,
idtypecheck,
selectdebugfile, selectdebugfile,
targetmod, targetmod,
loopbackrecorder, loopbackrecorder,
@ -778,17 +777,13 @@ class dialog_setting_game_internal(QWidget):
idname = targetmod[key].idname idname = targetmod[key].idname
vndbid = QLineEdit() vndbid = QLineEdit()
if globalconfig["metadata"][key].get("idtype", 1) == 0: vndbid.setText(str(savehook_new_data[gameuid].get(idname, "")))
vndbid.setValidator(QIntValidator())
vndbid.setText(str(savehook_new_data[gameuid].get(idname, "0")))
else:
vndbid.setText(str(savehook_new_data[gameuid].get(idname, "")))
vndbid.setSizePolicy( vndbid.setSizePolicy(
QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed
) )
vndbid.textEdited.connect( vndbid.textEdited.connect(
functools.partial(idtypecheck, key, idname, gameuid) functools.partial(savehook_new_data[gameuid].__setitem__, idname)
) )
vndbid.returnPressed.connect( vndbid.returnPressed.connect(
functools.partial(gamdidchangedtask, key, idname, gameuid) 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() 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): def gamdidchangedtask(key, idname, gameuid):
vid = savehook_new_data[gameuid][idname] vid = savehook_new_data[gameuid][idname]
dispatchsearchfordata(gameuid, key, vid) dispatchsearchfordata(gameuid, key, vid)

View File

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