20 lines
449 B
TypeScript
20 lines
449 B
TypeScript
|
|
import { getRecording } from "$lib/services";
|
||
|
|
import type { Recording } from "$lib/types";
|
||
|
|
|
||
|
|
export async function load({ url, fetch }) {
|
||
|
|
const recordingId = url.searchParams.get("recording");
|
||
|
|
|
||
|
|
let recording: Recording | null = null;
|
||
|
|
if (recordingId) {
|
||
|
|
try {
|
||
|
|
recording = await getRecording(recordingId, fetch);
|
||
|
|
} catch (error) {
|
||
|
|
console.error("Failed to load recording:", error);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
return {
|
||
|
|
recording,
|
||
|
|
};
|
||
|
|
}
|