From 2baea0c77cc765f7cbca9c9a2f4272268892a35c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 14 Jun 2018 18:06:56 +0200 Subject: Add ability for uploaders to schedule video update --- server/tests/utils/videos/videos.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'server/tests/utils') 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 = { fixture?: string thumbnailfile?: string previewfile?: string + scheduleUpdate?: { + updateAt: string + privacy?: VideoPrivacy + } } function getVideoCategories (url: string) { @@ -371,6 +375,14 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg req.attach('previewfile', buildAbsoluteFixturePath(attributes.previewfile)) } + if (attributes.scheduleUpdate) { + req.field('scheduleUpdate[updateAt]', attributes.scheduleUpdate.updateAt) + + if (attributes.scheduleUpdate.privacy) { + req.field('scheduleUpdate[privacy]', attributes.scheduleUpdate.privacy) + } + } + return req.attach('videofile', buildAbsoluteFixturePath(attributes.fixture)) .expect(specialStatus) } @@ -389,6 +401,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att if (attributes.tags) body['tags'] = attributes.tags if (attributes.privacy) body['privacy'] = attributes.privacy if (attributes.channelId) body['channelId'] = attributes.channelId + if (attributes.scheduleUpdate) body['scheduleUpdate'] = attributes.scheduleUpdate // Upload request if (attributes.thumbnailfile || attributes.previewfile) { -- cgit v1.2.3