logger.info(f"DEBUG _update_bet_results: Set match.winning_outcomes to {winning_outcome_names}")
else:
match.winning_outcomes=None
logger.info(f"DEBUG _update_bet_results: No winning outcomes, set match.winning_outcomes to None")
# Set under_over_result in separate field
ifunder_over_outcome:
match.under_over_result=under_over_outcome
logger.info(f"DEBUG _update_bet_results: Set match.under_over_result to '{under_over_outcome}'")
else:
match.under_over_result=None
logger.info(f"DEBUG _update_bet_results: No UNDER/OVER result, set match.under_over_result to None")
logger.info(f"Updated match {match_id} with result='{selected_result}', winning_outcomes={winning_outcome_names}, under_over_result='{under_over_outcome}'")
else:
logger.error(f"DEBUG _update_bet_results: Match {match_id} not found for result update!")
...
...
@@ -2739,6 +2919,10 @@ class GamesThread(ThreadedComponent):
def_determine_game_status(self)->str:
"""Determine the current game status for status requests"""
try:
# If waiting for validation, return waiting status
ifself.waiting_for_validation_fixture:
return"waiting_for_downloads"
# If a game is currently active, return "started"
ifself.game_activeandself.current_fixture_id:
return"started"
...
...
@@ -2954,9 +3138,24 @@ class GamesThread(ThreadedComponent):
result=Column(String(255),comment='Match result/outcome (main result only, e.g. RET2)')
winning_outcomes=Column(JSON,comment='Array of winning outcomes from extraction associations (e.g., ["WIN1", "X1", "12"])')
under_over_result=Column(String(50),comment='UNDER/OVER result if applicable')
done=Column(Boolean,default=False,nullable=False,comment='Match completion flag (0=pending, 1=done)')
running=Column(Boolean,default=False,nullable=False,comment='Match running flag (0=not running, 1=running)')
status=Column(Enum('pending','scheduled','bet','ingame','done','cancelled','failed','paused'),default='pending',nullable=False,comment='Match status enum')