Update api/main.py
All checks were successful
Build & Push Football Docker Images / build-push-update (push) Successful in 7s
All checks were successful
Build & Push Football Docker Images / build-push-update (push) Successful in 7s
This commit is contained in:
11
api/main.py
11
api/main.py
@@ -140,6 +140,12 @@ def widget():
|
||||
score = m.get("score")
|
||||
date = m.get("date", "—")
|
||||
time_ = m.get("time", "")
|
||||
time_str = m.get("time", "")
|
||||
|
||||
|
||||
time_str = re.sub(r'^v\s*', '', time_str).strip()
|
||||
time_str = time_str if time_str not in ("", "TBD", "v") else "TBD"
|
||||
|
||||
|
||||
# Shorten names for display
|
||||
def shorten(name: str) -> str:
|
||||
@@ -156,8 +162,11 @@ def widget():
|
||||
cls = "card past"
|
||||
else:
|
||||
date_s = "/".join(date.split("/")[:2]) if "/" in date else date
|
||||
time_part = f"<br>{time_str}" if time_str and time_str != "TBD" else ""
|
||||
middle = f'<div class="fixture">{date_s}{time_part}</div>'
|
||||
|
||||
time_s = f"<br>{time_}" if time_ and time_ != "TBD" else ""
|
||||
middle = f'<div class="fixture">{date_s}{time_s}</div>'
|
||||
|
||||
cls = "card future"
|
||||
|
||||
return f"""
|
||||
|
||||
Reference in New Issue
Block a user