diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-09 16:07:10 +0200 |
---|---|---|
committer | Rigel Kent <sendmemail@rigelk.eu> | 2020-06-10 21:12:09 +0200 |
commit | 3487330d308166afb542cbacae0475693c0b059e (patch) | |
tree | 6a7b6ea3dd105661354bf0df6c6d3f7a7abe64e8 /server/lib/video-blacklist.ts | |
parent | 5baee5fca418487e72ddcd6419d31bca8659b668 (diff) | |
download | PeerTube-3487330d308166afb542cbacae0475693c0b059e.tar.gz PeerTube-3487330d308166afb542cbacae0475693c0b059e.tar.zst PeerTube-3487330d308166afb542cbacae0475693c0b059e.zip |
preserve original variable names server-side
Diffstat (limited to 'server/lib/video-blacklist.ts')
-rw-r--r-- | server/lib/video-blacklist.ts | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/server/lib/video-blacklist.ts b/server/lib/video-blacklist.ts index f1657e8f1..1ee92d22c 100644 --- a/server/lib/video-blacklist.ts +++ b/server/lib/video-blacklist.ts | |||
@@ -8,7 +8,7 @@ import { | |||
8 | MVideoFullLight, | 8 | MVideoFullLight, |
9 | MVideoWithBlacklistLight | 9 | MVideoWithBlacklistLight |
10 | } from '@server/typings/models' | 10 | } from '@server/typings/models' |
11 | import { UserRight, VideoBlacklistCreate, VideoBlockType } from '../../shared/models' | 11 | import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models' |
12 | import { UserAdminFlag } from '../../shared/models/users/user-flag.model' | 12 | import { UserAdminFlag } from '../../shared/models/users/user-flag.model' |
13 | import { logger } from '../helpers/logger' | 13 | import { logger } from '../helpers/logger' |
14 | import { CONFIG } from '../initializers/config' | 14 | import { CONFIG } from '../initializers/config' |
@@ -39,7 +39,7 @@ async function autoBlacklistVideoIfNeeded (parameters: { | |||
39 | videoId: video.id, | 39 | videoId: video.id, |
40 | unfederated: true, | 40 | unfederated: true, |
41 | reason: 'Auto-blacklisted. Moderator review required.', | 41 | reason: 'Auto-blacklisted. Moderator review required.', |
42 | type: VideoBlockType.AUTO_BEFORE_PUBLISHED | 42 | type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED |
43 | } | 43 | } |
44 | const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklistVideo>({ | 44 | const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklistVideo>({ |
45 | where: { | 45 | where: { |
@@ -64,7 +64,7 @@ async function blacklistVideo (videoInstance: MVideoAccountLight, options: Video | |||
64 | videoId: videoInstance.id, | 64 | videoId: videoInstance.id, |
65 | unfederated: options.unfederate === true, | 65 | unfederated: options.unfederate === true, |
66 | reason: options.reason, | 66 | reason: options.reason, |
67 | type: VideoBlockType.MANUAL | 67 | type: VideoBlacklistType.MANUAL |
68 | } | 68 | } |
69 | ) | 69 | ) |
70 | blacklist.Video = videoInstance | 70 | blacklist.Video = videoInstance |
@@ -94,7 +94,7 @@ async function unblacklistVideo (videoBlacklist: MVideoBlacklist, video: MVideoF | |||
94 | 94 | ||
95 | Notifier.Instance.notifyOnVideoUnblacklist(video) | 95 | Notifier.Instance.notifyOnVideoUnblacklist(video) |
96 | 96 | ||
97 | if (videoBlacklistType === VideoBlockType.AUTO_BEFORE_PUBLISHED) { | 97 | if (videoBlacklistType === VideoBlacklistType.AUTO_BEFORE_PUBLISHED) { |
98 | Notifier.Instance.notifyOnVideoPublishedAfterRemovedFromAutoBlacklist(video) | 98 | Notifier.Instance.notifyOnVideoPublishedAfterRemovedFromAutoBlacklist(video) |
99 | 99 | ||
100 | // Delete on object so new video notifications will send | 100 | // Delete on object so new video notifications will send |
@@ -126,7 +126,7 @@ function autoBlacklistNeeded (parameters: { | |||
126 | if (!CONFIG.AUTO_BLACKLIST.VIDEOS.OF_USERS.ENABLED || !user) return false | 126 | if (!CONFIG.AUTO_BLACKLIST.VIDEOS.OF_USERS.ENABLED || !user) return false |
127 | if (isRemote || isNew === false) return false | 127 | if (isRemote || isNew === false) return false |
128 | 128 | ||
129 | if (user.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) || user.hasAdminFlag(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK)) return false | 129 | if (user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) || user.hasAdminFlag(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)) return false |
130 | 130 | ||
131 | return true | 131 | return true |
132 | } | 132 | } |