mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user