diff --git a/core/frontend.py b/core/frontend.py index caf5c74..17b058f 100644 --- a/core/frontend.py +++ b/core/frontend.py @@ -677,24 +677,30 @@ class FE_Arcade(FE_Base): sesh=vars(usr_sesh), )) - try: - sinfo = await self.data.arcade.get_arcade(shop_id) - except Exception as e: - self.logger.error(f"Failed to fetch shop info for shop {shop_id} in render_GET - {e}") - sinfo = None + sinfo = await self.data.arcade.get_arcade(shop_id) if not sinfo: return Response(template.render( title=f"{self.core_config.server.name} | Arcade", sesh=vars(usr_sesh), )) + cabs = await self.data.arcade.get_arcade_machines(shop_id) + cablst = [] + if cabs: + for x in cabs: + cablst.append({ + "id": x['id'], + "serial": x['serial'], + "game": x['game'], + }) + return Response(template.render( title=f"{self.core_config.server.name} | Arcade", sesh=vars(usr_sesh), arcade={ "name": sinfo['name'], "id": sinfo['id'], - "cabs": [] + "cabs": cablst } )) diff --git a/core/templates/arcade/index.jinja b/core/templates/arcade/index.jinja index 627f203..1de4301 100644 --- a/core/templates/arcade/index.jinja +++ b/core/templates/arcade/index.jinja @@ -1,4 +1,19 @@ {% extends "core/templates/index.jinja" %} {% block content %} +{% if arcade is defined %}