Add ability to unfederate a local video (on blacklist)

This commit is contained in:
Chocobozzz
2019-01-10 15:39:51 +01:00
parent 93f85e90ff
commit 5abb9fbbd1
21 changed files with 456 additions and 318 deletions

View File

@@ -1,3 +1,4 @@
export interface VideoBlacklistCreate {
reason?: string
unfederate?: boolean
}

View File

@@ -2,6 +2,7 @@ export interface VideoBlacklist {
id: number
createdAt: Date
updatedAt: Date
unfederated: boolean
reason?: string
video: {

View File

@@ -145,8 +145,12 @@ function runServer (serverNumber: number, configOverride?: Object, args = []) {
if (dontContinue === true) return
server.app.stdout.removeListener('data', onStdout)
process.on('exit', () => process.kill(server.app.pid))
res(server)
})
})
}

View File

@@ -1,11 +1,18 @@
import * as request from 'supertest'
function addVideoToBlacklist (url: string, token: string, videoId: number | string, reason?: string, specialStatus = 204) {
function addVideoToBlacklist (
url: string,
token: string,
videoId: number | string,
reason?: string,
unfederate?: boolean,
specialStatus = 204
) {
const path = '/api/v1/videos/' + videoId + '/blacklist'
return request(url)
.post(path)
.send({ reason })
.send({ reason, unfederate })
.set('Accept', 'application/json')
.set('Authorization', 'Bearer ' + token)
.expect(specialStatus)