fix link to chickendinner

This commit is contained in:
2025-07-13 14:53:38 +10:00
parent 616e0d6c6c
commit b7fcfbf5cd
5 changed files with 298 additions and 289 deletions

View File

@ -1,7 +1,7 @@
from aburgess/node:22-npm as deps from aburgess/node:22-npm as deps
workdir /app workdir /app
add package.json pnpm-lock.yaml ./ add package.json pnpm-lock.yaml pnpm-workspace.yaml ./
run pnpm install --prod run pnpm install --prod
from deps as builder from deps as builder

View File

@ -5,19 +5,18 @@
"dependencies": { "dependencies": {
"@adamburgess/linq": "^3.0.0", "@adamburgess/linq": "^3.0.0",
"async-mutex": "^0.5.0", "async-mutex": "^0.5.0",
"better-sqlite3": "^11.7.0", "better-sqlite3": "^12.2.0",
"change-case": "^5.4.4", "change-case": "^5.4.4",
"dayjs": "^1.11.13", "dayjs": "^1.11.13",
"fastify": "^5.2.0", "fastify": "^5.4.0",
"knex": "^3.1.0", "knex": "^3.1.0",
"preact": "^10.25.3", "preact": "^10.26.9",
"preact-render-to-string": "^6.5.12" "preact-render-to-string": "^6.5.13"
}, },
"devDependencies": { "devDependencies": {
"@types/better-sqlite3": "^7.6.12", "@types/node": "^24.0.13",
"@types/node": "^22.10.2", "esbuild": "^0.25.6",
"esbuild": "^0.24.2", "typescript": "^5.8.3"
"typescript": "^5.7.2"
}, },
"scripts": { "scripts": {
"build": "esbuild src/*.ts src/*.tsx --outdir=dist --format=esm --platform=node" "build": "esbuild src/*.ts src/*.tsx --outdir=dist --format=esm --platform=node"

562
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

2
pnpm-workspace.yaml Normal file
View File

@ -0,0 +1,2 @@
onlyBuiltDependencies:
- better-sqlite3

View File

@ -67,6 +67,10 @@ function getChickenDinnerUrl(asset: Asset, player: PlayerResponse['data'][0]) {
return `https://chickendinner.gg/${url}?follow=${player.attributes.name}`; return `https://chickendinner.gg/${url}?follow=${player.attributes.name}`;
} }
function getChickenDinnerUrlv2(matchId: string, player: PlayerResponse['data'][0]) {
return `https://chickendinner.gg/${matchId}/${player.attributes.name}`;
}
function getRank(match: MatchResponse, playerId: string) { function getRank(match: MatchResponse, playerId: string) {
for (const player of match.included) { for (const player of match.included) {
if (player.type === 'participant' && player.attributes.stats.playerId === playerId) { if (player.type === 'participant' && player.attributes.stats.playerId === playerId) {
@ -118,7 +122,7 @@ li a { padding: 0 5px; }
<li>Links: <li>Links:
<a href={`/match/${match.id}`}>Raw</a> <a href={`/match/${match.id}`}>Raw</a>
<a href={`https://pubglookup.com/players/steam/${player.attributes.name.toLowerCase()}/matches/${match.id}`}>PUBGLookup</a> <a href={`https://pubglookup.com/players/steam/${player.attributes.name.toLowerCase()}/matches/${match.id}`}>PUBGLookup</a>
<a href={getChickenDinnerUrl(telemetry, player)}>map replay</a> <a href={getChickenDinnerUrlv2(match.id, player)}>map replay</a>
</li> </li>
</ul> </ul>
</div> </div>