From a7fea183f0f69104b209e7bfdd6435be28165f22 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 9 Feb 2018 16:47:06 +0100 Subject: Begin import script with youtube-dl --- server/tests/utils/videos/videos.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'server/tests/utils/videos') diff --git a/server/tests/utils/videos/videos.ts b/server/tests/utils/videos/videos.ts index 0b28edd48..923ca48f1 100644 --- a/server/tests/utils/videos/videos.ts +++ b/server/tests/utils/videos/videos.ts @@ -249,8 +249,6 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg .set('Accept', 'application/json') .set('Authorization', 'Bearer ' + accessToken) .field('name', attributes.name) - .field('category', attributes.category.toString()) - .field('licence', attributes.licence.toString()) .field('nsfw', JSON.stringify(attributes.nsfw)) .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled)) .field('description', attributes.description) @@ -260,6 +258,12 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg if (attributes.language !== undefined) { req.field('language', attributes.language.toString()) } + if (attributes.category !== undefined) { + req.field('category', attributes.category.toString()) + } + if (attributes.licence !== undefined) { + req.field('licence', attributes.licence.toString()) + } for (let i = 0; i < attributes.tags.length; i++) { req.field('tags[' + i + ']', attributes.tags[i]) -- cgit v1.2.3