Spaces:
Runtime error
Runtime error
Commit
·
8411795
1
Parent(s):
e731dd3
Update main.py
Browse files
main.py
CHANGED
@@ -262,17 +262,13 @@ async def session_drivers(year: int, event: str | int, session: str) -> any:
|
|
262 |
|
263 |
# get drivers available for a given year, event and session
|
264 |
f1session = fastf1.get_session(year, event, session)
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
drivers = [{"color": team_colors[laps[laps.Driver ==
|
273 |
-
driver].Team.iloc[0]], "label": driver, "value": driver} for driver in drivers]
|
274 |
-
|
275 |
-
|
276 |
|
277 |
return {"drivers": drivers}
|
278 |
|
|
|
262 |
|
263 |
# get drivers available for a given year, event and session
|
264 |
f1session = fastf1.get_session(year, event, session)
|
265 |
+
api_path = f1session.api_path
|
266 |
+
drivers_raw = fastf1.api.driver_info(api_path)
|
267 |
+
drivers = [{
|
268 |
+
"color": available_data.team_colors(year)[driver[1]['TeamName']],
|
269 |
+
"label": driver[1]['Tla'],
|
270 |
+
"value": driver[1]['Tla']
|
271 |
+
} for driver in drivers_raw.items()]
|
|
|
|
|
|
|
|
|
272 |
|
273 |
return {"drivers": drivers}
|
274 |
|