fix: include accessible video and re-timed captions in bulk download
The "Download All Files" function was missing accessible_video_mp4 and accessible_captions_vtt files that the backend provides. Updated both the bulk download in JobsList and the individual Downloads page to include all available file types. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
3df163fd13
commit
f68bcab667
2 changed files with 29 additions and 7 deletions
|
|
@ -47,12 +47,14 @@ const DownloadCard = ({
|
|||
|
||||
const formatFilename = (type: string) => {
|
||||
const sanitizedTitle = jobTitle.replace(/[^a-zA-Z0-9\-_]/g, '_');
|
||||
const extensions = {
|
||||
const extensions: Record<string, string> = {
|
||||
'captions_vtt': 'captions.vtt',
|
||||
'audio_description_vtt': 'audio_descriptions.vtt',
|
||||
'audio_description_mp3': 'audio_descriptions.mp3'
|
||||
'audio_description_mp3': 'audio_descriptions.mp3',
|
||||
'accessible_video_mp4': 'accessible_video.mp4',
|
||||
'accessible_captions_vtt': 'accessible_captions.vtt'
|
||||
};
|
||||
return `${sanitizedTitle}_${language}_${extensions[type as keyof typeof extensions]}`;
|
||||
return `${sanitizedTitle}_${language}_${extensions[type] || type}`;
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -61,17 +63,19 @@ const DownloadCard = ({
|
|||
|
||||
<div className="space-y-3">
|
||||
{Object.entries(files).map(([type, url]) => {
|
||||
const typeLabels = {
|
||||
const typeLabels: Record<string, string> = {
|
||||
'captions_vtt': 'Captions (VTT)',
|
||||
'audio_description_vtt': 'Audio Descriptions (VTT)',
|
||||
'audio_description_mp3': 'Audio Descriptions (MP3)'
|
||||
'audio_description_mp3': 'Audio Descriptions (MP3)',
|
||||
'accessible_video_mp4': 'Accessible Video (MP4)',
|
||||
'accessible_captions_vtt': 'Re-timed Captions (VTT)'
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
<div key={type} className="flex items-center justify-between">
|
||||
<div>
|
||||
<p className="text-sm font-medium text-gray-900">
|
||||
{typeLabels[type as keyof typeof typeLabels] || type}
|
||||
{typeLabels[type] || type}
|
||||
</p>
|
||||
<p className="text-xs text-gray-500">
|
||||
{formatFilename(type)}
|
||||
|
|
@ -235,6 +239,8 @@ export function Downloads() {
|
|||
<li>• Download links are valid for 24 hours</li>
|
||||
<li>• VTT files can be used with any video player that supports WebVTT</li>
|
||||
<li>• MP3 files contain synchronized audio descriptions for accessibility</li>
|
||||
<li>• Accessible Video (MP4) contains the source video with pauses inserted for audio descriptions</li>
|
||||
<li>• Re-timed Captions (VTT) are synced to the accessible video timing</li>
|
||||
<li>• Contact support if you need help integrating these files</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -379,6 +379,20 @@ export function JobsList() {
|
|||
filename: `${safeTitle}_${lang}_audio_description.mp3`
|
||||
});
|
||||
}
|
||||
// Accessible video (video with AD pauses inserted)
|
||||
if (langAssets.accessible_video_mp4) {
|
||||
allFiles.push({
|
||||
url: langAssets.accessible_video_mp4,
|
||||
filename: `${safeTitle}_${lang}_accessible_video.mp4`
|
||||
});
|
||||
}
|
||||
// Re-timed captions VTT (captions synced to accessible video)
|
||||
if (langAssets.accessible_captions_vtt) {
|
||||
allFiles.push({
|
||||
url: langAssets.accessible_captions_vtt,
|
||||
filename: `${safeTitle}_${lang}_accessible_captions.vtt`
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(`Failed to get downloads for job ${job.id}:`, error);
|
||||
|
|
@ -984,6 +998,8 @@ export function JobsList() {
|
|||
<li>- Source video (MP4)</li>
|
||||
<li>- Captions (VTT) for all languages</li>
|
||||
<li>- Audio descriptions (VTT + MP3) for all languages</li>
|
||||
<li>- Accessible videos (MP4 with AD pauses)</li>
|
||||
<li>- Re-timed captions (VTT synced to accessible video)</li>
|
||||
</ul>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue