diff --git a/server-v2/app/Services/MatchService.ts b/server-v2/app/Services/MatchService.ts index 6174495..3d48ece 100644 --- a/server-v2/app/Services/MatchService.ts +++ b/server-v2/app/Services/MatchService.ts @@ -105,10 +105,18 @@ class MatchService { /* If we have to store some matches in the db */ if (matchesFromApi.length !== 0) { + // Remove bugged matches from the Riot API + tutorial games + const filteredMatches = matchesFromApi + .filter(notEmpty) + .filter( + (m) => + !tutorialQueues.includes(m.info.queueId) && + m.info.teams.length > 0 && + m.info.participants.length > 0 + ) + // Transform raw matches data - const parsedMatches: any = await MatchParser.parse( - matchesFromApi.filter(notEmpty).filter((m) => !tutorialQueues.includes(m.info.queueId)) - ) + const parsedMatches: any = await MatchParser.parse(filteredMatches) // TODO: Serialize match from DB + put it in Redis + push it in "matches" const serializedMatches = BasicMatchSerializer.serialize(parsedMatches, puuid, true)