mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 04:47:27 +00:00
fix: use new league endpoint by puuid
This commit is contained in:
parent
f323395482
commit
9951048521
5 changed files with 9 additions and 10 deletions
|
|
@ -49,7 +49,7 @@ export default class SummonersController {
|
|||
this.getSeasons(account.puuid),
|
||||
MatchRepository.gamemodes(account.puuid),
|
||||
Jax.Spectator.puuid(account.puuid, region),
|
||||
SummonerService.getRanked(account.id, region),
|
||||
SummonerService.getRanked(account.puuid, region),
|
||||
MatchRepository.recentActivity(account.puuid),
|
||||
// Only last 100 matchIds in matchlist
|
||||
MatchService.updateMatchList(account.puuid, region, MatchListMode.LIGHT),
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ class MatchPlayerRankParser {
|
|||
public async parse(match: Match): Promise<PlayerRankParsed[]> {
|
||||
const requests = match.players
|
||||
.filter((p) => p.summonerPuuid !== 'BOT')
|
||||
.map((p) => SummonerService.getRanked(p.summonerId, match.region))
|
||||
.map((p) => SummonerService.getRanked(p.summonerPuuid, match.region))
|
||||
const ranks = await Promise.all(requests)
|
||||
|
||||
const parsedRanks = ranks
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class LiveMatchSerializer extends MatchSerializer {
|
|||
|
||||
// Ranks
|
||||
const requestsRanks = liveMatch.participants.map((p) =>
|
||||
SummonerService.getRanked(p.summonerId, region)
|
||||
SummonerService.getRanked(p.puuid, region)
|
||||
)
|
||||
const ranks = await Promise.all(requestsRanks)
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ export interface LeagueEntryDTO {
|
|||
queueType: string
|
||||
tier: string
|
||||
rank: string
|
||||
summonerId: string
|
||||
summonerName: string
|
||||
puuid: string
|
||||
leaguePoints: number
|
||||
wins: number
|
||||
losses: number
|
||||
|
|
@ -36,11 +35,11 @@ export default class LeagueEndpoint {
|
|||
this.limiter = limiter
|
||||
}
|
||||
|
||||
public summonerID(summonerID: string, region: string): Promise<LeagueEntryDTO[]> {
|
||||
public puuid(puuid: string, region: string): Promise<LeagueEntryDTO[]> {
|
||||
return new JaxRequest(
|
||||
region,
|
||||
this.config,
|
||||
`league/v4/entries/by-summoner/${summonerID}`,
|
||||
`league/v4/entries/by-puuid/${puuid}`,
|
||||
this.limiter,
|
||||
300
|
||||
).execute()
|
||||
|
|
|
|||
|
|
@ -100,11 +100,11 @@ class SummonerService {
|
|||
|
||||
/**
|
||||
* Get ranked data for a specific Summoner
|
||||
* @param account
|
||||
* @param puuid
|
||||
* @param region
|
||||
*/
|
||||
public async getRanked(summonerId: string, region: string): Promise<LeagueEntriesByQueue> {
|
||||
const ranked = await Jax.League.summonerID(summonerId, region)
|
||||
public async getRanked(puuid: string, region: string): Promise<LeagueEntriesByQueue> {
|
||||
const ranked = await Jax.League.puuid(puuid, region)
|
||||
const result: LeagueEntriesByQueue = {}
|
||||
|
||||
if (ranked && ranked.length) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue