From f2f62a30af1711f782cae7668792a492ac99b3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Moitie=CC=81?= Date: Mon, 11 Mar 2024 23:37:42 +0000 Subject: [PATCH] Updates for ring meister --- build/api/getSeason.js | 5 ++++- src/data/offWeeks.js | 12 ++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/api/getSeason.js b/build/api/getSeason.js index 85f6b31..8239e31 100644 --- a/build/api/getSeason.js +++ b/build/api/getSeason.js @@ -82,6 +82,9 @@ export default async function getSeason(cars: Array, tracks: Array { const carClasses = series.car_class_ids.map((carClassId) => carClassMap[carClassId]); const seriesCars = carClasses.reduce((carry, carClass) => { + if (carClass === undefined || carry[0] === null) { + return [null]; + } const carsInClass = carClass.cars_in_class.map((carInClass) => carMap[carInClass.car_id]); return [...carry, ...carsInClass]; }, []); @@ -112,7 +115,7 @@ export default async function getSeason(cars: Array, tracks: Array ({ shortname: carClass.short_name })), + carclasses: carClasses.map((carClass) => ({ shortname: carClass ? carClass.short_name : null })), cars: seriesCars.map(({ sku }) => ({ sku })), seasonid: series.season_id, }; diff --git a/src/data/offWeeks.js b/src/data/offWeeks.js index bd2efd2..005982e 100644 --- a/src/data/offWeeks.js +++ b/src/data/offWeeks.js @@ -174,13 +174,13 @@ export default { 4828: { offWeeks: [ 2.1, 3.1, 4.1, 5.1, 6.1, 8.1, 9.1, 12.1, 14.1, 14.1, 14.1, 16.1, 18.1, 18.1, 18.1, 21.1, 21.1, - ] + ], }, // 496 │ 4829 │ Road │ C │ Formula A - Grand Prix Tour - Fixed │ 2024-12-10 4829: { offWeeks: [ 2.1, 3.1, 4.1, 5.1, 6.1, 8.1, 9.1, 12.1, 14.1, 14.1, 14.1, 16.1, 18.1, 18.1, 18.1, 21.1, 21.1, - ] + ], }, // 374 │ 4831 │ Road │ C │ INDYCAR iRacing Series | 2024-09-17 4831: { @@ -188,8 +188,8 @@ export default { 1.1, 2.1, 2.1, 2.1, 4.1, 5.1, 8.1, 9.1, 12.1, 12.1, 12.1, 15.1, ], }, - // Prelim Draft Master - Fixed - 99998: { + // 538 │ 4822 │ Oval │ D │ Draft Master - Fixed + 4822: { carByWeek: [ [10068], // 1 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009 [10481, 10530, 10459], // 2 NASCAR Trucks @@ -219,8 +219,8 @@ export default { ['NASCAR 2022 NG'], // 12 NASCAR Next Gen ], }, - // Prelim Ring Meister - 99999: { + // 526 │ 4820 │ Sports Car │ C │ Ring Meister Ricmotech Series - Fixed + 4820: { carByWeek: [ [10306], // 1 Cadillac CTS-V Racecar [10548], // 2 Renault Clio