Fixing build error
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
apatil 2025-05-07 15:32:50 +01:00
parent a76da7efde
commit 05828d5947

View File

@ -4,9 +4,10 @@ import path from 'path';
import { NextRequest } from 'next/server'; import { NextRequest } from 'next/server';
const MUSIC_DIR = '/app/music'; const MUSIC_DIR = '/app/music';
export async function GET(req: NextRequest, { params }: { params: { track: string } }) { export async function GET(req: NextRequest, { params }: { params: Promise<{ track: string }> }) {
const track = decodeURIComponent(params.track); const track = (await params).track;
const filePath = path.join(MUSIC_DIR, track); const decodedTrack = decodeURIComponent(track);
const filePath = path.join(MUSIC_DIR, decodedTrack);
if (!fs.existsSync(filePath)) { if (!fs.existsSync(filePath)) {
return new Response('Not Found', { status: 404 }); return new Response('Not Found', { status: 404 });
} }