lots of visual and logic changes

This commit is contained in:
Chuck
2025-07-21 15:22:12 -05:00
parent d3ab27b221
commit 94f0eb060b
10 changed files with 12 additions and 18 deletions

View File

@@ -298,7 +298,7 @@ class BaseMiLBManager:
dt = dt.replace(tzinfo=pytz.UTC)
local_dt = dt.astimezone(tz)
return local_dt.strftime("%I:%M %p")
return local_dt.strftime("%I:%M %p").lstrip('0')
except Exception as e:
logger.error(f"Error formatting game time: {e}")
return "TBD"

View File

@@ -359,7 +359,7 @@ class BaseMLBManager:
dt = dt.replace(tzinfo=pytz.UTC)
local_dt = dt.astimezone(tz)
return local_dt.strftime("%I:%M %p")
return local_dt.strftime("%I:%M %p").lstrip('0')
except Exception as e:
logger.error(f"Error formatting game time: {e}")
return "TBD"

View File

@@ -434,7 +434,7 @@ class BaseNBAManager:
if start_time_utc:
# Convert to local time
local_time = start_time_utc.astimezone(self._get_timezone())
game_time = local_time.strftime("%-I:%M %p")
game_time = local_time.strftime("%I:%M %p").lstrip('0')
game_date = local_time.strftime("%-m/%-d")
# Calculate if game is within recent window

View File

@@ -345,13 +345,11 @@ class BaseNCAABaseballManager:
except pytz.exceptions.UnknownTimeZoneError:
logger.warning(f"[NCAABaseball] Unknown timezone: {timezone_str}, falling back to UTC")
tz = pytz.UTC
dt = datetime.fromisoformat(game_time.replace('Z', '+00:00'))
if dt.tzinfo is None:
dt = dt.replace(tzinfo=pytz.UTC)
local_dt = dt.astimezone(tz)
return local_dt.strftime("%I:%M %p")
return local_dt.strftime("%I:%M %p").lstrip('0')
except Exception as e:
logger.error(f"[NCAABaseball] Error formatting game time: {e}")
return "TBD"

View File

@@ -436,7 +436,7 @@ class BaseNCAAFBManager: # Renamed class
game_time, game_date = "", ""
if start_time_utc:
local_time = start_time_utc.astimezone(self._get_timezone())
game_time = local_time.strftime("%-I:%M %p")
game_time = local_time.strftime("%I:%M %p").lstrip('0')
game_date = local_time.strftime("%-m/%-d")
# --- Football Specific Details (Likely same for NFL/NCAAFB) ---

View File

@@ -431,7 +431,7 @@ class BaseNCAAMBasketballManager:
if start_time_utc:
# Convert to local time
local_time = start_time_utc.astimezone(self._get_timezone())
game_time = local_time.strftime("%-I:%M %p")
game_time = local_time.strftime("%I:%M %p").lstrip('0')
game_date = local_time.strftime("%-m/%-d")
# Calculate if game is within recent window

View File

@@ -436,7 +436,7 @@ class BaseNFLManager: # Renamed class
game_time, game_date = "", ""
if start_time_utc:
local_time = start_time_utc.astimezone(self._get_timezone())
game_time = local_time.strftime("%-I:%M %p")
game_time = local_time.strftime("%I:%M %p").lstrip('0')
game_date = local_time.strftime("%-m/%-d")
# --- NFL Specific Details ---

View File

@@ -162,10 +162,6 @@ class OddsTickerManager:
league_config = self.league_configs[league_key]
logger.debug(f"Processing league {league_key}: enabled={league_config['enabled']}")
if not league_config['enabled']:
logger.debug(f"League {league_key} is disabled, skipping")
continue
try:
# Fetch all upcoming games for this league
all_games = self._fetch_league_games(league_config, now)
@@ -336,7 +332,7 @@ class OddsTickerManager:
if game_time.tzinfo is None:
game_time = game_time.replace(tzinfo=pytz.UTC)
local_time = game_time.astimezone(tz)
time_str = local_time.strftime("%I:%M %p")
time_str = local_time.strftime("%I:%M %p").lstrip('0')
return f"[{time_str}] {game['away_team']} vs {game['home_team']} (No odds)"
@@ -361,7 +357,7 @@ class OddsTickerManager:
if game_time.tzinfo is None:
game_time = game_time.replace(tzinfo=pytz.UTC)
local_time = game_time.astimezone(tz)
time_str = local_time.strftime("%I:%M %p")
time_str = local_time.strftime("%I:%M %p").lstrip('0')
# Build odds string
odds_parts = [f"[{time_str}]"]
@@ -441,7 +437,7 @@ class OddsTickerManager:
# Capitalize full day name, e.g., 'Tuesday'
day_text = local_time.strftime("%A")
date_text = local_time.strftime("%-m/%d")
time_text = local_time.strftime("%-I:%M %p")
time_text = local_time.strftime("%I:%M %p").lstrip('0')
# Team and record text
away_team_text = f"{game.get('away_team', 'N/A')} ({game.get('away_record', '') or 'N/A'})"

View File

@@ -560,7 +560,7 @@ class BaseSoccerManager:
game_date = ""
if start_time_utc:
local_time = start_time_utc.astimezone(self._get_timezone())
game_time = local_time.strftime("%-I:%M%p").lower() # e.g., 2:30pm
game_time = local_time.strftime("%I:%M%p").lower().lstrip('0') # e.g., 2:30pm
game_date = local_time.strftime("%-m/%-d")
status_type = status["type"]["name"]