diff options
author | Chocobozzz <me@florianbigard.com> | 2020-11-02 15:43:44 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-11-09 15:33:04 +0100 |
commit | af4ae64f6faf38f8179f2e07d3cd4ad60006be92 (patch) | |
tree | a2d39ddc138d49619f03f11e003c2302f824286c /shared/extra-utils/videos | |
parent | 77e9f859c6ad75ba179dec74e5410cc651eaa49b (diff) | |
download | PeerTube-af4ae64f6faf38f8179f2e07d3cd4ad60006be92.tar.gz PeerTube-af4ae64f6faf38f8179f2e07d3cd4ad60006be92.tar.zst PeerTube-af4ae64f6faf38f8179f2e07d3cd4ad60006be92.zip |
Begin live tests
Diffstat (limited to 'shared/extra-utils/videos')
-rw-r--r-- | shared/extra-utils/videos/live.ts | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/shared/extra-utils/videos/live.ts b/shared/extra-utils/videos/live.ts index f500fdc3e..65942db0a 100644 --- a/shared/extra-utils/videos/live.ts +++ b/shared/extra-utils/videos/live.ts | |||
@@ -2,8 +2,8 @@ import * as ffmpeg from 'fluent-ffmpeg' | |||
2 | import { LiveVideoCreate, LiveVideoUpdate, VideoDetails, VideoState } from '@shared/models' | 2 | import { LiveVideoCreate, LiveVideoUpdate, VideoDetails, VideoState } from '@shared/models' |
3 | import { buildAbsoluteFixturePath, wait } from '../miscs/miscs' | 3 | import { buildAbsoluteFixturePath, wait } from '../miscs/miscs' |
4 | import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests' | 4 | import { makeGetRequest, makePutBodyRequest, makeUploadRequest } from '../requests/requests' |
5 | import { ServerInfo } from '../server/servers' | 5 | import { getVideoWithToken } from './videos' |
6 | import { getVideo, getVideoWithToken } from './videos' | 6 | import { omit } from 'lodash' |
7 | 7 | ||
8 | function getLive (url: string, token: string, videoId: number | string, statusCodeExpected = 200) { | 8 | function getLive (url: string, token: string, videoId: number | string, statusCodeExpected = 200) { |
9 | const path = '/api/v1/videos/live' | 9 | const path = '/api/v1/videos/live' |
@@ -31,16 +31,18 @@ function updateLive (url: string, token: string, videoId: number | string, field | |||
31 | function createLive (url: string, token: string, fields: LiveVideoCreate, statusCodeExpected = 200) { | 31 | function createLive (url: string, token: string, fields: LiveVideoCreate, statusCodeExpected = 200) { |
32 | const path = '/api/v1/videos/live' | 32 | const path = '/api/v1/videos/live' |
33 | 33 | ||
34 | let attaches: any = {} | 34 | const attaches: any = {} |
35 | if (fields.thumbnailfile) attaches = { thumbnailfile: fields.thumbnailfile } | 35 | if (fields.thumbnailfile) attaches.thumbnailfile = fields.thumbnailfile |
36 | if (fields.previewfile) attaches = { previewfile: fields.previewfile } | 36 | if (fields.previewfile) attaches.previewfile = fields.previewfile |
37 | |||
38 | const updatedFields = omit(fields, 'thumbnailfile', 'previewfile') | ||
37 | 39 | ||
38 | return makeUploadRequest({ | 40 | return makeUploadRequest({ |
39 | url, | 41 | url, |
40 | path, | 42 | path, |
41 | token, | 43 | token, |
42 | attaches, | 44 | attaches, |
43 | fields, | 45 | fields: updatedFields, |
44 | statusCodeExpected | 46 | statusCodeExpected |
45 | }) | 47 | }) |
46 | } | 48 | } |