обновление для Кубка России

переделаны все парсеры на ссылки из базы
This commit is contained in:
2026-07-02 12:46:29 +03:00
parent b0fe3ad5a4
commit 57907fd86b
29 changed files with 1838 additions and 240 deletions

View File

@@ -1,6 +1,7 @@
import secrets
from db import get_connection
from parsers.parser_sources import build_logo_path
def create_match_session(
@@ -66,7 +67,8 @@ def get_match_session_by_token(session_token: str):
at.id AS away_team_id,
at.name AS away_team_name,
at.logo_url AS away_team_logo,
at.logo_path AS away_team_logo_path
at.logo_path AS away_team_logo_path,
m.source_key AS source_key
FROM match_sessions ms
JOIN matches m ON m.id = ms.match_id
@@ -80,7 +82,16 @@ def get_match_session_by_token(session_token: str):
try:
with conn.cursor() as cur:
cur.execute(query, (session_token,))
return cur.fetchone()
row = cur.fetchone()
if not row:
return None
row = list(row)
source_key = row[21] if len(row) > 21 else None
row[16] = build_logo_path(source_key, row[16])
row[20] = build_logo_path(source_key, row[20])
return tuple(row)
finally:
conn.close()