remove unused logs

This commit is contained in:
2025-06-04 10:59:03 +02:00
parent 5270c16437
commit 4c0818f95f
3 changed files with 44 additions and 43 deletions

View File

@@ -16,10 +16,10 @@ import type React from 'react'
import { useState } from 'react'
import { GamesTable } from '@/app/(home)/players/[id]/_components/games-table'
import { TimeZoneProvider } from '@/components/timezone-provider'
import { MmrTrendChart } from '@/app/(home)/players/[id]/_components/mmr-trend-chart'
import { WinrateTrendChart } from '@/app/(home)/players/[id]/_components/winrate-trend-chart'
import { OpponentsTable } from '@/app/(home)/players/[id]/_components/opponents-table'
import { WinrateTrendChart } from '@/app/(home)/players/[id]/_components/winrate-trend-chart'
import { TimeZoneProvider } from '@/components/timezone-provider'
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
import { Badge } from '@/components/ui/badge'
import { Button } from '@/components/ui/button'
@@ -158,7 +158,6 @@ export function UserInfo() {
const lastVanillaGame = games
.filter((game) => game.gameType.toLowerCase() === 'vanilla')
.at(0)
console.log(games)
const avgOpponentMmr =
games
.filter(

View File

@@ -107,7 +107,6 @@ export function StreamCardClient() {
}
}
}
console.log(winsVsOpponent, lossesVsOpponent)
return (
<div
className={'flex items-center justify-between gap-2 font-m6x11'}

View File

@@ -22,9 +22,11 @@ export const history_router = createTRPCRouter({
}),
games_per_hour: publicProcedure
.input(
z.object({
z
.object({
groupBy: z.enum(['hour', 'day', 'week', 'month']).default('hour'),
}).optional()
})
.optional()
)
.query(async ({ ctx, input }) => {
const groupBy = input?.groupBy || 'hour'
@@ -42,7 +44,8 @@ export const history_router = createTRPCRouter({
const processedGameNums = new Set<number>()
// Group games by the selected time unit
const gamesByTimeUnit = games.reduce<Record<string, number>>((acc, game) => {
const gamesByTimeUnit = games.reduce<Record<string, number>>(
(acc, game) => {
if (!game.gameTime || !game.gameNum) return acc
// Skip if we've already processed this game number
@@ -80,7 +83,9 @@ export const history_router = createTRPCRouter({
acc[timeKey] = (acc[timeKey] || 0) + 1
return acc
}, {})
},
{}
)
// Convert to array format for chart
return Object.entries(gamesByTimeUnit).map(([timeUnit, count]) => ({
@@ -155,12 +160,10 @@ function processGameEntry(gameId: number, game_num: number, entry: any) {
return []
}
if (!parsedEntry.teams?.[0]?.[0] || !parsedEntry.teams?.[1]?.[0]) {
console.log('skipping game', parsedEntry)
return []
}
if (parsedEntry.winner === -2) {
console.log('skipping ongoing game', parsedEntry)
return []
}
const player0 = parsedEntry.teams[0][0]