feat: make asset downloads opt-in via "Include assets" toggle

Project/selected downloads now include only videos by default. Add an
"Include assets" checkbox toggle to both download dropdowns (default off)
that adds b-rolls and other attached assets to the download when enabled.

- buildProjectDownloadManifest gains an includeAssets option (default false).
- Download route reads ?assets=1 and passes it through.
This commit is contained in:
yusufipk
2026-07-10 21:03:34 +07:00
parent 57c5a127d1
commit 8d7d064647
3 changed files with 65 additions and 15 deletions
@@ -23,6 +23,7 @@ export async function GET(request: NextRequest, { params }: RouteParams) {
const { projectId } = await params;
const requestedVideoIds = parseRequestedVideoIds(request.nextUrl.searchParams.get('videoIds'));
const includeAllVersions = request.nextUrl.searchParams.get('versions') === 'all';
const includeAssets = request.nextUrl.searchParams.get('assets') === '1';
if (requestedVideoIds && requestedVideoIds.length === 0) {
return apiErrors.badRequest('At least one video must be selected for download');
@@ -93,7 +94,10 @@ export async function GET(request: NextRequest, { params }: RouteParams) {
}
}
const manifest = buildProjectDownloadManifest(project.name, videos, { includeAllVersions });
const manifest = buildProjectDownloadManifest(project.name, videos, {
includeAllVersions,
includeAssets,
});
const validationError = validateProjectDownloadManifest(manifest);
if (validationError) {
return apiErrors.badRequest(validationError);