}
hasVideoBlocklistRight () {
- return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLOCKS)
+ return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
}
hasConfigRight () {
}
hasVideoBlocklistRight () {
- return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLOCKS)
+ return this.auth.getUser().hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
}
hasAccountsBlocklistRight () {
component: VideoBlockListComponent,
canActivate: [ UserRightGuard ],
data: {
- userRight: UserRight.MANAGE_VIDEO_BLOCKS,
+ userRight: UserRight.MANAGE_VIDEO_BLACKLIST,
meta: {
title: 'Videos blocked'
}
this.videoBlocklistService.blockVideo(videoAbuse.video.id, undefined, true)
.subscribe(
() => {
- this.notifier.success(this.i18n('Video blocklisted.'))
+ this.notifier.success(this.i18n('Video blocked.'))
this.updateVideoAbuseState(videoAbuse, VideoAbuseState.ACCEPTED)
},
this.videoBlocklistService.unblockVideo(videoAbuse.video.id)
.subscribe(
() => {
- this.notifier.success(this.i18n('Video unblocklisted.'))
+ this.notifier.success(this.i18n('Video unblocked.'))
this.updateVideoAbuseState(videoAbuse, VideoAbuseState.ACCEPTED)
},
import { Notifier, ServerService } from '@app/core'
import { ConfirmService } from '../../../core'
import { RestPagination, RestTable, VideoBlockService } from '../../../shared'
-import { VideoBlocklist, VideoBlockType } from '../../../../../../shared'
+import { VideoBlacklist, VideoBlacklistType } from '../../../../../../shared'
import { I18n } from '@ngx-translate/i18n-polyfill'
import { DropdownAction } from '../../../shared/buttons/action-dropdown.component'
import { Video } from '../../../shared/video/video.model'
styleUrls: [ '../moderation.component.scss', './video-block-list.component.scss' ]
})
export class VideoBlockListComponent extends RestTable implements OnInit {
- blocklist: (VideoBlocklist & { reasonHtml?: string })[] = []
+ blocklist: (VideoBlacklist & { reasonHtml?: string })[] = []
totalRecords = 0
sort: SortMeta = { field: 'createdAt', order: -1 }
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
- listBlockTypeFilter: VideoBlockType = undefined
+ blocklistTypeFilter: VideoBlacklistType = undefined
- videoBlocklistActions: DropdownAction<VideoBlocklist>[][] = []
+ videoBlocklistActions: DropdownAction<VideoBlacklist>[][] = []
constructor (
private notifier: Notifier,
.subscribe(config => {
// don't filter if auto-blacklist is not enabled as this will be the only list
if (config.autoBlacklist.videos.ofUsers.enabled) {
- this.listBlockTypeFilter = VideoBlockType.MANUAL
+ this.blocklistTypeFilter = VideoBlacklistType.MANUAL
}
})
return 'VideoBlockListComponent'
}
- getVideoUrl (videoBlock: VideoBlocklist) {
+ getVideoUrl (videoBlock: VideoBlacklist) {
return Video.buildClientUrl(videoBlock.video.uuid)
}
return this.markdownRenderer.textMarkdownToHTML(text)
}
- async unblockVideo (entry: VideoBlocklist) {
+ async unblockVideo (entry: VideoBlacklist) {
const confirmMessage = this.i18n(
'Do you really want to unblock this video? It will be available again in the videos list.'
)
role: this.userValidatorsService.USER_ROLE,
videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA,
videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY,
- byPassAutoBlacklist: null
+ byPassAutoBlock: null
}, defaultValues)
}
<div class="form-group">
<my-peertube-checkbox
- inputName="byPassAutoBlacklist" formControlName="byPassAutoBlacklist"
+ inputName="byPassAutoBlock" formControlName="byPassAutoBlock"
i18n-labelText labelText="Doesn't need review before a video goes public"
></my-peertube-checkbox>
</div>
}
protected buildAdminFlags (formValue: any) {
- return formValue.byPassAutoBlacklist ? UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK : UserAdminFlag.NONE
+ return formValue.byPassAutoBlock ? UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST : UserAdminFlag.NONE
}
protected buildQuotaOptions () {
role: this.userValidatorsService.USER_ROLE,
videoQuota: this.userValidatorsService.USER_VIDEO_QUOTA,
videoQuotaDaily: this.userValidatorsService.USER_VIDEO_QUOTA_DAILY,
- byPassAutoBlacklist: null
+ byPassAutoBlock: null
}, defaultValues)
this.paramsSub = this.route.params.subscribe(routeParams => {
role: userJson.role.toString(),
videoQuota: userJson.videoQuota,
videoQuotaDaily: userJson.videoQuotaDaily,
- byPassAutoBlacklist: userJson.adminFlags & UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK
+ byPassAutoBlock: userJson.adminFlags & UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
})
}
}
this.rightNotifications = {
videoAbuseAsModerator: UserRight.MANAGE_VIDEO_ABUSES,
- videoAutoBlacklistAsModerator: UserRight.MANAGE_VIDEO_BLOCKS,
+ videoAutoBlacklistAsModerator: UserRight.MANAGE_VIDEO_BLACKLIST,
newUserRegistration: UserRight.MANAGE_USERS,
newInstanceFollower: UserRight.MANAGE_SERVER_FOLLOW,
autoInstanceFollowing: UserRight.MANAGE_CONFIGURATION
[UserRight.MANAGE_USERS]: '/admin/users',
[UserRight.MANAGE_SERVER_FOLLOW]: '/admin/friends',
[UserRight.MANAGE_VIDEO_ABUSES]: '/admin/moderation/video-abuses',
- [UserRight.MANAGE_VIDEO_BLOCKS]: '/admin/moderation/video-blocks',
+ [UserRight.MANAGE_VIDEO_BLACKLIST]: '/admin/moderation/video-blocks',
[UserRight.MANAGE_JOBS]: '/admin/jobs',
[UserRight.MANAGE_CONFIGURATION]: '/admin/config'
}
UserRight.MANAGE_USERS,
UserRight.MANAGE_SERVER_FOLLOW,
UserRight.MANAGE_VIDEO_ABUSES,
- UserRight.MANAGE_VIDEO_BLOCKS,
+ UserRight.MANAGE_VIDEO_BLACKLIST,
UserRight.MANAGE_JOBS,
UserRight.MANAGE_CONFIGURATION
]
this.videoUrl = this.buildVideoUrl(this.video)
break
- case UserNotificationType.UNBLOCK_ON_MY_VIDEO:
+ case UserNotificationType.UNBLACKLIST_ON_MY_VIDEO:
this.videoUrl = this.buildVideoUrl(this.video)
break
this.videoUrl = this.buildVideoUrl(this.videoAbuse.video)
break
- case UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS:
+ case UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS:
this.videoAutoBlacklistUrl = '/admin/moderation/video-auto-blacklist/list'
// Backward compatibility where we did not assign videoBlacklist to this type of notification before
if (!this.videoBlacklist) this.videoBlacklist = { id: null, video: this.video }
this.videoUrl = this.buildVideoUrl(this.videoBlacklist.video)
break
- case UserNotificationType.BLOCK_ON_MY_VIDEO:
+ case UserNotificationType.BLACKLIST_ON_MY_VIDEO:
this.videoUrl = this.buildVideoUrl(this.videoBlacklist.video)
break
</ng-template>
</ng-container>
- <ng-container *ngSwitchCase="UserNotificationType.UNBLOCK_ON_MY_VIDEO">
+ <ng-container *ngSwitchCase="UserNotificationType.UNBLACKLIST_ON_MY_VIDEO">
<my-global-icon iconName="undo"></my-global-icon>
<div class="message" i18n>
</div>
</ng-container>
- <ng-container *ngSwitchCase="UserNotificationType.BLOCK_ON_MY_VIDEO">
+ <ng-container *ngSwitchCase="UserNotificationType.BLACKLIST_ON_MY_VIDEO">
<my-global-icon iconName="no"></my-global-icon>
<div class="message" i18n>
</div>
</ng-container>
- <ng-container *ngSwitchCase="UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS">
+ <ng-container *ngSwitchCase="UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS">
<my-global-icon iconName="no"></my-global-icon>
<div class="message" i18n>
- The recently added video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoBlacklist.video.name }}</a> has been <a (click)="markAsRead(notification)" [routerLink]="notification.videoAutoBlacklistUrl">auto-blocked</a>
+ The recently added video <a (click)="markAsRead(notification)" [routerLink]="notification.videoUrl">{{ notification.videoBlacklist.video.name }}</a> has been <a (click)="markAsRead(notification)" [routerLink]="notification.videoAutoBlacklistUrl">automatically blocked</a>
</div>
</ng-container>
import { Injectable } from '@angular/core'
import { SortMeta } from 'primeng/api'
import { from as observableFrom, Observable } from 'rxjs'
-import { VideoBlocklist, VideoBlockType, ResultList } from '../../../../../shared'
+import { VideoBlacklist, VideoBlacklistType, ResultList } from '../../../../../shared'
import { environment } from '../../../environments/environment'
import { RestExtractor, RestPagination, RestService } from '../rest'
pagination: RestPagination
sort: SortMeta
search?: string
- type?: VideoBlockType
- }): Observable<ResultList<VideoBlocklist>> {
+ type?: VideoBlacklistType
+ }): Observable<ResultList<VideoBlacklist>> {
const { pagination, sort, search, type } = options
let params = new HttpParams()
type: {
prefix: 'type:',
handler: v => {
- if (v === 'manual') return VideoBlockType.MANUAL
- if (v === 'auto') return VideoBlockType.AUTO_BEFORE_PUBLISHED
+ if (v === 'manual') return VideoBlacklistType.MANUAL
+ if (v === 'auto') return VideoBlacklistType.AUTO_BEFORE_PUBLISHED
return undefined
}
params = this.restService.addObjectParams(params, filters)
}
- return this.authHttp.get<ResultList<VideoBlocklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params })
+ return this.authHttp.get<ResultList<VideoBlacklist>>(VideoBlockService.BASE_VIDEOS_URL + 'blacklist', { params })
.pipe(
map(res => this.restExtractor.convertResultListDateToHuman(res)),
catchError(res => this.restExtractor.handleError(res))
}
isBlockableBy (user: AuthUser) {
- return this.blacklisted !== true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) === true
+ return this.blacklisted !== true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true
}
isUnblockableBy (user: AuthUser) {
- return this.blacklisted === true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) === true
+ return this.blacklisted === true && user && user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) === true
}
isUpdatableBy (user: AuthUser) {
this.videoCaptionService.listCaptions(videoId)
])
.pipe(
- // If 401, the video is private or blocklisted so redirect to 404
+ // If 401, the video is private or blocked so redirect to 404
catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ]))
)
.subscribe(([ video, captionsResult ]) => {
this.playlistService.getVideoPlaylist(playlistId)
.pipe(
- // If 401, the video is private or blocklisted so redirect to 404
+ // If 401, the video is private or blocked so redirect to 404
catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 400, 401, 403, 404 ]))
)
.subscribe(playlist => {
blacklistRouter.post('/:videoId/blacklist',
authenticate,
- ensureUserHasRight(UserRight.MANAGE_VIDEO_BLOCKS),
+ ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST),
asyncMiddleware(videosBlacklistAddValidator),
asyncMiddleware(addVideoToBlacklistController)
)
blacklistRouter.get('/blacklist',
authenticate,
- ensureUserHasRight(UserRight.MANAGE_VIDEO_BLOCKS),
+ ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST),
paginationValidator,
blacklistSortValidator,
setBlacklistSort,
blacklistRouter.put('/:videoId/blacklist',
authenticate,
- ensureUserHasRight(UserRight.MANAGE_VIDEO_BLOCKS),
+ ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST),
asyncMiddleware(videosBlacklistUpdateValidator),
asyncMiddleware(updateVideoBlacklistController)
)
blacklistRouter.delete('/:videoId/blacklist',
authenticate,
- ensureUserHasRight(UserRight.MANAGE_VIDEO_BLOCKS),
+ ensureUserHasRight(UserRight.MANAGE_VIDEO_BLACKLIST),
asyncMiddleware(videosBlacklistRemoveValidator),
asyncMiddleware(removeVideoFromBlacklistController)
)
import validator from 'validator'
import { exists } from './misc'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
-import { VideoBlockType } from '../../../shared/models/videos'
+import { VideoBlacklistType } from '../../../shared/models/videos'
const VIDEO_BLACKLIST_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_BLACKLIST
}
function isVideoBlacklistTypeValid (value: any) {
- return exists(value) && validator.isInt('' + value) && VideoBlockType[value] !== undefined
+ return exists(value) && validator.isInt('' + value) && VideoBlacklistType[value] !== undefined
}
// ---------------------------------------------------------------------------
import * as Sequelize from 'sequelize'
-import { VideoBlockType } from '../../../shared/models/videos'
+import { VideoBlacklistType } from '../../../shared/models/videos'
async function up (utils: {
transaction: Sequelize.Transaction
}
{
- const query = 'UPDATE "videoBlacklist" SET "type" = ' + VideoBlockType.MANUAL
+ const query = 'UPDATE "videoBlacklist" SET "type" = ' + VideoBlacklistType.MANUAL
await utils.sequelize.query(query)
}
}
private async notifyModeratorsOfVideoAutoBlacklist (videoBlacklist: MVideoBlacklistLightVideo) {
- const moderators = await UserModel.listWithRight(UserRight.MANAGE_VIDEO_BLOCKS)
+ const moderators = await UserModel.listWithRight(UserRight.MANAGE_VIDEO_BLACKLIST)
if (moderators.length === 0) return
logger.info('Notifying %s moderators of video auto-blacklist %s.', moderators.length, videoBlacklist.Video.url)
async function notificationCreator (user: MUserWithNotificationSetting) {
const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
- type: UserNotificationType.VIDEO_AUTO_BLOCK_FOR_MODERATORS,
+ type: UserNotificationType.VIDEO_AUTO_BLACKLIST_FOR_MODERATORS,
userId: user.id,
videoBlacklistId: videoBlacklist.id
})
async function notificationCreator (user: MUserWithNotificationSetting) {
const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
- type: UserNotificationType.BLOCK_ON_MY_VIDEO,
+ type: UserNotificationType.BLACKLIST_ON_MY_VIDEO,
userId: user.id,
videoBlacklistId: videoBlacklist.id
})
async function notificationCreator (user: MUserWithNotificationSetting) {
const notification = await UserNotificationModel.create<UserNotificationModelForApi>({
- type: UserNotificationType.UNBLOCK_ON_MY_VIDEO,
+ type: UserNotificationType.UNBLACKLIST_ON_MY_VIDEO,
userId: user.id,
videoId: video.id
})
MVideoFullLight,
MVideoWithBlacklistLight
} from '@server/typings/models'
-import { UserRight, VideoBlacklistCreate, VideoBlockType } from '../../shared/models'
+import { UserRight, VideoBlacklistCreate, VideoBlacklistType } from '../../shared/models'
import { UserAdminFlag } from '../../shared/models/users/user-flag.model'
import { logger } from '../helpers/logger'
import { CONFIG } from '../initializers/config'
videoId: video.id,
unfederated: true,
reason: 'Auto-blacklisted. Moderator review required.',
- type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
}
const [ videoBlacklist ] = await VideoBlacklistModel.findOrCreate<MVideoBlacklistVideo>({
where: {
videoId: videoInstance.id,
unfederated: options.unfederate === true,
reason: options.reason,
- type: VideoBlockType.MANUAL
+ type: VideoBlacklistType.MANUAL
}
)
blacklist.Video = videoInstance
Notifier.Instance.notifyOnVideoUnblacklist(video)
- if (videoBlacklistType === VideoBlockType.AUTO_BEFORE_PUBLISHED) {
+ if (videoBlacklistType === VideoBlacklistType.AUTO_BEFORE_PUBLISHED) {
Notifier.Instance.notifyOnVideoPublishedAfterRemovedFromAutoBlacklist(video)
// Delete on object so new video notifications will send
if (!CONFIG.AUTO_BLACKLIST.VIDEOS.OF_USERS.ENABLED || !user) return false
if (isRemote || isNew === false) return false
- if (user.hasRight(UserRight.MANAGE_VIDEO_BLOCKS) || user.hasAdminFlag(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK)) return false
+ if (user.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST) || user.hasAdminFlag(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)) return false
return true
}
const videoUserId = video.VideoChannel.Account.userId
if (video.isBlacklisted()) {
- return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLOCKS)
+ return videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
}
if (video.privacy === VideoPrivacy.PRIVATE) {
- return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLOCKS)
+ return video.VideoChannel && videoUserId === this.id || this.hasRight(UserRight.MANAGE_VIDEO_BLACKLIST)
}
if (video.privacy === VideoPrivacy.INTERNAL) return true
import { VideoModel } from './video'
import { ScopeNames as VideoChannelScopeNames, SummaryOptions, VideoChannelModel } from './video-channel'
import { isVideoBlacklistReasonValid, isVideoBlacklistTypeValid } from '../../helpers/custom-validators/video-blacklist'
-import { VideoBlocklist, VideoBlockType } from '../../../shared/models/videos'
+import { VideoBlacklist, VideoBlacklistType } from '../../../shared/models/videos'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
import { FindOptions } from 'sequelize'
import { ThumbnailModel } from './thumbnail'
@Default(null)
@Is('VideoBlacklistType', value => throwIfNotValid(value, isVideoBlacklistTypeValid, 'type'))
@Column
- type: VideoBlockType
+ type: VideoBlacklistType
@CreatedAt
createdAt: Date
count: number
sort: SortType
search?: string
- type?: VideoBlockType
+ type?: VideoBlacklistType
}) {
const { start, count, sort, search, type } = parameters
return VideoBlacklistModel.findOne(query)
}
- toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlocklist {
+ toFormattedJSON (this: MVideoBlacklistFormattable): VideoBlacklist {
return {
id: this.id,
createdAt: this.createdAt,
videoQuota: -1,
videoQuotaDaily: -1,
role: UserRole.USER,
- adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK
+ adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
}
it('Should fail with a too small username', async function () {
checkBadSortPagination,
checkBadStartPagination
} from '../../../../shared/extra-utils/requests/check-api-params'
-import { VideoBlockType, VideoDetails } from '../../../../shared/models/videos'
+import { VideoBlacklistType, VideoDetails } from '../../../../shared/models/videos'
import { expect } from 'chai'
describe('Test video blacklist API validators', function () {
})
it('Should succeed with the correct parameters', async function () {
- await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: VideoBlockType.MANUAL })
+ await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, type: VideoBlacklistType.MANUAL })
})
})
username: user.username,
password: user.password,
videoQuota: 2 * 1024 * 1024,
- adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK
+ adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST
})
})
}
expect(userMe.adminFlags).to.be.undefined
- expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK)
+ expect(userGet.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)
expect(userMe.specialPlaylists).to.have.lengthOf(1)
expect(userMe.specialPlaylists[0].type).to.equal(VideoPlaylistType.WATCH_LATER)
} from '../../../../shared/extra-utils/index'
import { doubleFollow } from '../../../../shared/extra-utils/server/follows'
import { waitJobs } from '../../../../shared/extra-utils/server/jobs'
-import { VideoBlocklist, VideoBlockType } from '../../../../shared/models/videos'
+import { VideoBlacklist, VideoBlacklistType } from '../../../../shared/models/videos'
import { UserAdminFlag } from '../../../../shared/models/users/user-flag.model'
import { User, UserRole } from '../../../../shared/models/users'
import { getMagnetURI, getYoutubeVideoUrl, importVideo } from '../../../../shared/extra-utils/videos/video-imports'
const res = await getBlacklistedVideosList({
url: servers[0].url,
token: servers[0].accessToken,
- type: VideoBlockType.MANUAL
+ type: VideoBlacklistType.MANUAL
})
expect(res.body.total).to.equal(2)
const res = await getBlacklistedVideosList({
url: servers[0].url,
token: servers[0].accessToken,
- type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
})
expect(res.body.total).to.equal(0)
})
describe('When removing a blacklisted video', function () {
- let videoToRemove: VideoBlocklist
+ let videoToRemove: VideoBlacklist
let blacklist = []
it('Should not have any video in videos list on server 1', async function () {
it('Should have the correct video blacklist unfederate attribute', async function () {
const res = await getBlacklistedVideosList({ url: servers[0].url, token: servers[0].accessToken, sort: 'createdAt' })
- const blacklistedVideos: VideoBlocklist[] = res.body.data
+ const blacklistedVideos: VideoBlacklist[] = res.body.data
const video3Blacklisted = blacklistedVideos.find(b => b.video.uuid === video3UUID)
const video4Blacklisted = blacklistedVideos.find(b => b.video.uuid === video4UUID)
url: servers[0].url,
accessToken: servers[0].accessToken,
username: user.username,
- adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLOCK,
+ adminFlags: UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST,
password: user.password,
role: UserRole.USER
})
const res = await getBlacklistedVideosList({
url: servers[0].url,
token: servers[0].accessToken,
- type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
})
expect(res.body.total).to.equal(1)
url: servers[0].url,
token: servers[0].accessToken,
sort: 'createdAt',
- type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
})
expect(res.body.total).to.equal(2)
url: servers[0].url,
token: servers[0].accessToken,
sort: 'createdAt',
- type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
})
expect(res.body.total).to.equal(3)
const res = await getBlacklistedVideosList({
url: servers[0].url,
token: servers[0].accessToken,
- type: VideoBlockType.AUTO_BEFORE_PUBLISHED
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
})
expect(res.body.total).to.equal(3)
}
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') {
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
import * as request from 'supertest'
-import { VideoBlockType } from '../../models/videos'
+import { VideoBlacklistType } from '../../models/videos'
import { makeGetRequest } from '..'
function addVideoToBlacklist (
url: string
token: string
sort?: string
- type?: VideoBlockType
+ type?: VideoBlacklistType
specialStatus?: number
}) {
const { url, token, sort, type, specialStatus = 200 } = parameters
export enum UserAdminFlag {
NONE = 0,
- BYPASS_VIDEO_AUTO_BLOCK = 1 << 0
+ BYPASS_VIDEO_AUTO_BLACKLIST = 1 << 0
}
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,
NEW_FOLLOW = 10,
COMMENT_MENTION = 11,
- VIDEO_AUTO_BLOCK_FOR_MODERATORS = 12,
+ VIDEO_AUTO_BLACKLIST_FOR_MODERATORS = 12,
NEW_INSTANCE_FOLLOWER = 13,
MANAGE_ACCOUNTS_BLOCKLIST,
MANAGE_SERVERS_BLOCKLIST,
- MANAGE_VIDEO_BLOCKS,
+ MANAGE_VIDEO_BLACKLIST,
REMOVE_ANY_VIDEO,
REMOVE_ANY_VIDEO_CHANNEL,
],
[UserRole.MODERATOR]: [
- UserRight.MANAGE_VIDEO_BLOCKS,
+ UserRight.MANAGE_VIDEO_BLACKLIST,
UserRight.MANAGE_VIDEO_ABUSES,
UserRight.REMOVE_ANY_VIDEO,
UserRight.REMOVE_ANY_VIDEO_CHANNEL,
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