mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: remove bugged matches from Riot match-v5 too
This commit is contained in:
parent
f19efcbd19
commit
38439d8b9c
1 changed files with 11 additions and 3 deletions
|
|
@ -105,11 +105,19 @@ class MatchService {
|
|||
|
||||
/* If we have to store some matches in the db */
|
||||
if (matchesFromApi.length !== 0) {
|
||||
// Transform raw matches data
|
||||
const parsedMatches: any = await MatchParser.parse(
|
||||
matchesFromApi.filter(notEmpty).filter((m) => !tutorialQueues.includes(m.info.queueId))
|
||||
// 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(filteredMatches)
|
||||
|
||||
// TODO: Serialize match from DB + put it in Redis + push it in "matches"
|
||||
const serializedMatches = BasicMatchSerializer.serialize(parsedMatches, puuid, true)
|
||||
matches.push(...serializedMatches)
|
||||
|
|
|
|||
Loading…
Reference in a new issue