mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
lots of visual and logic changes
This commit is contained in:
@@ -117,7 +117,7 @@
|
|||||||
"enabled_leagues": ["nfl","mlb", "ncaa_fb"],
|
"enabled_leagues": ["nfl","mlb", "ncaa_fb"],
|
||||||
"update_interval": 3600,
|
"update_interval": 3600,
|
||||||
"scroll_speed": 1,
|
"scroll_speed": 1,
|
||||||
"scroll_delay": 0.05,
|
"scroll_delay": 0.01,
|
||||||
"display_duration": 30
|
"display_duration": 30
|
||||||
},
|
},
|
||||||
"calendar": {
|
"calendar": {
|
||||||
|
|||||||
@@ -298,7 +298,7 @@ class BaseMiLBManager:
|
|||||||
dt = dt.replace(tzinfo=pytz.UTC)
|
dt = dt.replace(tzinfo=pytz.UTC)
|
||||||
local_dt = dt.astimezone(tz)
|
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:
|
except Exception as e:
|
||||||
logger.error(f"Error formatting game time: {e}")
|
logger.error(f"Error formatting game time: {e}")
|
||||||
return "TBD"
|
return "TBD"
|
||||||
|
|||||||
@@ -359,7 +359,7 @@ class BaseMLBManager:
|
|||||||
dt = dt.replace(tzinfo=pytz.UTC)
|
dt = dt.replace(tzinfo=pytz.UTC)
|
||||||
local_dt = dt.astimezone(tz)
|
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:
|
except Exception as e:
|
||||||
logger.error(f"Error formatting game time: {e}")
|
logger.error(f"Error formatting game time: {e}")
|
||||||
return "TBD"
|
return "TBD"
|
||||||
|
|||||||
@@ -434,7 +434,7 @@ class BaseNBAManager:
|
|||||||
if start_time_utc:
|
if start_time_utc:
|
||||||
# Convert to local time
|
# Convert to local time
|
||||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
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")
|
game_date = local_time.strftime("%-m/%-d")
|
||||||
|
|
||||||
# Calculate if game is within recent window
|
# Calculate if game is within recent window
|
||||||
|
|||||||
@@ -345,13 +345,11 @@ class BaseNCAABaseballManager:
|
|||||||
except pytz.exceptions.UnknownTimeZoneError:
|
except pytz.exceptions.UnknownTimeZoneError:
|
||||||
logger.warning(f"[NCAABaseball] Unknown timezone: {timezone_str}, falling back to UTC")
|
logger.warning(f"[NCAABaseball] Unknown timezone: {timezone_str}, falling back to UTC")
|
||||||
tz = pytz.UTC
|
tz = pytz.UTC
|
||||||
|
|
||||||
dt = datetime.fromisoformat(game_time.replace('Z', '+00:00'))
|
dt = datetime.fromisoformat(game_time.replace('Z', '+00:00'))
|
||||||
if dt.tzinfo is None:
|
if dt.tzinfo is None:
|
||||||
dt = dt.replace(tzinfo=pytz.UTC)
|
dt = dt.replace(tzinfo=pytz.UTC)
|
||||||
local_dt = dt.astimezone(tz)
|
local_dt = dt.astimezone(tz)
|
||||||
|
return local_dt.strftime("%I:%M %p").lstrip('0')
|
||||||
return local_dt.strftime("%I:%M %p")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(f"[NCAABaseball] Error formatting game time: {e}")
|
logger.error(f"[NCAABaseball] Error formatting game time: {e}")
|
||||||
return "TBD"
|
return "TBD"
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ class BaseNCAAFBManager: # Renamed class
|
|||||||
game_time, game_date = "", ""
|
game_time, game_date = "", ""
|
||||||
if start_time_utc:
|
if start_time_utc:
|
||||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
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")
|
game_date = local_time.strftime("%-m/%-d")
|
||||||
|
|
||||||
# --- Football Specific Details (Likely same for NFL/NCAAFB) ---
|
# --- Football Specific Details (Likely same for NFL/NCAAFB) ---
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ class BaseNCAAMBasketballManager:
|
|||||||
if start_time_utc:
|
if start_time_utc:
|
||||||
# Convert to local time
|
# Convert to local time
|
||||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
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")
|
game_date = local_time.strftime("%-m/%-d")
|
||||||
|
|
||||||
# Calculate if game is within recent window
|
# Calculate if game is within recent window
|
||||||
|
|||||||
@@ -436,7 +436,7 @@ class BaseNFLManager: # Renamed class
|
|||||||
game_time, game_date = "", ""
|
game_time, game_date = "", ""
|
||||||
if start_time_utc:
|
if start_time_utc:
|
||||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
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")
|
game_date = local_time.strftime("%-m/%-d")
|
||||||
|
|
||||||
# --- NFL Specific Details ---
|
# --- NFL Specific Details ---
|
||||||
|
|||||||
@@ -162,10 +162,6 @@ class OddsTickerManager:
|
|||||||
league_config = self.league_configs[league_key]
|
league_config = self.league_configs[league_key]
|
||||||
logger.debug(f"Processing league {league_key}: enabled={league_config['enabled']}")
|
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:
|
try:
|
||||||
# Fetch all upcoming games for this league
|
# Fetch all upcoming games for this league
|
||||||
all_games = self._fetch_league_games(league_config, now)
|
all_games = self._fetch_league_games(league_config, now)
|
||||||
@@ -336,7 +332,7 @@ class OddsTickerManager:
|
|||||||
if game_time.tzinfo is None:
|
if game_time.tzinfo is None:
|
||||||
game_time = game_time.replace(tzinfo=pytz.UTC)
|
game_time = game_time.replace(tzinfo=pytz.UTC)
|
||||||
local_time = game_time.astimezone(tz)
|
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)"
|
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:
|
if game_time.tzinfo is None:
|
||||||
game_time = game_time.replace(tzinfo=pytz.UTC)
|
game_time = game_time.replace(tzinfo=pytz.UTC)
|
||||||
local_time = game_time.astimezone(tz)
|
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
|
# Build odds string
|
||||||
odds_parts = [f"[{time_str}]"]
|
odds_parts = [f"[{time_str}]"]
|
||||||
@@ -441,7 +437,7 @@ class OddsTickerManager:
|
|||||||
# Capitalize full day name, e.g., 'Tuesday'
|
# Capitalize full day name, e.g., 'Tuesday'
|
||||||
day_text = local_time.strftime("%A")
|
day_text = local_time.strftime("%A")
|
||||||
date_text = local_time.strftime("%-m/%d")
|
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
|
# Team and record text
|
||||||
away_team_text = f"{game.get('away_team', 'N/A')} ({game.get('away_record', '') or 'N/A'})"
|
away_team_text = f"{game.get('away_team', 'N/A')} ({game.get('away_record', '') or 'N/A'})"
|
||||||
|
|||||||
@@ -560,7 +560,7 @@ class BaseSoccerManager:
|
|||||||
game_date = ""
|
game_date = ""
|
||||||
if start_time_utc:
|
if start_time_utc:
|
||||||
local_time = start_time_utc.astimezone(self._get_timezone())
|
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")
|
game_date = local_time.strftime("%-m/%-d")
|
||||||
|
|
||||||
status_type = status["type"]["name"]
|
status_type = status["type"]["name"]
|
||||||
|
|||||||
Reference in New Issue
Block a user