diff --git a/js/processor.js b/js/processor.js index 93f1b98..52a7666 100644 --- a/js/processor.js +++ b/js/processor.js @@ -34,14 +34,24 @@ getEnhancedLapDataPerDriver: function(raceData) { //Attach Qualifying Data lapData.qualifying = processor.getQualifyingForDriver(raceData, driver); //add Qualifying Data to the Laps - lapData.laps.push({'driverId': driver.driverId, 'lap': 0, 'position': lapData.qualifying.position}) + var lap0 = {'driverId': driver.driverId, 'lap': 0, 'position': lapData.qualifying.position}; + var endResult = raceData.results.filter(res => res.driverId == driver.driverId && res.laps == 0); + if(endResult.length > 0){ + lap0.finished = endResult[0]; + } + lapData.laps.push(lap0); raceData.lapTimes.forEach(lap => { lap.forEach(curLap => { if( curLap.driverId == driver.driverId ){ var pitstop = raceData.pitStops.filter(pitstop => pitstop.driverId == driver.driverId && pitstop.lap == curLap.lap); + var endResult = raceData.results.filter(res => res.driverId == driver.driverId && res.laps == curLap.lap); if(pitstop.length > 0){ curLap.pitStop = pitstop[0]; } + if(endResult.length > 0){ + curLap.finished = endResult[0]; + } + lapData.laps.push(curLap); } }); diff --git a/python3_run.bat b/python3_run.bat new file mode 100644 index 0000000..f4e3ade --- /dev/null +++ b/python3_run.bat @@ -0,0 +1 @@ +python -m http.server \ No newline at end of file