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