aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/models/videos/blacklist/video-blacklist-create.model.ts1
-rw-r--r--shared/models/videos/blacklist/video-blacklist.model.ts1
-rw-r--r--shared/utils/server/servers.ts4
-rw-r--r--shared/utils/videos/video-blacklist.ts11
4 files changed, 15 insertions, 2 deletions
diff --git a/shared/models/videos/blacklist/video-blacklist-create.model.ts b/shared/models/videos/blacklist/video-blacklist-create.model.ts
index 89c69cb56..6e7d36421 100644
--- a/shared/models/videos/blacklist/video-blacklist-create.model.ts
+++ b/shared/models/videos/blacklist/video-blacklist-create.model.ts
@@ -1,3 +1,4 @@
1export interface VideoBlacklistCreate { 1export interface VideoBlacklistCreate {
2 reason?: string 2 reason?: string
3 unfederate?: boolean
3} 4}
diff --git a/shared/models/videos/blacklist/video-blacklist.model.ts b/shared/models/videos/blacklist/video-blacklist.model.ts
index ef4e5e3a2..4bd976190 100644
--- a/shared/models/videos/blacklist/video-blacklist.model.ts
+++ b/shared/models/videos/blacklist/video-blacklist.model.ts
@@ -2,6 +2,7 @@ export interface VideoBlacklist {
2 id: number 2 id: number
3 createdAt: Date 3 createdAt: Date
4 updatedAt: Date 4 updatedAt: Date
5 unfederated: boolean
5 reason?: string 6 reason?: string
6 7
7 video: { 8 video: {
diff --git a/shared/utils/server/servers.ts b/shared/utils/server/servers.ts
index 568385a41..1e9c83c72 100644
--- a/shared/utils/server/servers.ts
+++ b/shared/utils/server/servers.ts
@@ -145,8 +145,12 @@ function runServer (serverNumber: number, configOverride?: Object, args = []) {
145 if (dontContinue === true) return 145 if (dontContinue === true) return
146 146
147 server.app.stdout.removeListener('data', onStdout) 147 server.app.stdout.removeListener('data', onStdout)
148
149 process.on('exit', () => process.kill(server.app.pid))
150
148 res(server) 151 res(server)
149 }) 152 })
153
150 }) 154 })
151} 155}
152 156
diff --git a/shared/utils/videos/video-blacklist.ts b/shared/utils/videos/video-blacklist.ts
index 2c176fde0..f2ae0ed26 100644
--- a/shared/utils/videos/video-blacklist.ts
+++ b/shared/utils/videos/video-blacklist.ts
@@ -1,11 +1,18 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2 2
3function addVideoToBlacklist (url: string, token: string, videoId: number | string, reason?: string, specialStatus = 204) { 3function addVideoToBlacklist (
4 url: string,
5 token: string,
6 videoId: number | string,
7 reason?: string,
8 unfederate?: boolean,
9 specialStatus = 204
10) {
4 const path = '/api/v1/videos/' + videoId + '/blacklist' 11 const path = '/api/v1/videos/' + videoId + '/blacklist'
5 12
6 return request(url) 13 return request(url)
7 .post(path) 14 .post(path)
8 .send({ reason }) 15 .send({ reason, unfederate })
9 .set('Accept', 'application/json') 16 .set('Accept', 'application/json')
10 .set('Authorization', 'Bearer ' + token) 17 .set('Authorization', 'Bearer ' + token)
11 .expect(specialStatus) 18 .expect(specialStatus)