aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils')
-rw-r--r--shared/extra-utils/videos/video-channels.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/shared/extra-utils/videos/video-channels.ts b/shared/extra-utils/videos/video-channels.ts
index 51d433940..55f08b996 100644
--- a/shared/extra-utils/videos/video-channels.ts
+++ b/shared/extra-utils/videos/video-channels.ts
@@ -8,7 +8,7 @@ import { ServerInfo } from '../server/servers'
8import { User } from '../../models/users/user.model' 8import { User } from '../../models/users/user.model'
9import { getMyUserInformation } from '../users/users' 9import { getMyUserInformation } from '../users/users'
10 10
11function getVideoChannelsList (url: string, start: number, count: number, sort?: string) { 11function getVideoChannelsList (url: string, start: number, count: number, sort?: string, withStats?: boolean) {
12 const path = '/api/v1/video-channels' 12 const path = '/api/v1/video-channels'
13 13
14 const req = request(url) 14 const req = request(url)
@@ -17,6 +17,7 @@ function getVideoChannelsList (url: string, start: number, count: number, sort?:
17 .query({ count: count }) 17 .query({ count: count })
18 18
19 if (sort) req.query({ sort }) 19 if (sort) req.query({ sort })
20 if (withStats) req.query({ withStats })
20 21
21 return req.set('Accept', 'application/json') 22 return req.set('Accept', 'application/json')
22 .expect(200) 23 .expect(200)
@@ -30,8 +31,9 @@ function getAccountVideoChannelsList (parameters: {
30 count?: number 31 count?: number
31 sort?: string 32 sort?: string
32 specialStatus?: number 33 specialStatus?: number
34 withStats?: boolean
33}) { 35}) {
34 const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200 } = parameters 36 const { url, accountName, start, count, sort = 'createdAt', specialStatus = 200, withStats = false } = parameters
35 37
36 const path = '/api/v1/accounts/' + accountName + '/video-channels' 38 const path = '/api/v1/accounts/' + accountName + '/video-channels'
37 39
@@ -41,7 +43,8 @@ function getAccountVideoChannelsList (parameters: {
41 query: { 43 query: {
42 start, 44 start,
43 count, 45 count,
44 sort 46 sort,
47 withStats
45 }, 48 },
46 statusCodeExpected: specialStatus 49 statusCodeExpected: specialStatus
47 }) 50 })