fix(live-state): cast poll_seconds to int for HTMX hx-trigger

HTMX's hx-trigger="every Ns" syntax does not accept fractional seconds —
a config override like 7.5 would render every 7.5s and silently break
auto-refresh. Floor to int with a 1s minimum.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mwiegand 2026-05-12 22:23:15 +02:00
parent 9aaa26d9a9
commit 37a9ad68a2
No known key found for this signature in database

View file

@ -269,5 +269,5 @@ def live_state_fragment(server_id: int) -> Response:
current_players=current_rows, current_players=current_rows,
recent_players=recent_rows, recent_players=recent_rows,
now=datetime.now(UTC).replace(tzinfo=None), now=datetime.now(UTC).replace(tzinfo=None),
poll_seconds=current_app.config.get("LIVE_STATE_POLL_SECONDS", 5), poll_seconds=max(1, int(current_app.config.get("LIVE_STATE_POLL_SECONDS", 5))),
) )