подгрузка данных для кубка россии. тест 2

This commit is contained in:
2026-07-02 12:56:24 +03:00
parent 57907fd86b
commit e98d014243
5 changed files with 180 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
# services/vmix_json_service.py
from db import get_connection
from repositories.match_lineup_repository import get_match_lineup_for_vmix
from repositories.match_repository import resolve_match_source_key
from parsers.parser_sources import build_empty_photo_path, build_logo_path, build_logo_variant_path, build_photo_path
@@ -9,11 +10,17 @@ EMPTY_PHOTO_PATH = DEFAULT_PHOTO_BASE_PATH + r"\EMPTY.png"
def _session_source_key(session_row) -> str | None:
try:
match_id = session_row[1]
except Exception:
match_id = None
try:
value = session_row[21]
except Exception:
value = None
return str(value).strip() if value else None
return resolve_match_source_key(match_id, value)
def build_generated_player_photo_path(
@@ -386,7 +393,9 @@ def get_vmix_match_info_by_token(session_token: str):
return None
row = list(row)
source_key = row[30] if len(row) > 30 else None
source_key = resolve_match_source_key(row[0], row[30] if len(row) > 30 else None)
if len(row) > 30:
row[30] = source_key
row[14] = build_logo_path(source_key, row[14])
row[15] = build_logo_path(source_key, row[15])
row[20] = build_logo_variant_path(source_key, row[20], "white")