From d7c819357d18fd56673f85cc8c9611f98cfe0b6b 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: Fri, 24 Oct 2025 14:15:37 +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=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D0=B5=20json=20=D1=84?= =?UTF-8?q?=D0=B0=D0=B9=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- visual.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/visual.py b/visual.py index 9a31eaf..af5a047 100644 --- a/visual.py +++ b/visual.py @@ -285,11 +285,7 @@ if "player2" not in st.session_state: st.session_state.player2 = None -myhost = platform.node() -if sys.platform.startswith("win"): # было: if platform == "win32": - FOLDER_JSON = "JSON" -else: - FOLDER_JSON = "static" +FOLDER_JSON = "static" def get_ip_address(): @@ -414,9 +410,7 @@ def rewrite_file(filename: str, data: dict, directory: str = "JSON") -> None: os.makedirs(directory, exist_ok=True) - host_prefix = _ipcheck() - - filepath = os.path.join(directory, f"{host_prefix}{filename}.json") + filepath = os.path.join(directory, f"{filename}.json") # print(filepath) # оставил как у тебя; можно заменить на logger.debug при желании try: @@ -431,16 +425,16 @@ ip_check = read_match_id_json("match_id.json") or {} prefix = _ipcheck() -load_data_from_json(f"{prefix}game_online") +load_data_from_json("game_online") cached_game_online = st.session_state.get("game_online") -load_data_from_json(f"{prefix}team1") +load_data_from_json("team1") cached_team1 = st.session_state.get("team1") -load_data_from_json(f"{prefix}team2") +load_data_from_json("team2") cached_team2 = st.session_state.get("team2") -load_data_from_json(f"{prefix}referee") +load_data_from_json("referee") cached_referee = st.session_state.get("referee") # standings — может не быть тега/файла @@ -455,29 +449,29 @@ if isinstance(cached_game_online, dict): .replace(" ", "_") ) if league_tag: - load_data_from_json(f"{prefix}standings_{league_tag}_{comp_name}") + load_data_from_json(f"standings_{league_tag}_{comp_name}") cached_standings = ( st.session_state.get(f"standings_{league_tag}_{comp_name}") if league_tag else None ) -load_data_from_json(f"{prefix}scores_quarter") +load_data_from_json("scores_quarter") cached_scores_quarter = st.session_state.get("scores_quarter") -load_data_from_json(f"{prefix}play_by_play") +load_data_from_json("play_by_play") cached_play_by_play = st.session_state.get("play_by_play") -load_data_from_json(f"{prefix}team_stats") +load_data_from_json("team_stats") cached_team_stats = st.session_state.get("team_stats") -load_data_from_json(f"{prefix}scores") +load_data_from_json("scores") cached_scores = st.session_state.get("scores") or [] # важно! -load_data_from_json(f"{prefix}live_status") +load_data_from_json("live_status") cached_live_status = st.session_state.get("live_status") -load_data_from_json(f"{prefix}schedule") +load_data_from_json("schedule") cached_schedule = st.session_state.get("schedule") -load_data_from_json(f"{prefix}team_comparison") +load_data_from_json("team_comparison") cached_team_comparison = st.session_state.get("team_comparison")