fix: use new league endpoint by puuid

This commit is contained in:
Valentin Kaelin 2025-08-12 22:10:58 +02:00
parent f323395482
commit 9951048521
No known key found for this signature in database
GPG key ID: B389A4E3DFF8E414
5 changed files with 9 additions and 10 deletions

View file

@ -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),

View file

@ -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

View file

@ -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)

View file

@ -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()

View file

@ -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) {