mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: remove tutorial games from history
This commit is contained in:
parent
b4a2edfd32
commit
f138db27a5
1 changed files with 10 additions and 10 deletions
|
|
@ -17,7 +17,7 @@ class MatchHelper {
|
||||||
do {
|
do {
|
||||||
let newMatchList = (await Jax.Matchlist.accountID(account.accountId, index)).matches
|
let newMatchList = (await Jax.Matchlist.accountID(account.accountId, index)).matches
|
||||||
matchList = [...matchList, ...newMatchList]
|
matchList = [...matchList, ...newMatchList]
|
||||||
alreadyIn = stopFetching(newMatchList)
|
alreadyIn = newMatchList.length === 0 || stopFetching(newMatchList)
|
||||||
// If the match is made in another region : we stop fetching
|
// If the match is made in another region : we stop fetching
|
||||||
if (matchList[matchList.length - 1].platformId.toLowerCase() !== account.region) {
|
if (matchList[matchList.length - 1].platformId.toLowerCase() !== account.region) {
|
||||||
alreadyIn = true;
|
alreadyIn = true;
|
||||||
|
|
@ -25,8 +25,15 @@ class MatchHelper {
|
||||||
index += 100
|
index += 100
|
||||||
} while (!alreadyIn);
|
} while (!alreadyIn);
|
||||||
|
|
||||||
// Remove matches from MatchList made in another region
|
// Remove matches from MatchList made in another region and tutorial games
|
||||||
matchList = matchList.filter(m => m.platformId.toLowerCase() === account.region)
|
const tutorialModes = [2000, 2010, 2020]
|
||||||
|
matchList = matchList
|
||||||
|
.filter(m => {
|
||||||
|
const sameRegion = m.platformId.toLowerCase() === account.region
|
||||||
|
const notATutorialGame = !tutorialModes.includes(m.queue)
|
||||||
|
|
||||||
|
return sameRegion && notATutorialGame
|
||||||
|
})
|
||||||
|
|
||||||
return matchList
|
return matchList
|
||||||
}
|
}
|
||||||
|
|
@ -103,16 +110,9 @@ class MatchHelper {
|
||||||
MatchHelper: this
|
MatchHelper: this
|
||||||
}
|
}
|
||||||
|
|
||||||
// matchesFromApi = await Bumblebee.create().collection(matchesFromApi)
|
|
||||||
// .transformWith(MatchTransformer)
|
|
||||||
// .withContext(ctx)
|
|
||||||
// .toJSON()
|
|
||||||
|
|
||||||
console.time('newTransformer')
|
|
||||||
matchesFromApi = matchesFromApi.map(m => {
|
matchesFromApi = matchesFromApi.map(m => {
|
||||||
if (m) return BasicMatchTransformer.transform(m, ctx)
|
if (m) return BasicMatchTransformer.transform(m, ctx)
|
||||||
})
|
})
|
||||||
console.timeEnd('newTransformer')
|
|
||||||
|
|
||||||
console.log(matchesFromApi.length)
|
console.log(matchesFromApi.length)
|
||||||
Logger.transport('file').info(matchesFromApi)
|
Logger.transport('file').info(matchesFromApi)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue