1 import * as request from 'supertest'
2 import { VideoBlockType } from '../../models/videos'
3 import { makeGetRequest } from '..'
5 function addVideoToBlacklist (
8 videoId: number | string,
13 const path = '/api/v1/videos/' + videoId + '/blacklist'
17 .send({ reason, unfederate })
18 .set('Accept', 'application/json')
19 .set('Authorization', 'Bearer ' + token)
20 .expect(specialStatus)
23 function updateVideoBlacklist (url: string, token: string, videoId: number, reason?: string, specialStatus = 204) {
24 const path = '/api/v1/videos/' + videoId + '/blacklist'
29 .set('Accept', 'application/json')
30 .set('Authorization', 'Bearer ' + token)
31 .expect(specialStatus)
34 function removeVideoFromBlacklist (url: string, token: string, videoId: number | string, specialStatus = 204) {
35 const path = '/api/v1/videos/' + videoId + '/blacklist'
39 .set('Accept', 'application/json')
40 .set('Authorization', 'Bearer ' + token)
41 .expect(specialStatus)
44 function getBlacklistedVideosList (parameters: {
49 specialStatus?: number
51 const { url, token, sort, type, specialStatus = 200 } = parameters
52 const path = '/api/v1/videos/blacklist/'
54 const query = { sort, type }
56 return makeGetRequest({
61 statusCodeExpected: specialStatus
65 // ---------------------------------------------------------------------------
69 removeVideoFromBlacklist,
70 getBlacklistedVideosList,