Fix match result display: use actual fight winner instead of UNDER/OVER as main result

parent afd67412
...@@ -3296,7 +3296,24 @@ class GamesThread(ThreadedComponent): ...@@ -3296,7 +3296,24 @@ class GamesThread(ThreadedComponent):
winning_outcome_names = extraction_winning_outcome_names winning_outcome_names = extraction_winning_outcome_names
logger.info(f"DEBUG _update_bet_results: Using pre-filtered winning outcomes: {winning_outcome_names}") logger.info(f"DEBUG _update_bet_results: Using pre-filtered winning outcomes: {winning_outcome_names}")
# Set the main result (selected_result) # Set the main result
# If selected_result is UNDER/OVER, use the first winning outcome as the main result
# (the actual fight winner like WIN1, X, WIN2)
if selected_result in ['UNDER', 'OVER'] and extraction_winning_outcome_names:
# Find the first non-UNDER/OVER winning outcome as the main result
main_result = None
for outcome in extraction_winning_outcome_names:
if outcome not in ['UNDER', 'OVER']:
main_result = outcome
break
if main_result:
match.result = main_result
logger.info(f"DEBUG _update_bet_results: selected_result is UNDER/OVER, set match.result to '{main_result}' from winning outcomes")
else:
# If no non-UNDER/OVER outcome found, use selected_result
match.result = selected_result
logger.info(f"DEBUG _update_bet_results: No non-UNDER/OVER winning outcome found, set match.result to '{selected_result}'")
else:
match.result = selected_result match.result = selected_result
logger.info(f"DEBUG _update_bet_results: Set match.result to '{selected_result}'") logger.info(f"DEBUG _update_bet_results: Set match.result to '{selected_result}'")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment