aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils/videos
diff options
context:
space:
mode:
Diffstat (limited to 'shared/utils/videos')
-rw-r--r--shared/utils/videos/video-blacklist.ts13
-rw-r--r--shared/utils/videos/video-change-ownership.ts4
2 files changed, 15 insertions, 2 deletions
diff --git a/shared/utils/videos/video-blacklist.ts b/shared/utils/videos/video-blacklist.ts
index f2ae0ed26..82d5b7e31 100644
--- a/shared/utils/videos/video-blacklist.ts
+++ b/shared/utils/videos/video-blacklist.ts
@@ -51,6 +51,18 @@ function getBlacklistedVideosList (url: string, token: string, specialStatus = 2
51 .expect('Content-Type', /json/) 51 .expect('Content-Type', /json/)
52} 52}
53 53
54function getBlacklistedVideosListWithTypeFilter (url: string, token: string, type: number, specialStatus = 200) {
55 const path = '/api/v1/videos/blacklist/'
56
57 return request(url)
58 .get(path)
59 .query({ sort: 'createdAt', type })
60 .set('Accept', 'application/json')
61 .set('Authorization', 'Bearer ' + token)
62 .expect(specialStatus)
63 .expect('Content-Type', /json/)
64}
65
54function getSortedBlacklistedVideosList (url: string, token: string, sort: string, specialStatus = 200) { 66function getSortedBlacklistedVideosList (url: string, token: string, sort: string, specialStatus = 200) {
55 const path = '/api/v1/videos/blacklist/' 67 const path = '/api/v1/videos/blacklist/'
56 68
@@ -69,6 +81,7 @@ export {
69 addVideoToBlacklist, 81 addVideoToBlacklist,
70 removeVideoFromBlacklist, 82 removeVideoFromBlacklist,
71 getBlacklistedVideosList, 83 getBlacklistedVideosList,
84 getBlacklistedVideosListWithTypeFilter,
72 getSortedBlacklistedVideosList, 85 getSortedBlacklistedVideosList,
73 updateVideoBlacklist 86 updateVideoBlacklist
74} 87}
diff --git a/shared/utils/videos/video-change-ownership.ts b/shared/utils/videos/video-change-ownership.ts
index f288692ea..371d02000 100644
--- a/shared/utils/videos/video-change-ownership.ts
+++ b/shared/utils/videos/video-change-ownership.ts
@@ -1,6 +1,6 @@
1import * as request from 'supertest' 1import * as request from 'supertest'
2 2
3function changeVideoOwnership (url: string, token: string, videoId: number | string, username) { 3function changeVideoOwnership (url: string, token: string, videoId: number | string, username, expectedStatus = 204) {
4 const path = '/api/v1/videos/' + videoId + '/give-ownership' 4 const path = '/api/v1/videos/' + videoId + '/give-ownership'
5 5
6 return request(url) 6 return request(url)
@@ -8,7 +8,7 @@ function changeVideoOwnership (url: string, token: string, videoId: number | str
8 .set('Accept', 'application/json') 8 .set('Accept', 'application/json')
9 .set('Authorization', 'Bearer ' + token) 9 .set('Authorization', 'Bearer ' + token)
10 .send({ username }) 10 .send({ username })
11 .expect(204) 11 .expect(expectedStatus)
12} 12}
13 13
14function getVideoChangeOwnershipList (url: string, token: string) { 14function getVideoChangeOwnershipList (url: string, token: string) {