Replace database with simple JSON file storage
This commit is contained in:
1 parent
e86d4d7d60
commit
491ac6628a
9 files changed
+208
-127
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { getDb } from '@/lib/db'
|
||||
import { db } from '@/lib/db'
|
||||
import { getStreamUrl } from '@/lib/ytdlp'
|
||||
import { streamCache } from '@/lib/cache'
|
||||
|
||||
@@ -11,8 +11,7 @@ export async function GET(
|
||||
const { id } = await params
|
||||
|
||||
// Get song from database
|
||||
const db = getDb()
|
||||
const song = db.prepare('SELECT * FROM songs WHERE id = ?').get(id) as any
|
||||
const song = db.getSongById(id)
|
||||
|
||||
if (!song) {
|
||||
return NextResponse.json(
|
||||
|
||||
Reference in new issue
Block a user