]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blame - server/middlewares/validators/shared/video-blacklists.ts
Add Podcast RSS feeds (#5487)
[github/Chocobozzz/PeerTube.git] / server / middlewares / validators / shared / video-blacklists.ts
CommitLineData
3e753302 1import { Response } from 'express'
10363c74 2import { VideoBlacklistModel } from '@server/models/video/video-blacklist'
c0e8b12e 3import { HttpStatusCode } from '@shared/models'
3e753302
C
4
5async function doesVideoBlacklistExist (videoId: number, res: Response) {
6 const videoBlacklist = await VideoBlacklistModel.loadByVideoId(videoId)
7
8 if (videoBlacklist === null) {
76148b27
RK
9 res.fail({
10 status: HttpStatusCode.NOT_FOUND_404,
11 message: 'Blacklisted video not found'
12 })
3e753302
C
13 return false
14 }
15
16 res.locals.videoBlacklist = videoBlacklist
17 return true
18}
19
20// ---------------------------------------------------------------------------
21
22export {
23 doesVideoBlacklistExist
24}