исправил данные из box-score, которые успешно проебал
This commit is contained in:
20
get_data.py
20
get_data.py
@@ -354,11 +354,29 @@ def merge_online_payloads(
|
|||||||
# нормализация/дедуп
|
# нормализация/дедуп
|
||||||
# plays = _dedup_plays(plays_raw)
|
# plays = _dedup_plays(plays_raw)
|
||||||
|
|
||||||
# print(game)
|
# print(game["teams"])
|
||||||
|
# print(box_score)
|
||||||
|
for index_team, team in enumerate(game["teams"][1:]):
|
||||||
|
box_team = box_score["result"]["teams"][index_team]
|
||||||
|
for player in team.get("starts", []):
|
||||||
|
stat = next(
|
||||||
|
(
|
||||||
|
s
|
||||||
|
for s in box_team.get("starts", [])
|
||||||
|
if s.get("startNum") == player.get("startNum")
|
||||||
|
),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
if stat:
|
||||||
|
player["stats"] = stat
|
||||||
|
|
||||||
|
team["total"] = box_team.get("total", {})
|
||||||
|
|
||||||
game["plays"] = play_by_play.get("result", [])
|
game["plays"] = play_by_play.get("result", [])
|
||||||
game["scoreByPeriods"] = box_score["result"].get("scoreByPeriods", [])
|
game["scoreByPeriods"] = box_score["result"].get("scoreByPeriods", [])
|
||||||
game["fullScore"] = box_score["result"].get("fullScore", {})
|
game["fullScore"] = box_score["result"].get("fullScore", {})
|
||||||
game["live_status"] = live_status["result"]
|
game["live_status"] = live_status["result"]
|
||||||
|
# game[""]
|
||||||
merged: Dict[str, Any] = {
|
merged: Dict[str, Any] = {
|
||||||
"meta": {
|
"meta": {
|
||||||
"generatedAt": _now_iso(),
|
"generatedAt": _now_iso(),
|
||||||
|
|||||||
Reference in New Issue
Block a user