Define channelId property beforehand

This commit is contained in:
Andrew Morgan 2018-09-29 02:49:33 +02:00 committed by Chocobozzz
parent c01cfce40b
commit 26b4151762
1 changed files with 2 additions and 5 deletions

View File

@ -106,9 +106,10 @@ async function run () {
console.log('Uploading %s video...', program[ 'videoName' ]) console.log('Uploading %s video...', program[ 'videoName' ])
let videoAttributes:any = { const videoAttributes = {
name: program['videoName'], name: program['videoName'],
category: program['category'], category: program['category'],
channelId: program['channelId'],
licence: program['licence'], licence: program['licence'],
language: program['language'], language: program['language'],
nsfw: program['nsfw'], nsfw: program['nsfw'],
@ -123,10 +124,6 @@ async function run () {
support: undefined support: undefined
} }
if (program['channelId']) {
videoAttributes.channelId = program['channelId']
}
await uploadVideo(program[ 'url' ], accessToken, videoAttributes) await uploadVideo(program[ 'url' ], accessToken, videoAttributes)
console.log(`Video ${program['videoName']} uploaded.`) console.log(`Video ${program['videoName']} uploaded.`)