1 import { Response } from 'express'
2 import { VideoBlacklistModel } from '../../models/video/video-blacklist'
3 import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
5 async function doesVideoBlacklistExist (videoId: number, res: Response) {
6 const videoBlacklist = await VideoBlacklistModel.loadByVideoId(videoId)
8 if (videoBlacklist === null) {
9 res.status(HttpStatusCode.NOT_FOUND_404)
10 .json({ error: 'Blacklisted video not found' })
16 res.locals.videoBlacklist = videoBlacklist
20 // ---------------------------------------------------------------------------
23 doesVideoBlacklistExist