mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
Improve inning half detection logic and add more detailed logging
This commit is contained in:
@@ -307,12 +307,20 @@ class BaseMLBManager:
|
|||||||
status_detail = event['status'].get('detail', '').lower()
|
status_detail = event['status'].get('detail', '').lower()
|
||||||
status_short = event['status'].get('shortDetail', '').lower()
|
status_short = event['status'].get('shortDetail', '').lower()
|
||||||
|
|
||||||
|
if is_favorite_game:
|
||||||
|
self.logger.debug(f"[MLB] Raw status detail: {event['status'].get('detail')}")
|
||||||
|
self.logger.debug(f"[MLB] Raw status short: {event['status'].get('shortDetail')}")
|
||||||
|
|
||||||
# Determine inning half from status information
|
# Determine inning half from status information
|
||||||
inning_half = 'top' # Default to top
|
inning_half = 'top' # Default to top
|
||||||
if any(x in status_detail.lower() for x in ['bottom', 'bot']):
|
if 'bottom' in status_detail or 'bot' in status_detail or 'bottom' in status_short or 'bot' in status_short:
|
||||||
inning_half = 'bottom'
|
inning_half = 'bottom'
|
||||||
elif any(x in status_detail.lower() for x in ['top', 'mid']):
|
if is_favorite_game:
|
||||||
|
self.logger.debug("[MLB] Detected bottom of inning")
|
||||||
|
elif 'top' in status_detail or 'mid' in status_detail or 'top' in status_short or 'mid' in status_short:
|
||||||
inning_half = 'top'
|
inning_half = 'top'
|
||||||
|
if is_favorite_game:
|
||||||
|
self.logger.debug("[MLB] Detected top of inning")
|
||||||
|
|
||||||
if is_favorite_game:
|
if is_favorite_game:
|
||||||
self.logger.debug(f"[MLB] Status detail: {status_detail}")
|
self.logger.debug(f"[MLB] Status detail: {status_detail}")
|
||||||
|
|||||||
Reference in New Issue
Block a user