Sync layouts, typography, and watermark studio for self-hosted OSS.

Unlock features without credits/Stripe, point docs to docs.songs2vid.com, and drop leftover billing admin surfaces.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Songs2YT
2026-07-25 03:50:06 +02:00
co-authored by Cursor
parent bcca0a6e6f
commit d951ecb489
53 changed files with 3258 additions and 1977 deletions
+17 -4
View File
@@ -1,5 +1,6 @@
import { NextRequest, NextResponse } from "next/server";
import { saveUploadedFile } from "@/lib/jobs/create-job";
import { PremiumRequiredError, premiumRequiredResponse } from "@/lib/entitlements";
import { saveUploadedFile, type UploadFileType } from "@/lib/jobs/create-job";
import { getSessionUser } from "@/lib/session";
export const maxDuration = 120;
@@ -15,14 +16,26 @@ export async function POST(req: NextRequest) {
const type = formData.get("type") as string | null;
const sessionKey = (formData.get("session") as string | null)?.trim() || undefined;
if (!file || !type || (type !== "image" && type !== "audio")) {
return NextResponse.json({ error: "Missing file or type" }, { status: 400 });
if (
!file ||
!type ||
(type !== "image" && type !== "audio" && type !== "logo" && type !== "font")
) {
return NextResponse.json(
{ error: "Missing file or type (image | audio | logo | font)" },
{ status: 400 },
);
}
try {
const result = await saveUploadedFile(user.id, file, type, user.plan, { sessionKey });
const result = await saveUploadedFile(user.id, file, type as UploadFileType, user.plan, {
sessionKey,
});
return NextResponse.json(result);
} catch (err) {
if (err instanceof PremiumRequiredError) {
return NextResponse.json(premiumRequiredResponse(err.message), { status: 403 });
}
const message = err instanceof Error ? err.message : "Upload failed";
return NextResponse.json({ error: message }, { status: 400 });
}