mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 17:46:06 +00:00
fix: bulk video download (original quality, latest version by default)
- Accept source=auto in the version download route (was 400 Bad Request), so bulk/project downloads of Bunny videos no longer fail. - Bulk/project downloads now request the original (uncompressed) Bunny file so quality never drops (was source=auto which could fall back to compressed). - Project/selected downloads default to the latest version of each video and add a separate "All versions" option in the download dropdowns.
This commit is contained in:
@@ -22,6 +22,7 @@ export async function GET(request: NextRequest, { params }: RouteParams) {
|
||||
const session = await auth();
|
||||
const { projectId } = await params;
|
||||
const requestedVideoIds = parseRequestedVideoIds(request.nextUrl.searchParams.get('videoIds'));
|
||||
const includeAllVersions = request.nextUrl.searchParams.get('versions') === 'all';
|
||||
|
||||
if (requestedVideoIds && requestedVideoIds.length === 0) {
|
||||
return apiErrors.badRequest('At least one video must be selected for download');
|
||||
@@ -92,7 +93,7 @@ export async function GET(request: NextRequest, { params }: RouteParams) {
|
||||
}
|
||||
}
|
||||
|
||||
const manifest = buildProjectDownloadManifest(project.name, videos);
|
||||
const manifest = buildProjectDownloadManifest(project.name, videos, { includeAllVersions });
|
||||
const validationError = validateProjectDownloadManifest(manifest);
|
||||
if (validationError) {
|
||||
return apiErrors.badRequest(validationError);
|
||||
|
||||
Reference in New Issue
Block a user