Fix missing datetime variables for baseball live games

- Added back day_text, date_text, and time_text variables for baseball live games
- These variables are needed for the datetime display section
- Shows inning (▲5), count (2-1), and outs (2 outs) in the datetime column
- Fixes the 'cannot access local variable' error that was occurring
This commit is contained in:
ChuckBuilds
2025-08-18 21:01:39 -05:00
parent b252229e03
commit 2c2d24c0a8

View File

@@ -888,6 +888,17 @@ class OddsTickerManager:
# Store bases data for later drawing # Store bases data for later drawing
self._bases_data = live_info.get('bases_occupied', [False, False, False]) self._bases_data = live_info.get('bases_occupied', [False, False, False])
# Set datetime text for baseball live games
inning_half_indicator = "" if live_info.get('inning_half') == 'top' else ""
inning_text = f"{inning_half_indicator}{live_info.get('inning', 1)}"
count_text = f"{live_info.get('balls', 0)}-{live_info.get('strikes', 0)}"
outs_count = live_info.get('outs', 0)
outs_text = f"{outs_count} out" if outs_count == 1 else f"{outs_count} outs"
day_text = inning_text
date_text = count_text
time_text = outs_text
elif sport == 'football': elif sport == 'football':
# Football: Show quarter and down/distance # Football: Show quarter and down/distance
quarter_text = f"Q{live_info.get('quarter', 1)}" quarter_text = f"Q{live_info.get('quarter', 1)}"