fix searching for an arcade by serial

This commit is contained in:
Hay1tsme 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: else:
status = 'Active' status = 'Active'
idm = c['idm'] #idm = c['idm']
ac = c['access_code'] 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" c_type = "AmusementIC"
elif ac.startswith("3"): elif ac.startswith("3"):
c_type = "Banapass" c_type = "Banapass"
@ -441,10 +441,19 @@ class FE_User(FE_Base):
desc, _ = self.data.card.get_aime_ac_key_desc(ac) desc, _ = self.data.card.get_aime_ac_key_desc(ac)
if desc is not None: if desc is not None:
c_type = desc c_type = desc
elif ac.startswith("0008"):
c_type = "Generated AIC"
else: else:
c_type = "Unknown" 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: if "e" in request.query_params:
try: try:
@ -602,8 +611,8 @@ class FE_System(FE_Base):
sinfo = None sinfo = None
if sinfo: if sinfo:
shoplist.append({ shoplist.append({
"name": sinfo.name, "name": sinfo['name'],
"id": sinfo.allnet_id "id": sinfo['id']
}) })
else: else:
@ -624,7 +633,7 @@ class FE_System(FE_Base):
netid_prefix = self.environment.globals["sn_cvt"].get(prefix, "") netid_prefix = self.environment.globals["sn_cvt"].get(prefix, "")
sn_search = netid_prefix + suffix 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) cabinfo = await self.data.arcade.get_machine(sn_search)
if cabinfo is None: sinfo = None if cabinfo is None: sinfo = None
else: else:

View File

@ -39,7 +39,7 @@
OR OR
<div class="form-group"> <div class="form-group">
<label for="serialNum">Serial Number</label> <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> </div>
<br /> <br />
<button type="submit" class="btn btn-primary">Search</button> <button type="submit" class="btn btn-primary">Search</button>