update dependencies, add songs to youtube playlist

This commit is contained in:
2025-07-01 16:01:19 +02:00
parent 3c6e742e43
commit b7a930c69a
12 changed files with 652 additions and 265 deletions

View File

@ -0,0 +1,24 @@
import { log } from '$lib/log';
import { YoutubePlaylistAdder } from '$lib/server/ytPlaylistAdder';
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
export const load: PageServerLoad = async ({ url }) => {
const adder = new YoutubePlaylistAdder();
if (url.searchParams.has('code')) {
log.debug(url.searchParams);
await adder.receivedAuthCode(url.searchParams.get('code') || '', url);
redirect(307, '/');
} else if (url.searchParams.has('error')) {
log.error('received error', url.searchParams.get('error'));
return;
}
if (await adder.authCodeExists()) {
redirect(307, '/');
}
const authUrl = adder.constructAuthUrl(url);
log.debug('+page.server.ts', authUrl.toString());
redirect(307, authUrl);
};

View File

@ -0,0 +1,2 @@
<h1>Hello and welcome to my site!</h1>
<a href="/about">About my site</a>