@@ -2,11 +2,11 @@ import type { AwsRegion } from "@remotion/lambda/client";
22import { renderMediaOnLambda } from "@remotion/lambda/client" ;
33import type { Project } from "@workspace/compositions/project" ;
44import { NextResponse } from "next/server" ;
5- import { consumeRender } from "@/lib/account" ;
6- import { authenticateApiKey } from "@/lib/api-keys" ;
75import type { ExportOptions } from "@/features/studio/lib/export-options" ;
86import { prepareProjectForExport } from "@/features/studio/lib/prepare-export-project" ;
97import { rewriteExternalImageUrls } from "@/features/studio/lib/proxy-external-images" ;
8+ import { consumeRender } from "@/lib/account" ;
9+ import { authenticateApiKey } from "@/lib/api-keys" ;
1010
1111export const runtime = "nodejs" ;
1212export const dynamic = "force-dynamic" ;
@@ -131,7 +131,11 @@ export async function POST(request: Request) {
131131 // we claim one render against quota; accounts without a subscription row are
132132 // allowed through so a valid key "just works" in development.
133133 const consume = await consumeRender ( auth . user . id ) ;
134- if ( ! consume . ok && consume . reason && ! / n o s u b s c r i p t i o n / i. test ( consume . reason ) ) {
134+ if (
135+ ! consume . ok &&
136+ consume . reason &&
137+ ! / n o s u b s c r i p t i o n / i. test ( consume . reason )
138+ ) {
135139 return NextResponse . json ( { error : consume . reason } , { status : 402 } ) ;
136140 }
137141
@@ -141,8 +145,7 @@ export async function POST(request: Request) {
141145 typeof body . options ?. bitrate === "number"
142146 ? body . options . bitrate
143147 : 8_000_000 ,
144- scale :
145- typeof body . options ?. scale === "number" ? body . options . scale : 1 ,
148+ scale : typeof body . options ?. scale === "number" ? body . options . scale : 1 ,
146149 keyframeIntervalSec :
147150 typeof body . options ?. keyframeIntervalSec === "number"
148151 ? body . options . keyframeIntervalSec
0 commit comments