From 801936518a089fe207fdcdd5f85d07b25363c715 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: Mon, 25 May 2026 12:34:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B8=D0=BD=D0=B8=20=D0=B7=D0=B0=D1=89?= =?UTF-8?q?=D0=B8=D1=82=D0=B0=20=D0=BE=D1=82=20=D1=81=D0=B1=D1=80=D0=BE?= =?UTF-8?q?=D1=81=D0=B0=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B2=20?= =?UTF-8?q?=D0=B1=D0=B0=D0=B7=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D1=85?= =?UTF-8?q?,=20=D0=B5=D1=81=D0=BB=D0=B8=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D1=85=20=D0=BD=D0=B5=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parsers/parser_schedule.py | 5 +++-- parsers/parser_standings.py | 12 ++++++------ parsers/parser_teams.py | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/parsers/parser_schedule.py b/parsers/parser_schedule.py index 3a9e7a7..c4e2db6 100644 --- a/parsers/parser_schedule.py +++ b/parsers/parser_schedule.py @@ -165,8 +165,9 @@ def parse_schedule(html: str) -> list[dict]: def run_parser_schedule() -> None: html = fetch_html(URL_SCHEDULE) matches_data = parse_schedule(html) - sync_matches(matches_data) - print(f"[parser_schedule] Matches synced: {len(matches_data)}") + if matches_data: + sync_matches(matches_data) + print(f"[parser_schedule] Matches synced: {len(matches_data)}") if __name__ == "__main__": diff --git a/parsers/parser_standings.py b/parsers/parser_standings.py index 41ac1ea..ba30a17 100644 --- a/parsers/parser_standings.py +++ b/parsers/parser_standings.py @@ -68,13 +68,13 @@ def parse_standings(html: str) -> list[dict]: def run_parser_standings() -> None: html = fetch_html(URL_STANDINGS) standings_rows = parse_standings(html) + if standings_rows: + sync_standings( + season=SEASON, + standings_rows=standings_rows, + ) - sync_standings( - season=SEASON, - standings_rows=standings_rows, - ) - - print(f"[parser_standings] Synced rows: {len(standings_rows)}") + print(f"[parser_standings] Synced rows: {len(standings_rows)}") if __name__ == "__main__": diff --git a/parsers/parser_teams.py b/parsers/parser_teams.py index 1abae50..722cc79 100644 --- a/parsers/parser_teams.py +++ b/parsers/parser_teams.py @@ -80,8 +80,9 @@ def parse_teams_html(html: str) -> dict: def run_parser_teams() -> None: teams_data = get_url_teams() - sync_teams(teams_data) - print(f"Teams synced: {len(teams_data)}") + if teams_data: + sync_teams(teams_data) + print(f"Teams synced: {len(teams_data)}") if __name__ == "__main__":