From 26b415176212b44ff6ce168cb00aeb93b10c0cb3 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Sat, 29 Sep 2018 02:49:33 +0200 Subject: [PATCH] Define channelId property beforehand --- server/tools/peertube-upload.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index 4034b7e38..6248fb47d 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -106,9 +106,10 @@ async function run () { console.log('Uploading %s video...', program[ 'videoName' ]) - let videoAttributes:any = { + const videoAttributes = { name: program['videoName'], category: program['category'], + channelId: program['channelId'], licence: program['licence'], language: program['language'], nsfw: program['nsfw'], @@ -123,10 +124,6 @@ async function run () { support: undefined } - if (program['channelId']) { - videoAttributes.channelId = program['channelId'] - } - await uploadVideo(program[ 'url' ], accessToken, videoAttributes) console.log(`Video ${program['videoName']} uploaded.`)