Fix inning extraction to use status period instead of linescore

This commit is contained in:
ChuckBuilds
2025-04-27 15:36:36 -05:00
parent 98cd3d8843
commit 116b7785bc

View File

@@ -301,8 +301,7 @@ class BaseMLBManager:
# Get game state information # Get game state information
if status_state == 'in': if status_state == 'in':
# For live games, get detailed state # For live games, get detailed state
linescore = event['competitions'][0].get('linescores', [{}])[0] inning = event['status'].get('period', 1) # Get inning from status period
inning = linescore.get('value', 1)
# Get inning information from status # Get inning information from status
status_detail = event['status'].get('detail', '').lower() status_detail = event['status'].get('detail', '').lower()