Add Live Queue slide to kiosk rotation

- Added a third kiosk slide showing the active customer queue.
- Customer names are derived from the local-part of their email address.
- Statuses are mapped to friendly labels:
    pending -> Received
    prompt_ready / songs_uploaded -> Trollgorithm Recording in Studio
    revisions_requested -> Waiting for Customer Response
    awaiting_payment -> Payment Due
- Completed/delivered statuses are not shown.
- If the queue overflows, a note points customers to the status page.
- Added queue-only mode (kiosk_cycle_seconds = 1) and updated the
  cycle logic to rotate QR -> pricing -> queue.
- Updated /admin/settings help text for the new mode.

Bumps version to 0.5.3.
This commit is contained in:
Troll (Hermes Agent) 2026-08-05 20:27:33 +00:00
parent 96b6470c25
commit 52558010e8
5 changed files with 129 additions and 19 deletions

30
app.py
View file

@ -350,7 +350,10 @@ def get_kiosk_cycle_seconds():
def get_kiosk_mode():
"""Return 'cycle', 'qr', or 'prices' based on kiosk_cycle_seconds setting."""
"""
Return 'qr', 'prices', 'queue', or 'cycle' based on kiosk_cycle_seconds setting.
-1 = QR only, 0 = prices only, 1 = queue only, 5+ = cycle through all three.
"""
cfg = load_booth_settings()
try:
val = int(cfg.get('kiosk_cycle_seconds', 10))
@ -360,6 +363,8 @@ def get_kiosk_mode():
return 'qr'
if val == 0:
return 'prices'
if val == 1:
return 'queue'
return 'cycle'
@ -1017,12 +1022,35 @@ def kiosk():
mode = get_kiosk_mode()
booth_open = get_booth_open()
# Build the public queue: only active statuses, mapped to friendly names,
# using the local-part of the email as the customer name.
KIOSK_STATUS_MAP = {
'pending': 'Received',
'prompt_ready': 'Trollgorithm Recording in Studio',
'songs_uploaded': 'Trollgorithm Recording in Studio',
'revisions_requested': 'Waiting for Customer Response',
'awaiting_payment': 'Payment Due',
}
active_statuses = set(KIOSK_STATUS_MAP.keys())
raw_queue = list_requests()
queue = []
for r in raw_queue:
if r.get('status') in active_statuses:
email = r.get('email') or ''
name = email.split('@')[0] if '@' in email else email
queue.append({
'name': name or 'Guest',
'status': KIOSK_STATUS_MAP[r['status']],
'raw_status': r['status'],
})
return render_template(
'kiosk.html',
booth_open=booth_open,
price_items=price_items,
cycle_seconds=cycle_seconds,
mode=mode,
queue=queue,
refresh_seconds=30
)