games: split Call of Duty into one entry per title and Pokémon into one per generation (remakes and spin-offs separate), full names, official logo for each (Steam icons / English logos); data migration moves bo2 status+aliases to black-ops-2; /trackers/games/bo2 and /pokemon redirect; three-column games flyout
All checks were successful
Deploy production / deploy (push) Successful in 1m16s
All checks were successful
Deploy production / deploy (push) Successful in 1m16s
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { error } from '@sveltejs/kit';
|
||||
import { error, redirect } from '@sveltejs/kit';
|
||||
import { eq, inArray } from 'drizzle-orm';
|
||||
import { db } from '#lib/server/db/index.js';
|
||||
import { gameLibrary, hardwareSensitivities } from '#lib/server/db/schema/index.js';
|
||||
@@ -9,8 +9,17 @@ import type { PageServerLoad } from './$types';
|
||||
// One game from games.library, plus its mouse sensitivity (hardware.sensitivities, matched by
|
||||
// name, short name or alias) when there is one. CS2, PUBG and R6 also get their automatic
|
||||
// match history (games.matches, filled by the in-app poller).
|
||||
// Old single entries, split per title/generation: bo2 became black-ops-2, and the Pokémon
|
||||
// entry (all generations) now points at the Pokémon journal that covers every game.
|
||||
const MOVED: Record<string, string> = {
|
||||
bo2: '/trackers/games/black-ops-2',
|
||||
pokemon: '/projects/game-tracker/pokemon'
|
||||
};
|
||||
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
const { params } = event;
|
||||
const moved = MOVED[params.slug];
|
||||
if (moved) redirect(301, moved);
|
||||
const [game] = await db.select().from(gameLibrary).where(eq(gameLibrary.slug, params.slug));
|
||||
if (!game) error(404, 'Not Found');
|
||||
const names = [game.name, game.shortName, ...game.aliases];
|
||||
|
||||
Reference in New Issue
Block a user