mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: use new names in matches too
This commit is contained in:
parent
204d38a274
commit
4b7b83827d
7 changed files with 13 additions and 12 deletions
|
|
@ -186,13 +186,13 @@
|
||||||
'font-semibold text-yellow-400': account.id === player.summonerId,
|
'font-semibold text-yellow-400': account.id === player.summonerId,
|
||||||
}"
|
}"
|
||||||
class="text-overflow w-[5.5rem] overflow-hidden whitespace-nowrap text-left text-xs text-white hover:text-blue-200"
|
class="text-overflow w-[5.5rem] overflow-hidden whitespace-nowrap text-left text-xs text-white hover:text-blue-200"
|
||||||
>{{ player.name }}</router-link
|
>{{ player.name.replace('-', '#') }}</router-link
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="text-overflow w-[5.5rem] overflow-hidden whitespace-nowrap text-left text-xs text-white"
|
class="text-overflow w-[5.5rem] overflow-hidden whitespace-nowrap text-left text-xs text-white"
|
||||||
>
|
>
|
||||||
{{ player.name }}
|
{{ player.name.replace('-', '#') }}
|
||||||
</div>
|
</div>
|
||||||
<div class="text-xxs text-teal-500">
|
<div class="text-xxs text-teal-500">
|
||||||
{{ player.champion.name }}
|
{{ player.champion.name }}
|
||||||
|
|
|
||||||
|
|
@ -141,14 +141,14 @@
|
||||||
}"
|
}"
|
||||||
:class="isSummonerProfile(ally.account_id)"
|
:class="isSummonerProfile(ally.account_id)"
|
||||||
class="text-overflow w-16 overflow-hidden whitespace-nowrap text-right text-xs font-medium hover:text-white"
|
class="text-overflow w-16 overflow-hidden whitespace-nowrap text-right text-xs font-medium hover:text-white"
|
||||||
>{{ ally.name }}</router-link
|
>{{ ally.name.replace('-', '#') }}</router-link
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
:class="isSummonerProfile(ally.account_id)"
|
:class="isSummonerProfile(ally.account_id)"
|
||||||
class="text-overflow w-16 overflow-hidden whitespace-nowrap text-right text-xs font-medium"
|
class="text-overflow w-16 overflow-hidden whitespace-nowrap text-right text-xs font-medium"
|
||||||
>
|
>
|
||||||
{{ ally.name }}
|
{{ ally.name.replace('-', '#') }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
:class="index !== 0 ? '-mt-1' : ''"
|
:class="index !== 0 ? '-mt-1' : ''"
|
||||||
|
|
@ -175,13 +175,13 @@
|
||||||
params: { region: $route.params.region, name: data.enemyTeam[index].name },
|
params: { region: $route.params.region, name: data.enemyTeam[index].name },
|
||||||
}"
|
}"
|
||||||
class="text-overflow ml-1 w-16 overflow-hidden whitespace-nowrap text-left text-xs font-medium text-blue-200 hover:text-white"
|
class="text-overflow ml-1 w-16 overflow-hidden whitespace-nowrap text-left text-xs font-medium text-blue-200 hover:text-white"
|
||||||
>{{ data.enemyTeam[index].name }}</router-link
|
>{{ data.enemyTeam[index].name.replace('-', '#') }}</router-link
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-else
|
v-else
|
||||||
class="text-overflow ml-1 w-16 overflow-hidden whitespace-nowrap text-left text-xs font-medium text-blue-200"
|
class="text-overflow ml-1 w-16 overflow-hidden whitespace-nowrap text-left text-xs font-medium text-blue-200"
|
||||||
>
|
>
|
||||||
{{ data.enemyTeam[index].name }}
|
{{ data.enemyTeam[index].name.replace('-', '#') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
<router-link
|
<router-link
|
||||||
:to="{ name: 'summoner', params: { region: $route.params.region, name: mate.name } }"
|
:to="{ name: 'summoner', params: { region: $route.params.region, name: mate.name } }"
|
||||||
class="w-2/4 truncate hover:text-teal-200"
|
class="w-2/4 truncate hover:text-teal-200"
|
||||||
>{{ mate.name }}</router-link
|
>{{ mate.name.replace('-', '#') }}</router-link
|
||||||
>
|
>
|
||||||
<div class="w-1/4">{{ mate.wins }} / {{ mate.losses }}</div>
|
<div class="w-1/4">{{ mate.wins }} / {{ mate.losses }}</div>
|
||||||
<div class="w-1/4">
|
<div class="w-1/4">
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@
|
||||||
<Tooltip>
|
<Tooltip>
|
||||||
<template #trigger>
|
<template #trigger>
|
||||||
<h1 class="text-4xl font-extrabold">
|
<h1 class="text-4xl font-extrabold">
|
||||||
{{ basic.account.name }}
|
{{ basic.account.name + '#' + basic.account.tagLine }}
|
||||||
</h1>
|
</h1>
|
||||||
</template>
|
</template>
|
||||||
<template #default>
|
<template #default>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import Database, { TransactionClientContract } from '@ioc:Adonis/Lucid/Database'
|
import Database, { TransactionClientContract } from '@ioc:Adonis/Lucid/Database'
|
||||||
import { MatchDto } from 'App/Services/Jax/src/Endpoints/MatchEndpoint'
|
import { MatchDto } from 'App/Services/Jax/src/Endpoints/MatchEndpoint'
|
||||||
import Match from 'App/Models/Match'
|
import Match from 'App/Models/Match'
|
||||||
import { getSeasonNumber, queuesWithRole } from 'App/helpers'
|
import { ACCOUNT_NAME_DELIMITER, getSeasonNumber, queuesWithRole } from 'App/helpers'
|
||||||
import CDragonService from 'App/Services/CDragonService'
|
import CDragonService from 'App/Services/CDragonService'
|
||||||
import { ChampionRoles, TeamPosition } from './ParsedType'
|
import { ChampionRoles, TeamPosition } from './ParsedType'
|
||||||
class MatchParser {
|
class MatchParser {
|
||||||
|
|
@ -106,7 +106,7 @@ class MatchParser {
|
||||||
participant_id: player.participantId,
|
participant_id: player.participantId,
|
||||||
summoner_id: player.summonerId,
|
summoner_id: player.summonerId,
|
||||||
summoner_puuid: player.puuid,
|
summoner_puuid: player.puuid,
|
||||||
summoner_name: player.summonerName || player.riotIdGameName,
|
summoner_name: player.riotIdGameName + ACCOUNT_NAME_DELIMITER + player.riotIdTagline,
|
||||||
win: team.win ? 1 : 0,
|
win: team.win ? 1 : 0,
|
||||||
loss: team.win ? 0 : 1,
|
loss: team.win ? 0 : 1,
|
||||||
remake: isRemake ? 1 : 0,
|
remake: isRemake ? 1 : 0,
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ export interface SummonerDTO {
|
||||||
|
|
||||||
export interface SummonerDTOExtended extends SummonerDTO {
|
export interface SummonerDTOExtended extends SummonerDTO {
|
||||||
name: string
|
name: string
|
||||||
|
tagLine: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class SummonerEndpoint {
|
export default class SummonerEndpoint {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class SummonerService {
|
||||||
|
|
||||||
if (account) {
|
if (account) {
|
||||||
const summoner = await Jax.Summoner.summonerPuuid(account.puuid, region)
|
const summoner = await Jax.Summoner.summonerPuuid(account.puuid, region)
|
||||||
return { ...summoner, name: account.gameName }
|
return { ...summoner, name: account.gameName, tagLine: account.tagLine }
|
||||||
}
|
}
|
||||||
|
|
||||||
return null
|
return null
|
||||||
|
|
@ -93,7 +93,7 @@ class SummonerService {
|
||||||
*/
|
*/
|
||||||
public async getAllSummonerNames(account: SummonerDTOExtended, summonerDB: Summoner) {
|
public async getAllSummonerNames(account: SummonerDTOExtended, summonerDB: Summoner) {
|
||||||
await summonerDB.related('names').firstOrCreate({
|
await summonerDB.related('names').firstOrCreate({
|
||||||
name: account.name,
|
name: account.name + ACCOUNT_NAME_DELIMITER + account.tagLine,
|
||||||
})
|
})
|
||||||
return summonerDB.related('names').query().select('name', 'created_at')
|
return summonerDB.related('names').query().select('name', 'created_at')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue