From c68b4739fd5467233890448877741f75d37a7459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Sat, 15 Nov 2025 15:58:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BF=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20games=20online,=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D0=BF=D0=BB=D0=B8=D1=82=20=D1=82=D1=83=D0=B4?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_data.py | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/get_data.py b/get_data.py index 2db7713..bd68dc6 100644 --- a/get_data.py +++ b/get_data.py @@ -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