1 import { VideoModel } from '../../models/video/video'
2 import { Response } from 'express'
3 import { VideoCaptionModel } from '../../models/video/video-caption'
5 async function doesVideoCaptionExist (video: VideoModel, language: string, res: Response) {
6 const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)
10 .json({ error: 'Video caption not found' })
16 res.locals.videoCaption = videoCaption
20 // ---------------------------------------------------------------------------