поправил картинки для W и L
This commit is contained in:
23
get_data.py
23
get_data.py
@@ -3681,7 +3681,15 @@ async def last_5_games():
|
|||||||
elif team_id == id2:
|
elif team_id == id2:
|
||||||
is_win = score2 > score1
|
is_win = score2 > score1
|
||||||
|
|
||||||
wl_list.append("W" if is_win else "L" if is_win is not None else "")
|
wl_list.append(
|
||||||
|
r"D:\Графика\БАСКЕТБОЛ\VTB League\ASSETS\LAST 5 GAMES\W.png"
|
||||||
|
if is_win
|
||||||
|
else (
|
||||||
|
r"D:\Графика\БАСКЕТБОЛ\VTB League\ASSETS\LAST 5 GAMES\L.png"
|
||||||
|
if is_win is not None
|
||||||
|
else EMPTY_PHOTO_PATH
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
return wl_list[::-1]
|
return wl_list[::-1]
|
||||||
|
|
||||||
@@ -3718,10 +3726,10 @@ async def last_5_games():
|
|||||||
# определяем соперника и место
|
# определяем соперника и место
|
||||||
if team_id == t1.get("teamId"):
|
if team_id == t1.get("teamId"):
|
||||||
opp_name = t2.get("name", "")
|
opp_name = t2.get("name", "")
|
||||||
place = "home" # команда дома
|
place = "home" # команда дома
|
||||||
else:
|
else:
|
||||||
opp_name = t1.get("name", "")
|
opp_name = t1.get("name", "")
|
||||||
place = "away" # команда в гостях
|
place = "away" # команда в гостях
|
||||||
|
|
||||||
if best is None or dt < best["dt"]:
|
if best is None or dt < best["dt"]:
|
||||||
best = {"dt": dt, "opp": opp_name, "place": place}
|
best = {"dt": dt, "opp": opp_name, "place": place}
|
||||||
@@ -3734,8 +3742,8 @@ async def last_5_games():
|
|||||||
return {
|
return {
|
||||||
"opponent": best["opp"],
|
"opponent": best["opp"],
|
||||||
"date": best["dt"].strftime("%Y-%m-%d %H:%M"),
|
"date": best["dt"].strftime("%Y-%m-%d %H:%M"),
|
||||||
"place": best["place"], # "home" / "away"
|
"place": best["place"], # "home" / "away"
|
||||||
"place_ru": place_ru, # "дома" / "в гостях"
|
"place_ru": place_ru, # "дома" / "в гостях"
|
||||||
}
|
}
|
||||||
|
|
||||||
# последние 5 игр и результаты
|
# последние 5 игр и результаты
|
||||||
@@ -3744,7 +3752,6 @@ async def last_5_games():
|
|||||||
|
|
||||||
team1_wl = calc_results_list(team1_games, team1_id)
|
team1_wl = calc_results_list(team1_games, team1_id)
|
||||||
team2_wl = calc_results_list(team2_games, team2_id)
|
team2_wl = calc_results_list(team2_games, team2_id)
|
||||||
|
|
||||||
|
|
||||||
# следующий матч
|
# следующий матч
|
||||||
next1 = find_next_game(team1_id)
|
next1 = find_next_game(team1_id)
|
||||||
@@ -3757,8 +3764,8 @@ async def last_5_games():
|
|||||||
"team_results": team1_wl,
|
"team_results": team1_wl,
|
||||||
"nextOpponent": next1["opponent"],
|
"nextOpponent": next1["opponent"],
|
||||||
"nextGameDate": next1["date"],
|
"nextGameDate": next1["date"],
|
||||||
"nextGamePlace": next1["place_ru"], # "дома" / "в гостях"
|
"nextGamePlace": next1["place_ru"], # "дома" / "в гостях"
|
||||||
"nextGameHomeAway": next1["place"], # "home" / "away" (если нужно в логике)
|
"nextGameHomeAway": next1["place"], # "home" / "away" (если нужно в логике)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"teamName": team2_name,
|
"teamName": team2_name,
|
||||||
|
|||||||
Reference in New Issue
Block a user