поправил games online, добавил сплит туда

This commit is contained in:
2025-11-15 15:58:29 +03:00
parent 80a35988e0
commit c68b4739fd

View File

@@ -888,7 +888,9 @@ def build_pretty_status_message():
# Эмодзи-кружки для статусов
if any(x in st for x in ["ok", "success", "live", "online"]):
emoji = "🟢"
elif any(x in st for x in ["error", "fail", "no-status", "none", "timeout"]):
elif any(
x in st for x in ["error", "fail", "no-status", "none", "timeout"]
):
emoji = "🔴"
else:
emoji = "🟡"
@@ -1553,9 +1555,7 @@ async def status(request: Request):
"name": TEAM,
"status": STATUS,
"ts": (
GAME_START_DT.strftime("%Y-%m-%d %H:%M")
if GAME_START_DT
else "N/A"
GAME_START_DT.strftime("%Y-%m-%d %H:%M") if GAME_START_DT else "N/A"
),
"link": LEAGUE,
"color": color_for_status(STATUS),
@@ -3091,9 +3091,7 @@ async def vmix_project():
# pass
# else:
# ❗ На Linux/Synology/Docker — заменяем URL
edited_vmix = change_vmix_datasource_urls(
vmix_bio, f"https://{MYHOST}.tvstart.ru"
)
edited_vmix = change_vmix_datasource_urls(vmix_bio, f"https://{MYHOST}.tvstart.ru")
# 2. гарантируем, что это bytes
if isinstance(edited_vmix, str):
edited_vmix = edited_vmix.encode("utf-8")
@@ -3201,7 +3199,11 @@ async def games_online():
"score2": (
game["score2"] if any((s or 0) > 0 for s in scores) else ""
),
"period": game["period"] if "period" in game and any((s or 0) > 0 for s in scores) else "",
"period": (
game["period"]
if "period" in game and any((s or 0) > 0 for s in scores)
else ""
),
"defaultZoneTime": game["defaultZoneTime"],
"team1": item["team1"]["name"],
"team2": item["team2"]["name"],
@@ -3214,7 +3216,12 @@ async def games_online():
),
"mask2": (
"#FFFFFF00"
if (game["period"] if "period" in game and any((s or 0) > 0 for s in scores) else "") == ""
if (
game["period"]
if "period" in game and any((s or 0) > 0 for s in scores)
else ""
)
== ""
else "#FFFFFF"
),
"mask3": (
@@ -3222,6 +3229,17 @@ async def games_online():
if (game["period"] if "period" in game else "") != ""
else "#FFFFFF"
),
"split": (
":"
if any((s or 0) > 0 for s in scores)
and (
game["period"]
if "period" in game and any((s or 0) > 0 for s in scores)
else ""
)
== ""
else ""
),
}
)
return todays_games