1 import { Response } from 'express'
2 import { VideoCaptionModel } from '@server/models/video/video-caption'
3 import { MVideoId } from '@server/types/models'
4 import { HttpStatusCode } from '@shared/models'
6 async function doesVideoCaptionExist (video: MVideoId, language: string, res: Response) {
7 const videoCaption = await VideoCaptionModel.loadByVideoIdAndLanguage(video.id, language)
11 status: HttpStatusCode.NOT_FOUND_404,
12 message: 'Video caption not found'
17 res.locals.videoCaption = videoCaption
21 // ---------------------------------------------------------------------------