mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 10:49:28 +02:00
add quarantine videos feature (#1637)
* add quarantine videos feature * increase Notification settings test timeout to 20000ms. was completing 7000 locally but timing out after 10000 on travis * fix quarantine video test issues -propagate misspelling -remove skip from server/tests/client.ts * WIP use blacklist for moderator video approval instead of video.quarantine boolean * finish auto-blacklist feature
This commit is contained in:
parent
12fed49eba
commit
7ccddd7b52
58 changed files with 1047 additions and 99 deletions
|
@ -1,7 +1,9 @@
|
|||
import { Response } from 'express'
|
||||
import * as validator from 'validator'
|
||||
import { exists } from './misc'
|
||||
import { CONSTRAINTS_FIELDS } from '../../initializers'
|
||||
import { VideoBlacklistModel } from '../../models/video/video-blacklist'
|
||||
import { VideoBlacklistType } from '../../../shared/models/videos'
|
||||
|
||||
const VIDEO_BLACKLIST_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_BLACKLIST
|
||||
|
||||
|
@ -24,9 +26,14 @@ async function doesVideoBlacklistExist (videoId: number, res: Response) {
|
|||
return true
|
||||
}
|
||||
|
||||
function isVideoBlacklistTypeValid (value: any) {
|
||||
return exists(value) && validator.isInt('' + value) && VideoBlacklistType[value] !== undefined
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isVideoBlacklistReasonValid,
|
||||
isVideoBlacklistTypeValid,
|
||||
doesVideoBlacklistExist
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue