feat: make video uploads faster

- Implemented a new endpoint to delete failed manual p1080 renditions, restoring the master manifest and updating metadata.
- Enhanced the HLS upload process with better error handling and cleanup for aborted uploads.
- Introduced tests for HLS encoder functionality to ensure correct selection of rungs based on video source properties.
- Updated video upload component to manage reserved asset IDs and perform cleanup on abo
This commit is contained in:
Rotimi Best
2026-06-07 23:20:42 +01:00
parent 27a612e92f
commit 4eee866e85
6 changed files with 357 additions and 52 deletions
@@ -19,6 +19,7 @@ import {
import { ZUpdateTranscript } from '@cio/utils/validation/media';
import {
abortHlsAssetService,
abortHls1080RenditionService,
attachAssetService,
batchPresignHlsService,
batchPresignHls1080Service,
@@ -228,6 +229,22 @@ export const assetsRouter = new Hono()
return handleError(c, error, 'Failed to abort HLS asset');
}
})
/**
* DELETE /organization/assets/:assetId/hls/1080
* Drop a failed manual p1080 rendition: delete partial segments, restore
* the master manifest, and reset rendition metadata.
*/
.delete('/:assetId/hls/1080', authMiddleware, orgMemberMiddleware, zValidator('param', ZAssetGetParam), async (c) => {
try {
const orgId = c.req.header('cio-org-id')!;
const { assetId } = c.req.valid('param');
const updated = await abortHls1080RenditionService(orgId, assetId);
return c.json({ success: true, data: updated }, 200);
} catch (error) {
return handleError(c, error, 'Failed to abort 1080p HLS rendition');
}
})
/**
* POST /organization/assets/:assetId/hls/cookie
* After entitlement check, set a 15-minute HMAC-signed cookie scoped to