songs fix zod number stuff

This commit is contained in:
2026-02-06 10:35:45 -08:00
parent 0faf98ee80
commit 006a03816a
2 changed files with 2 additions and 8 deletions

View File

@@ -7,7 +7,6 @@
import { db as clientDb } from "$lib/db/client-db"; import { db as clientDb } from "$lib/db/client-db";
import { addAllToQueue, playAllNext } from "$lib/player/player.svelte"; import { addAllToQueue, playAllNext } from "$lib/player/player.svelte";
import { trackFromSongRow } from "$lib/player/types"; import { trackFromSongRow } from "$lib/player/types";
import { SongCategoryMap, SongTypeReverseMap } from "$lib/utils/amq";
import type { PageData } from "./$types"; import type { PageData } from "./$types";
import { SearchParamsSchema } from "./schema"; import { SearchParamsSchema } from "./schema";
@@ -34,11 +33,6 @@
return r.artistName ?? r.groupName ?? null; return r.artistName ?? r.groupName ?? null;
} }
// Helper to map song type number back to string for UI display
function getSongTypeLabel(type: number): string {
return SongTypeReverseMap[type] || `Type ${type}`;
}
const tracksFromResults = $derived.by(() => const tracksFromResults = $derived.by(() =>
data.songRows data.songRows
.map((r) => .map((r) =>

View File

@@ -4,6 +4,6 @@ export const SearchParamsSchema = z.object({
song: z.string().optional().default(""), song: z.string().optional().default(""),
artist: z.string().optional().default(""), artist: z.string().optional().default(""),
anime: z.string().optional().default(""), anime: z.string().optional().default(""),
gpm: z.int().optional().default(0), gpm: z.coerce.number().int().optional().default(0),
gpx: z.int().optional().default(100), gpx: z.coerce.number().int().optional().default(100),
}); });