From 3b3db375b55f8ba5b00daa240126f69f1493e1b7 Mon Sep 17 00:00:00 2001 From: Fabrice LAMANT Date: Wed, 4 Feb 2026 19:39:01 +0100 Subject: [PATCH] fix: cancelled event --- scraper/scraper.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scraper/scraper.ts b/scraper/scraper.ts index edb6da433..4be81b929 100644 --- a/scraper/scraper.ts +++ b/scraper/scraper.ts @@ -86,6 +86,9 @@ export class Scraper { for (const event of data.units) { + if (!event.endDate) { + continue; + } const { id: key } = event; if (!this.events.some((e) => e.key === key)) { this.events.push({ @@ -174,10 +177,11 @@ export class Scraper { } private setCompetitor(code: string, noc: string, name: string): void { - if (code && code !== "undefined") { - if (!this.competitors.some((c) => c.code === code)) { - this.competitors.push({ code, noc, name }); - } + if (!code) + return; + + if (!this.competitors.some((c) => c.code === code)) { + this.competitors.push({ code, noc, name }); } } @@ -186,6 +190,7 @@ export class Scraper { return; if (!this.nocs.some((n) => n.key === key)) { + console.log(key); this.nocs.push({ key, name: {} }); } const noc = this.nocs.find((n) => n.key === key)!;