]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Define channelId property beforehand
authorAndrew Morgan <andrew@amorgan.xyz>
Sat, 29 Sep 2018 00:49:33 +0000 (02:49 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 12:14:49 +0000 (14:14 +0200)
server/tools/peertube-upload.ts

index 4034b7e38051102ff4aeacdc6c74ca3270bb4c92..6248fb47d648f6cc1519f9892080991582e8b363 100644 (file)
@@ -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.`)