1 import { Response } from 'express'
2 import { VideoCaptionModel } from '../../models/video/video-caption'
3 import { MVideoId } from '@server/types/models'
5 async function doesVideoCaptionExist (video: MVideoId, 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 // ---------------------------------------------------------------------------