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