логотипы каналов, тест 2

This commit is contained in:
2026-07-02 14:47:37 +03:00
parent e32fdcb74e
commit 03a68ee8ca
9 changed files with 130 additions and 72 deletions

View File

@@ -460,27 +460,29 @@ def get_vmix_schedule(session_row):
m.match_date,
m.status,
m.id,
m.channel
COALESCE(m.channel, '') AS channel,
COALESCE(NULLIF(m.source_key, ''), %s) AS source_key
FROM matches m
LEFT JOIN teams t1 ON m.home_team_id = t1.id
LEFT JOIN teams t2 ON m.away_team_id = t2.id
WHERE m.tour = %s
AND (%s IS NULL OR m.season = %s)
AND COALESCE(m.source_key, %s) = %s
AND COALESCE(NULLIF(m.source_key, ''), %s) = %s
ORDER BY m.match_date, m.id
"""
conn = get_connection()
try:
with conn.cursor() as cur:
cur.execute(query, (tour, season, season, source_filter, source_filter))
cur.execute(query, (source_filter, tour, season, season, source_filter, source_filter))
rows = cur.fetchall()
result = []
for row in rows:
row = list(row)
row[0] = build_logo_variant_path(source_key, row[0], "white")
row[1] = build_logo_variant_path(source_key, row[1], "white")
row_source_key = row[8] if len(row) > 8 else source_key
row[0] = build_logo_variant_path(row_source_key, row[0], "white")
row[1] = build_logo_variant_path(row_source_key, row[1], "white")
result.append(tuple(row))
return result
finally: