mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Add ability to unfederate a local video (on blacklist)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
export interface VideoBlacklistCreate {
|
||||
reason?: string
|
||||
unfederate?: boolean
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ export interface VideoBlacklist {
|
||||
id: number
|
||||
createdAt: Date
|
||||
updatedAt: Date
|
||||
unfederated: boolean
|
||||
reason?: string
|
||||
|
||||
video: {
|
||||
|
||||
@@ -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)
|
||||
})
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user