fix: singing bowls ambient + Next.js 16 async params/cookies

Ambient:
- Replace oscillator drone/melody with singing bowl synthesis
- Each bowl: instant attack + exponential decay (7–12s) = real physical sound
- Two detuned copies per strike for natural shimmer beat
- A-minor pentatonic (A3 C4 D4 E4 G4 A4 C5 E5), weighted toward warm lows
- 30% chance of soft harmonic fifth companion tone per strike
- Random gaps 3–8s between strikes so it breathes naturally
- Two long hall reverb tails (2.4s / 4.8s) for warmth and space
- Graceful 2.5s fade-out on stop

Next.js 16 compatibility (breaking changes from v14→v16):
- Dynamic route params now Promise<{...}> → await params in all handlers
- cookies() now returns Promise → isAdmin() made async, await cookies()
- Files: [...path], memories/[id], media/[id], auth, upload all updated

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
denshooter
2026-02-16 02:44:45 +01:00
parent 00abbfda51
commit 313b5ff7fd
7 changed files with 113 additions and 166 deletions
+4 -5
View File
@@ -8,8 +8,9 @@ import { getDb } from '@/lib/db'
export const runtime = 'nodejs'
export const maxDuration = 60
function isAdmin() {
const token = cookies().get('admin_auth')?.value
async function isAdmin() {
const cookieStore = await cookies()
const token = cookieStore.get('admin_auth')?.value
const expected = createHash('sha256')
.update(process.env.ADMIN_PASSWORD || 'change-me')
.digest('hex')
@@ -46,7 +47,7 @@ const FOLDER_TO_TYPE: Record<string, 'photo' | 'video' | 'music'> = {
}
export async function POST(req: NextRequest) {
if (!isAdmin()) {
if (!await isAdmin()) {
return NextResponse.json({ error: 'Unauthorized' }, { status: 401 })
}
@@ -58,11 +59,9 @@ export async function POST(req: NextRequest) {
return NextResponse.json({ error: 'Keine Datei' }, { status: 400 })
}
// Try to detect type from mime or extension
let mimeType = file.type?.toLowerCase() || ''
const ext = path.extname(file.name).toLowerCase()
// iOS HEIC fallback
if (!mimeType && (ext === '.heic' || ext === '.heif')) {
mimeType = 'image/heic'
}