fix reversed A/C chair mapping and update hot/cold on round end

CHAIRS mapping was {1:A, 2:B, 3:C} but the API's country field has
1=C and 3=A. Fixed the mapping in backend and both frontends, added a
startup migration to swap A↔C columns in existing DB data, corrected
multiIf SQL queries that hardcoded the wrong winner→column mapping,
and moved _save_round() to the ENDED status block so hot/cold stats
reflect the latest round immediately.
This commit is contained in:
2026-02-25 20:49:16 +05:00
parent 3016f33783
commit e65b6b2cfb
6 changed files with 39 additions and 6 deletions

View File

@@ -12,6 +12,7 @@ import signal
from .server import WebServer
from .streamkar_ws import StreamKarWSClient
from .game_poller import GamePoller
from . import db
logging.basicConfig(
level=logging.INFO,
@@ -39,6 +40,7 @@ async def main():
loop.add_signal_handler(sig, shutdown)
log.info("Starting Teen Patti Live Monitor")
await loop.run_in_executor(None, db.run_migrations)
log.info("Dashboard: http://localhost:8765")
tasks = [