diff options
Diffstat (limited to 'shared/extra-utils/videos/live.ts')
-rw-r--r-- | shared/extra-utils/videos/live.ts | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts index 522beb8bc..4aa66622b 100644 --- a/shared/extra-utils/videos/live.ts +++ b/shared/extra-utils/videos/live.ts | |||
@@ -10,8 +10,9 @@ import { buildAbsoluteFixturePath, buildServerDirectory, wait } from '../miscs/m | |||
10 | import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests' | 10 | import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests' |
11 | import { ServerInfo } from '../server/servers' | 11 | import { ServerInfo } from '../server/servers' |
12 | import { getVideoWithToken } from './videos' | 12 | import { getVideoWithToken } from './videos' |
13 | import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes' | ||
13 | 14 | ||
14 | function getLive (url: string, token: string, videoId: number | string, statusCodeExpected = 200) { | 15 | function getLive (url: string, token: string, videoId: number | string, statusCodeExpected = HttpStatusCode.OK_200) { |
15 | const path = '/api/v1/videos/live' | 16 | const path = '/api/v1/videos/live' |
16 | 17 | ||
17 | return makeGetRequest({ | 18 | return makeGetRequest({ |
@@ -22,7 +23,13 @@ function getLive (url: string, token: string, videoId: number | string, statusCo | |||
22 | }) | 23 | }) |
23 | } | 24 | } |
24 | 25 | ||
25 | function updateLive (url: string, token: string, videoId: number | string, fields: LiveVideoUpdate, statusCodeExpected = 204) { | 26 | function updateLive ( |
27 | url: string, | ||
28 | token: string, | ||
29 | videoId: number | string, | ||
30 | fields: LiveVideoUpdate, | ||
31 | statusCodeExpected = HttpStatusCode.NO_CONTENT_204 | ||
32 | ) { | ||
26 | const path = '/api/v1/videos/live' | 33 | const path = '/api/v1/videos/live' |
27 | 34 | ||
28 | return makePutBodyRequest({ | 35 | return makePutBodyRequest({ |
@@ -34,7 +41,7 @@ function updateLive (url: string, token: string, videoId: number | string, field | |||
34 | }) | 41 | }) |
35 | } | 42 | } |
36 | 43 | ||
37 | function createLive (url: string, token: string, fields: LiveVideoCreate, statusCodeExpected = 200) { | 44 | function createLive (url: string, token: string, fields: LiveVideoCreate, statusCodeExpected = HttpStatusCode.OK_200) { |
38 | const path = '/api/v1/videos/live' | 45 | const path = '/api/v1/videos/live' |
39 | 46 | ||
40 | const attaches: any = {} | 47 | const attaches: any = {} |