Ship free-tier watermark policy (2 clean renders) and align pricing/legal copy.
This commit is contained in:
+13
-1
@@ -41,6 +41,7 @@ import {
|
||||
normalizeWatermarkSettings,
|
||||
WATERMARK_TEXT_MAX,
|
||||
} from "../watermark";
|
||||
import { applyBrandWatermarkPolicy } from "../watermark-policy";
|
||||
|
||||
/** Merge nested + flat layout fields, then normalize (throws on bad template / coords). */
|
||||
export function resolveLayoutFromMetadata(metadata: ItemMetadata): LayoutSettings {
|
||||
@@ -255,6 +256,12 @@ export async function createVideoJob(
|
||||
throw err;
|
||||
}
|
||||
|
||||
const dbUser = await prisma.user.findUnique({
|
||||
where: { id: user.id },
|
||||
select: { createdVideoCount: true },
|
||||
});
|
||||
const createdVideoCount = dbUser?.createdVideoCount ?? 0;
|
||||
|
||||
const imagePath = assertPathInUserUploads(user.id, body.imagePath);
|
||||
const items = body.items.map((item) => ({
|
||||
...item,
|
||||
@@ -280,7 +287,7 @@ export async function createVideoJob(
|
||||
imagePath,
|
||||
items: {
|
||||
create: items.map((item, index) => {
|
||||
const wm = normalizeWatermarkSettings(
|
||||
const wm = applyBrandWatermarkPolicy(
|
||||
item.metadata.watermark
|
||||
? {
|
||||
...item.metadata.watermark,
|
||||
@@ -289,6 +296,11 @@ export async function createVideoJob(
|
||||
}
|
||||
: null,
|
||||
item.metadata.includeWatermark,
|
||||
{
|
||||
plan: user.plan,
|
||||
createdVideoCount,
|
||||
itemIndex: index,
|
||||
},
|
||||
);
|
||||
const layout = resolveLayoutFromMetadata(item.metadata);
|
||||
const pro = hasProFeatures(user.plan);
|
||||
|
||||
Reference in New Issue
Block a user