Replace FastF1 with Jolpica API for circuit resolution
FastF1's get_event() couldn't resolve several grand prix names (Qatar, Brazilian, Mexican, Barcelona), causing 500/404 errors. Now uses Jolpica's race schedule directly — slugifies circuitName to match against circuits.json with ASCII fallback for unicode.
This commit is contained in:
@@ -4,9 +4,6 @@ from typing import Optional
|
||||
import functools
|
||||
from enum import Enum
|
||||
|
||||
# Import FastF1 for dynamic circuit data
|
||||
import fastf1
|
||||
|
||||
from ergast_service import ErgastService
|
||||
from models.circuit import Circuit
|
||||
from models.country import Country
|
||||
@@ -35,9 +32,6 @@ class CircuitService:
|
||||
logging.basicConfig(level=logging.INFO)
|
||||
self.logger = logging.getLogger(__name__)
|
||||
|
||||
# Initialize FastF1 cache
|
||||
fastf1.Cache.enable_cache('cache')
|
||||
|
||||
@functools.lru_cache()
|
||||
def _load_circuit_data(self) -> dict[str, Country]:
|
||||
"""Load and cache circuit data"""
|
||||
|
||||
Reference in New Issue
Block a user