preserve original variable names server-side

This commit is contained in:
Rigel Kent
2020-06-09 16:07:10 +02:00
parent 5baee5fca4
commit 3487330d30
34 changed files with 89 additions and 89 deletions

View File

@@ -455,7 +455,7 @@ async function checkNewVideoAbuseForModerators (base: CheckerBaseParams, videoUU
}
async function checkVideoAutoBlacklistForModerators (base: CheckerBaseParams, videoUUID: string, videoName: string, type: CheckerType) {
const notificationType = UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS
const notificationType = UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS
function notificationChecker (notification: UserNotification, type: CheckerType) {
if (type === 'presence') {
@@ -486,8 +486,8 @@ async function checkNewBlacklistOnMyVideo (
blacklistType: 'blacklist' | 'unblacklist'
) {
const notificationType = blacklistType === 'blacklist'
? UserNotificationType.BLOCK_ON_MY_VIDEO
: UserNotificationType.UNBLOCK_ON_MY_VIDEO
? UserNotificationType.BLACKLIST_ON_MY_VIDEO
: UserNotificationType.UNBLACKLIST_ON_MY_VIDEO
function notificationChecker (notification: UserNotification) {
expect(notification).to.not.be.undefined

View File

@@ -1,5 +1,5 @@
import * as request from 'supertest'
import { VideoBlockType } from '../../models/videos'
import { VideoBlacklistType } from '../../models/videos'
import { makeGetRequest } from '..'
function addVideoToBlacklist (
@@ -45,7 +45,7 @@ function getBlacklistedVideosList (parameters: {
url: string
token: string
sort?: string
type?: VideoBlockType
type?: VideoBlacklistType
specialStatus?: number
}) {
const { url, token, sort, type, specialStatus = 200 } = parameters

View File

@@ -1,4 +1,4 @@
export enum UserAdminFlag {
NONE = 0,
BYPASS_VIDEO_AUTO_BLOCK = 1 << 0
BYPASS_VIDEO_AUTO_BLACKLIST = 1 << 0
}

View File

@@ -5,8 +5,8 @@ export enum UserNotificationType {
NEW_COMMENT_ON_MY_VIDEO = 2,
NEW_VIDEO_ABUSE_FOR_MODERATORS = 3,
BLOCK_ON_MY_VIDEO = 4,
UNBLOCK_ON_MY_VIDEO = 5,
BLACKLIST_ON_MY_VIDEO = 4,
UNBLACKLIST_ON_MY_VIDEO = 5,
MY_VIDEO_PUBLISHED = 6,
@@ -17,7 +17,7 @@ export enum UserNotificationType {
NEW_FOLLOW = 10,
COMMENT_MENTION = 11,
VIDEO_AUTO_BLOCK_FOR_MODERATORS = 12,
VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12,
NEW_INSTANCE_FOLLOWER = 13,

View File

@@ -20,7 +20,7 @@ export enum UserRight {
MANAGE_ACCOUNTS_BLOCKLIST,
MANAGE_SERVERS_BLOCKLIST,
MANAGE_VIDEO_BLOCKS,
MANAGE_VIDEO_BLACKLIST,
REMOVE_ANY_VIDEO,
REMOVE_ANY_VIDEO_CHANNEL,

View File

@@ -19,7 +19,7 @@ const userRoleRights: { [ id in UserRole ]: UserRight[] } = {
],
[UserRole.MODERATOR]: [
UserRight.MANAGE_VIDEO_BLOCKS,
UserRight.MANAGE_VIDEO_BLACKLIST,
UserRight.MANAGE_VIDEO_ABUSES,
UserRight.REMOVE_ANY_VIDEO,
UserRight.REMOVE_ANY_VIDEO_CHANNEL,

View File

@@ -1,15 +1,15 @@
import { Video } from '../video.model'
export enum VideoBlockType {
export enum VideoBlacklistType {
MANUAL = 1,
AUTO_BEFORE_PUBLISHED = 2
}
export interface VideoBlocklist {
export interface VideoBlacklist {
id: number
unfederated: boolean
reason?: string
type: VideoBlockType
type: VideoBlacklistType
video: Video