Skip to content

Commit

Permalink
Prepare S2 update and add preliminary ringmaster/draftmaster content
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Moitié committed Mar 10, 2024
1 parent 230d6b5 commit d840435
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 3 deletions.
12 changes: 12 additions & 0 deletions build/api/getCarClasses.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { clientGet } from './iracingClient';

// Only used to help get Ring Meister / Draftmaster in check
export default async function getCarClasses() {
const carClassResponse = await clientGet('/data/carclass/get');
return carClassResponse.data.map((carClass) => ({
id: carClass.id,
cars_in_class: carClass.cars_in_class,
name: carClass.car_name,
short_name: carClass.short_name,
}));
}
7 changes: 7 additions & 0 deletions build/scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import getContributors from './api/getContributors';
import getCars from './api/getCars';
import getTracks from './api/getTracks';
import getSeason from './api/getSeason';
import getCarClasses from './api/getCarClasses';

(async () => {
const username = process.env.IWP_USERNAME || 'test';
Expand Down Expand Up @@ -33,4 +34,10 @@ import getSeason from './api/getSeason';
path.join(__dirname, '../src/data/contributors.json'),
JSON.stringify(contributors, null, 2),
);

const carClasses = await getCarClasses();
await writeFile(
path.join(__dirname, '../src/data/car-class.json'),
JSON.stringify(carClasses, null, 2),
);
})();
6 changes: 3 additions & 3 deletions src/config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import moment from 'moment';

export const seasonStart = moment('2023-12-12T00:00:00+00:00').utc();
export const seasonEnd = moment('2024-03-11T00:00:00+00:00').utc();
export const weekSeasonStart = moment('2023-12-12T00:00:00+00:00').utc();
export const seasonStart = moment('2024-03-12T00:00:00+00:00').utc();
export const seasonEnd = moment('2024-06-10T00:00:00+00:00').utc();
export const weekSeasonStart = moment('2024-03-12T00:00:00+00:00').utc();

export const firebaseConfig = {
apiKey: 'AIzaSyAWNRqHLhhvhzKl0gkKybocd0nAk2eTlVg',
Expand Down
5 changes: 5 additions & 0 deletions src/data/changelog.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import moment from 'moment';

export default [{
date: moment('2024-03-12 00:00:00').utc(),
items: [
'Update to 2024S2',
],
}, {
date: moment('2024-03-06 00:00:00').utc(),
items: [
'Update with new categories',
Expand Down
62 changes: 62 additions & 0 deletions src/data/offWeeks.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,4 +229,66 @@ 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: {
carByWeek: [
[10068], // 1 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009
[10481, 10530, 10459], // 2 NASCAR Trucks
[10527, 10482, 10483, 10566], // 3 NASCAR Classic 1987
[10503, 10504, 10505], // 4 NASCAR Next Gen
[10068], // 5 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009
[10481, 10530, 10459], // 6 NASCAR Trucks
[10527, 10482, 10483, 10566], // 7 NASCAR Classic 1987
[10503, 10504, 10505], // 8 NASCAR Next Gen
[10068], // 9 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009
[10481, 10530, 10459], // 10 NASCAR Trucks
[10527, 10482, 10483, 10566], // 11 NASCAR Classic 1987
[10503, 10504, 10505], // 12 NASCAR Next Gen
],
carClassShortNameByWeek: [
['[Legacy] NASCAR Cup Chevrolet Impala COT - 2009'], // 1 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009
['NASCAR Trucks'], // 2 NASCAR Trucks
['NASCAR 1987'], // 3 NASCAR Classic 1987
['NASCAR 2022 NG'], // 4 NASCAR Next Gen
['[Legacy] NASCAR Cup Chevrolet Impala COT - 2009'], // 5 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009
['NASCAR Trucks'], // 6 NASCAR Trucks
['NASCAR 1987'], // 7 NASCAR Classic 1987
['NASCAR 2022 NG'], // 8 NASCAR Next Gen
['[Legacy] NASCAR Cup Chevrolet Impala COT - 2009'], // 9 [Legacy] NASCAR Cup Chevrolet Impala COT - 2009
['NASCAR Trucks'], // 10 NASCAR Trucks
['NASCAR 1987'], // 11 NASCAR Classic 1987
['NASCAR 2022 NG'], // 12 NASCAR Next Gen
],
},
// Prelim Ring Meister
99999: {
carByWeek: [
[10306], // 1 Cadillac CTS-V Racecar
[10548], // 2 Renault Clio
[10552], // 3 Ligier JS P320
[10110], // 4 Lotus 79
[10517], // 5 Honda Civic Type R TCR
[10457], // 6 BMW M8 GTE
[10524], // 7 Stock Car Brasil Chevrolet Cruze
[10394], // 8 Global Mazda MX-5 Cup
[10113], // 9 Chevrolet Corvette C6.R GT
[10563], // 10 Ferrari 296 GT3
[10040], // 11 Radical SR8
[999999], // 12 ??????
],
carClassShortNameByWeek: [
['Cadillac CTS-VR'], // 1 Cadillac CTS-V Racecar
['Renault Clio'], // 2 Renault Clio
['Ligier JS P320'], // 3 Ligier JS P320
['Lotus 79'], // 4 Lotus 79
['Civic Type R'], // 5 Honda Civic Type R TCR
['BMW M8 GTE'], // 6 BMW M8 GTE
['Stock Car Brasil'], // 7 Stock Car Brasil Chevrolet Cruze
['MX5 Cup 2016'], // 8 Global Mazda MX-5 Cup
['C6R GT1'], // 9 Chevrolet Corvette C6.R GT
['Ferrari 296 GT3'], // 10 Ferrari 296 GT3
['SR8'], // 11 Radical SR8
[999999], // 12 ?????
],
},
};

0 comments on commit d840435

Please sign in to comment.