web-player: normalize tracks, albums and playlists into single domain types at the server boundary

This commit is contained in:
2026-09-24 05:09:37 +02:00
parent 37fc229bf6
commit 5b2a0e4d46
41 changed files with 526 additions and 452 deletions
@@ -1,5 +1,6 @@
import type { PageServerLoad, Actions } from './$types';
import { createApiClient, requireUser, unwrapOrError } from '$lib/server/api';
import { toMix } from '$lib/server/mappers';
import { addTrackAction } from '$lib/server/playlistActions';
export const load: PageServerLoad = async ({ params, locals, url, fetch }) => {
@@ -8,7 +9,7 @@ export const load: PageServerLoad = async ({ params, locals, url, fetch }) => {
const mixRes = await api.GET('/mixes/{id}', { params: { path: { id: params.id } } });
return { mix: unwrapOrError(mixRes, 'Mezcla no encontrada.', 404) };
return { mix: toMix(unwrapOrError(mixRes, 'Mezcla no encontrada.', 404)) };
};
export const actions: Actions = {