mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
preserve original variable names server-side
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export enum UserAdminFlag {
|
||||
NONE = 0,
|
||||
BYPASS_VIDEO_AUTO_BLOCK = 1 << 0
|
||||
BYPASS_VIDEO_AUTO_BLACKLIST = 1 << 0
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user