mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 13:23:00 +00:00
more robust half time detection
This commit is contained in:
@@ -438,7 +438,7 @@ class BaseNCAAFBManager: # Renamed class
|
|||||||
elif period == 4: period_text = "Q3"
|
elif period == 4: period_text = "Q3"
|
||||||
elif period == 5: period_text = "Q4"
|
elif period == 5: period_text = "Q4"
|
||||||
elif period > 5: period_text = "OT" # Assuming OT starts at period 6+
|
elif period > 5: period_text = "OT" # Assuming OT starts at period 6+
|
||||||
elif status["type"]["state"] == "halftime": # Check explicit halftime state
|
elif status["type"]["state"] == "halftime" or status["type"]["name"] == "STATUS_HALFTIME": # Check explicit halftime state
|
||||||
period_text = "HALF"
|
period_text = "HALF"
|
||||||
elif status["type"]["state"] == "post":
|
elif status["type"]["state"] == "post":
|
||||||
if period > 5 : period_text = "Final/OT"
|
if period > 5 : period_text = "Final/OT"
|
||||||
@@ -466,7 +466,7 @@ class BaseNCAAFBManager: # Renamed class
|
|||||||
"is_live": status["type"]["state"] == "in",
|
"is_live": status["type"]["state"] == "in",
|
||||||
"is_final": status["type"]["state"] == "post",
|
"is_final": status["type"]["state"] == "post",
|
||||||
"is_upcoming": status["type"]["state"] == "pre",
|
"is_upcoming": status["type"]["state"] == "pre",
|
||||||
"is_halftime": status["type"]["state"] == "halftime", # Added halftime check
|
"is_halftime": status["type"]["state"] == "halftime" or status["type"]["name"] == "STATUS_HALFTIME", # Added halftime check
|
||||||
"home_abbr": home_abbr,
|
"home_abbr": home_abbr,
|
||||||
"home_score": home_team.get("score", "0"),
|
"home_score": home_team.get("score", "0"),
|
||||||
"home_record": home_record,
|
"home_record": home_record,
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ class BaseNCAAMBasketballManager:
|
|||||||
"period": status.get("period", 0),
|
"period": status.get("period", 0),
|
||||||
"clock": status.get("displayClock", "0:00"),
|
"clock": status.get("displayClock", "0:00"),
|
||||||
"is_live": status["type"]["state"] in ("in", "halftime"), # Include halftime as live
|
"is_live": status["type"]["state"] in ("in", "halftime"), # Include halftime as live
|
||||||
"is_halftime": status["type"]["state"] == "halftime",
|
"is_halftime": status["type"]["state"] == "halftime" or status["type"]["name"] == "STATUS_HALFTIME",
|
||||||
"is_final": status["type"]["state"] == "post",
|
"is_final": status["type"]["state"] == "post",
|
||||||
"is_upcoming": status["type"]["state"] == "pre",
|
"is_upcoming": status["type"]["state"] == "pre",
|
||||||
"home_abbr": home_team["team"]["abbreviation"],
|
"home_abbr": home_team["team"]["abbreviation"],
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ class BaseNFLManager: # Renamed class
|
|||||||
elif period == 3: period_text = "Q3" # Fixed: period 3 is 3rd quarter, not halftime
|
elif period == 3: period_text = "Q3" # Fixed: period 3 is 3rd quarter, not halftime
|
||||||
elif period == 4: period_text = "Q4"
|
elif period == 4: period_text = "Q4"
|
||||||
elif period > 4: period_text = "OT" # OT starts after Q4
|
elif period > 4: period_text = "OT" # OT starts after Q4
|
||||||
elif status["type"]["state"] == "halftime": # Check explicit halftime state
|
elif status["type"]["state"] == "halftime" or status["type"]["name"] == "STATUS_HALFTIME": # Check explicit halftime state
|
||||||
period_text = "HALF"
|
period_text = "HALF"
|
||||||
elif status["type"]["state"] == "post":
|
elif status["type"]["state"] == "post":
|
||||||
if period > 4 : period_text = "Final/OT"
|
if period > 4 : period_text = "Final/OT"
|
||||||
@@ -407,7 +407,7 @@ class BaseNFLManager: # Renamed class
|
|||||||
"is_live": status["type"]["state"] == "in",
|
"is_live": status["type"]["state"] == "in",
|
||||||
"is_final": status["type"]["state"] == "post",
|
"is_final": status["type"]["state"] == "post",
|
||||||
"is_upcoming": status["type"]["state"] == "pre",
|
"is_upcoming": status["type"]["state"] == "pre",
|
||||||
"is_halftime": status["type"]["state"] == "halftime", # Added halftime check
|
"is_halftime": status["type"]["state"] == "halftime" or status["type"]["name"] == "STATUS_HALFTIME", # Added halftime check
|
||||||
"home_abbr": home_abbr,
|
"home_abbr": home_abbr,
|
||||||
"home_score": home_team.get("score", "0"),
|
"home_score": home_team.get("score", "0"),
|
||||||
"home_record": home_record,
|
"home_record": home_record,
|
||||||
|
|||||||
Reference in New Issue
Block a user