songs fix zod number stuff
This commit is contained in:
@@ -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) =>
|
||||||
|
|||||||
@@ -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),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user