Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/content/createContentHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export async function createContentHandler(request: NextRequest): Promise<NextRe
captionLength: validated.captionLength,
upscale: validated.upscale,
githubRepo,
songs: validated.songs,
};

// Always use allSettled — works for single and batch.
Expand Down
3 changes: 3 additions & 0 deletions lib/content/validateCreateContentBody.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const createContentBodySchema = z.object({
caption_length: z.enum(CAPTION_LENGTHS).optional().default("short"),
upscale: z.boolean().optional().default(false),
batch: z.number().int().min(1).max(30).optional().default(1),
songs: z.array(z.string().min(1)).optional(),
});

export type ValidatedCreateContentBody = {
Expand All @@ -36,6 +37,7 @@ export type ValidatedCreateContentBody = {
captionLength: "short" | "medium" | "long";
upscale: boolean;
batch: number;
songs?: string[];
};

/**
Expand Down Expand Up @@ -94,5 +96,6 @@ export async function validateCreateContentBody(
captionLength: result.data.caption_length ?? "short",
upscale: result.data.upscale ?? false,
batch: result.data.batch ?? 1,
songs: result.data.songs,
};
}
2 changes: 2 additions & 0 deletions lib/trigger/triggerCreateContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export interface TriggerCreateContentPayload {
upscale: boolean;
/** GitHub repo URL so the task can fetch artist files. */
githubRepo: string;
/** Optional list of song slugs to restrict which songs the pipeline picks from. */
songs?: string[];
}

/**
Expand Down
Loading