mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: custom games sometimes available in match-v5 endpoint
This commit is contained in:
parent
565682aff7
commit
0a563b52ec
3 changed files with 9 additions and 2 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
export const maps = { 10: 'The Twisted Treeline', 11: "Summoner's Rift", 12: 'Howling Abyss' }
|
export const maps = { 10: 'The Twisted Treeline', 11: "Summoner's Rift", 12: 'Howling Abyss' }
|
||||||
|
|
||||||
export const gameModes = {
|
export const gameModes = {
|
||||||
|
0: {
|
||||||
|
type: 'Custom',
|
||||||
|
name: 'Custom Game'
|
||||||
|
},
|
||||||
900: {
|
900: {
|
||||||
type: 'Normal',
|
type: 'Normal',
|
||||||
name: 'URF',
|
name: 'URF',
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,9 @@ import { PlayerRankParsed } from './ParsedType'
|
||||||
|
|
||||||
class MatchPlayerRankParser {
|
class MatchPlayerRankParser {
|
||||||
public async parse(match: Match): Promise<PlayerRankParsed[]> {
|
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 ranks = await Promise.all(requests)
|
||||||
|
|
||||||
const parsedRanks = ranks
|
const parsedRanks = ranks
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,8 @@ class MatchService {
|
||||||
(m) =>
|
(m) =>
|
||||||
!tutorialQueues.includes(m.info.queueId) &&
|
!tutorialQueues.includes(m.info.queueId) &&
|
||||||
m.info.teams.length > 0 &&
|
m.info.teams.length > 0 &&
|
||||||
m.info.participants.length > 0
|
m.info.participants.length > 0 &&
|
||||||
|
m.info.gameMode !== 'PRACTICETOOL'
|
||||||
)
|
)
|
||||||
|
|
||||||
// Transform raw matches data
|
// Transform raw matches data
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue