логотипы каналов, тест 2
This commit is contained in:
@@ -87,6 +87,7 @@ def build_project_settings_context() -> dict[str, Any]:
|
||||
),
|
||||
_field(_source_field_key(source_key, "LOGO_BASE_PATH"), "Папка логотипов", source.get("logo_base_path", ""), wide=True),
|
||||
_field(_source_field_key(source_key, "PHOTO_BASE_PATH"), "Папка фотографий", source.get("photo_base_path", ""), wide=True),
|
||||
_field(_source_field_key(source_key, "CHANNEL_LOGO_BASE_PATH"), "Папка логотипов каналов", source.get("channel_logo_base_path", ""), wide=True),
|
||||
_field(_source_field_key(source_key, "TEAMS_URL"), "Ссылка на команды", source.get("teams_url", ""), wide=True),
|
||||
_field(_source_field_key(source_key, "SCHEDULE_URL"), "Ссылка на расписание", source.get("schedule_url", ""), wide=True),
|
||||
_field(_source_field_key(source_key, "STANDINGS_URL"), "Ссылка на турнирку", source.get("standings_url", ""), wide=True),
|
||||
@@ -123,6 +124,7 @@ def save_project_settings(form_values: dict[str, str]) -> list[str]:
|
||||
"CALENDAR_TYPE": "calendar_type",
|
||||
"LOGO_BASE_PATH": "logo_base_path",
|
||||
"PHOTO_BASE_PATH": "photo_base_path",
|
||||
"CHANNEL_LOGO_BASE_PATH": "channel_logo_base_path",
|
||||
"TEAMS_URL": "teams_url",
|
||||
"SCHEDULE_URL": "schedule_url",
|
||||
"STANDINGS_URL": "standings_url",
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user