diff options
author | Chocobozzz <me@florianbigard.com> | 2018-06-14 18:06:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-06-14 18:06:56 +0200 |
commit | 2baea0c77cc765f7cbca9c9a2f4272268892a35c (patch) | |
tree | 47b1be5535439409a97eb80c0222c9c821b83dae /server/tests/utils/videos/videos.ts | |
parent | bf079b7bfd7f0fb75ceb28e333bb4b74d8840dd4 (diff) | |
download | PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.tar.gz PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.tar.zst PeerTube-2baea0c77cc765f7cbca9c9a2f4272268892a35c.zip |
Add ability for uploaders to schedule video update
Diffstat (limited to 'server/tests/utils/videos/videos.ts')
-rw-r--r-- | server/tests/utils/videos/videos.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 2c1d20ef1..4f7ce6d6b 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts | |||
@@ -35,6 +35,10 @@ type VideoAttributes = { | |||
35 | fixture?: string | 35 | fixture?: string |
36 | thumbnailfile?: string | 36 | thumbnailfile?: string |
37 | previewfile?: string | 37 | previewfile?: string |
38 | scheduleUpdate?: { | ||
39 | updateAt: string | ||
40 | privacy?: VideoPrivacy | ||
41 | } | ||
38 | } | 42 | } |
39 | 43 | ||
40 | function getVideoCategories (url: string) { | 44 | function getVideoCategories (url: string) { |
@@ -371,6 +375,14 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg | |||
371 | req.attach('previewfile', buildAbsoluteFixturePath(attributes.previewfile)) | 375 | req.attach('previewfile', buildAbsoluteFixturePath(attributes.previewfile)) |
372 | } | 376 | } |
373 | 377 | ||
378 | if (attributes.scheduleUpdate) { | ||
379 | req.field('scheduleUpdate[updateAt]', attributes.scheduleUpdate.updateAt) | ||
380 | |||
381 | if (attributes.scheduleUpdate.privacy) { | ||
382 | req.field('scheduleUpdate[privacy]', attributes.scheduleUpdate.privacy) | ||
383 | } | ||
384 | } | ||
385 | |||
374 | return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture)) | 386 | return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture)) |
375 | .expect(specialStatus) | 387 | .expect(specialStatus) |
376 | } | 388 | } |
@@ -389,6 +401,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att | |||
389 | if (attributes.tags) body['tags'] = attributes.tags | 401 | if (attributes.tags) body['tags'] = attributes.tags |
390 | if (attributes.privacy) body['privacy'] = attributes.privacy | 402 | if (attributes.privacy) body['privacy'] = attributes.privacy |
391 | if (attributes.channelId) body['channelId'] = attributes.channelId | 403 | if (attributes.channelId) body['channelId'] = attributes.channelId |
404 | if (attributes.scheduleUpdate) body['scheduleUpdate'] = attributes.scheduleUpdate | ||
392 | 405 | ||
393 | // Upload request | 406 | // Upload request |
394 | if (attributes.thumbnailfile || attributes.previewfile) { | 407 | if (attributes.thumbnailfile || attributes.previewfile) { |