fix: custom games sometimes available in match-v5 endpoint

This commit is contained in:
Valentin Kaelin 2022-02-27 15:24:46 +01:00
parent 565682aff7
commit 0a563b52ec
3 changed files with 9 additions and 2 deletions

View file

@ -1,6 +1,10 @@
export const maps = { 10: 'The Twisted Treeline', 11: "Summoner's Rift", 12: 'Howling Abyss' }
export const gameModes = {
0: {
type: 'Custom',
name: 'Custom Game'
},
900: {
type: 'Normal',
name: 'URF',

View file

@ -7,7 +7,9 @@ import { PlayerRankParsed } from './ParsedType'
class MatchPlayerRankParser {
public async parse(match: Match): Promise<PlayerRankParsed[]> {
const requests = match.players.map((p) => SummonerService.getRanked(p.summonerId, match.region))
const requests = match.players
.filter((p) => p.summonerPuuid !== 'BOT')
.map((p) => SummonerService.getRanked(p.summonerId, match.region))
const ranks = await Promise.all(requests)
const parsedRanks = ranks

View file

@ -136,7 +136,8 @@ class MatchService {
(m) =>
!tutorialQueues.includes(m.info.queueId) &&
m.info.teams.length > 0 &&
m.info.participants.length > 0
m.info.participants.length > 0 &&
m.info.gameMode !== 'PRACTICETOOL'
)
// Transform raw matches data