mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
fix: matchlist order
This commit is contained in:
parent
134cbfad0b
commit
e3f6103a0d
2 changed files with 5 additions and 6 deletions
|
|
@ -70,7 +70,9 @@ class MatchParser {
|
|||
console.log('CHAMPION ID NOT FOUND: ' + player.championId)
|
||||
console.log('FROM MATCH ' + match.metadata.matchId)
|
||||
const championId = Object.keys(CDragonService.champions).find(
|
||||
(key) => CDragonService.champions[key].name === player.championName
|
||||
(key) =>
|
||||
CDragonService.champions[key].name === player.championName ||
|
||||
CDragonService.champions[key].alias === player.championName
|
||||
)
|
||||
player.championId = championId ? Number(championId) : 1
|
||||
console.log('CHAMPION ID FROM NAME : ' + championId)
|
||||
|
|
|
|||
|
|
@ -43,10 +43,7 @@ class MatchService {
|
|||
public async updateMatchList(account: SummonerDTO, summonerDB: Summoner): Promise<MatchlistDto> {
|
||||
console.time('matchList')
|
||||
|
||||
const currentMatchList = await summonerDB
|
||||
.related('matchList')
|
||||
.query()
|
||||
.orderBy('matchId', 'desc')
|
||||
const currentMatchList = await summonerDB.related('matchList').query().orderBy('matchId', 'asc')
|
||||
const currentMatchListIds = currentMatchList.map((m) => m.matchId)
|
||||
|
||||
const newMatchList = await this._fetchMatchListUntil(account, (newMatchList: MatchlistDto) => {
|
||||
|
|
@ -72,7 +69,7 @@ class MatchService {
|
|||
}
|
||||
|
||||
console.timeEnd('matchList')
|
||||
return currentMatchListIds
|
||||
return currentMatchListIds.reverse()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue