1
0
mirror of synced 2024-11-27 23:40:48 +01:00

fix searching for an arcade by serial

This commit is contained in:
Kevin Trocolli 2024-01-09 19:45:39 -05:00
parent 805b8f5b3e
commit d672edb266
2 changed files with 16 additions and 7 deletions

View File

@ -429,10 +429,10 @@ class FE_User(FE_Base):
else:
status = 'Active'
idm = c['idm']
#idm = c['idm']
ac = c['access_code']
if ac.startswith("5") or idm is not None:
if ac.startswith("5"): #or idm is not None:
c_type = "AmusementIC"
elif ac.startswith("3"):
c_type = "Banapass"
@ -441,10 +441,19 @@ class FE_User(FE_Base):
desc, _ = self.data.card.get_aime_ac_key_desc(ac)
if desc is not None:
c_type = desc
elif ac.startswith("0008"):
c_type = "Generated AIC"
else:
c_type = "Unknown"
card_data.append({'access_code': ac, 'status': status, 'chip_id': None if c['chip_id'] is None else f"{c['chip_id']:X}", 'idm': idm, 'type': c_type, "memo": ""})
card_data.append({
'access_code': ac,
'status': status,
'chip_id': "", #None if c['chip_id'] is None else f"{c['chip_id']:X}",
'idm': "",
'type': c_type,
"memo": ""
})
if "e" in request.query_params:
try:
@ -602,8 +611,8 @@ class FE_System(FE_Base):
sinfo = None
if sinfo:
shoplist.append({
"name": sinfo.name,
"id": sinfo.allnet_id
"name": sinfo['name'],
"id": sinfo['id']
})
else:
@ -624,7 +633,7 @@ class FE_System(FE_Base):
netid_prefix = self.environment.globals["sn_cvt"].get(prefix, "")
sn_search = netid_prefix + suffix
if re.match("^AB[D|G|L]N\d{7}$", sn_search):
if re.match(r"^AB[DGL]N\d{7}$", sn_search) or re.match(r"^A\d{2}[EX]\d{2}[A-Z]\d{4,8}$", sn_search):
cabinfo = await self.data.arcade.get_machine(sn_search)
if cabinfo is None: sinfo = None
else:

View File

@ -39,7 +39,7 @@
OR
<div class="form-group">
<label for="serialNum">Serial Number</label>
<input type="text" class="form-control" id="serialNum" name="serialNum" maxlength="12">
<input type="text" class="form-control" id="serialNum" name="serialNum" maxlength="15">
</div>
<br />
<button type="submit" class="btn btn-primary">Search</button>