aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video-blacklist.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-08-30 16:50:12 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-09-04 16:24:58 +0200
commit8424c4026afd7304880a4ce8138a04ffb3d8c938 (patch)
tree5b42625a59307b03333aa7d293b40b4c90da8f73 /server/lib/video-blacklist.ts
parentf69ec5f340638ef577e8f5b9b1fb844778656a1f (diff)
downloadPeerTube-8424c4026afd7304880a4ce8138a04ffb3d8c938.tar.gz
PeerTube-8424c4026afd7304880a4ce8138a04ffb3d8c938.tar.zst
PeerTube-8424c4026afd7304880a4ce8138a04ffb3d8c938.zip
Add auto follow back support for instances
Diffstat (limited to 'server/lib/video-blacklist.ts')
-rw-r--r--server/lib/video-blacklist.ts8
1 files changed, 5 insertions, 3 deletions
diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts
index a0fc26e84..1dd45b76d 100644
--- a/server/lib/video-blacklist.ts
+++ b/server/lib/video-blacklist.ts
@@ -6,7 +6,7 @@ import { logger } from '../helpers/logger'
6import { UserAdminFlag } from '../../shared/models/users/user-flag.model' 6import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
7import { Hooks } from './plugins/hooks' 7import { Hooks } from './plugins/hooks'
8import { Notifier } from './notifier' 8import { Notifier } from './notifier'
9import { MUser, MVideoBlacklist, MVideoWithBlacklistLight } from '@server/typings/models' 9import { MUser, MVideoBlacklistVideo, MVideoWithBlacklistLight } from '@server/typings/models'
10 10
11async function autoBlacklistVideoIfNeeded (parameters: { 11async function autoBlacklistVideoIfNeeded (parameters: {
12 video: MVideoWithBlacklistLight, 12 video: MVideoWithBlacklistLight,
@@ -31,7 +31,7 @@ async function autoBlacklistVideoIfNeeded (parameters: {
31 reason: 'Auto-blacklisted. Moderator review required.', 31 reason: 'Auto-blacklisted. Moderator review required.',
32 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED 32 type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
33 } 33 }
34 const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklist>({ 34 const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklistVideo>({
35 where: { 35 where: {
36 videoId: video.id 36 videoId: video.id
37 }, 37 },
@@ -40,7 +40,9 @@ async function autoBlacklistVideoIfNeeded (parameters: {
40 }) 40 })
41 video.VideoBlacklist = videoBlacklist 41 video.VideoBlacklist = videoBlacklist
42 42
43 if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(video) 43 videoBlacklist.Video = video
44
45 if (notify) Notifier.Instance.notifyOnVideoAutoBlacklist(videoBlacklist)
44 46
45 logger.info('Video %s auto-blacklisted.', video.uuid) 47 logger.info('Video %s auto-blacklisted.', video.uuid)
46 48