From 6f530096cbceda09377c2e8e235cf02c36226989 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 29 Jul 2019 14:10:31 +0200 Subject: [PATCH] Correctly import tags in CLI --- server/tools/cli.ts | 6 ++++-- server/tools/peertube-upload.ts | 6 +----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/server/tools/cli.ts b/server/tools/cli.ts index 67755022c..8599a270f 100644 --- a/server/tools/cli.ts +++ b/server/tools/cli.ts @@ -121,7 +121,7 @@ function buildCommonVideoOptions (command: Command) { .option('-w, --wait-transcoding', 'Wait transcoding before publishing the video') } -async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any) { +async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any = {}) { const defaultBooleanAttributes = { nsfw: false, commentsEnabled: true, @@ -147,7 +147,9 @@ async function buildVideoAttributesFromCommander (url: string, command: Command, licence: command[ 'licence' ] || defaultAttributes.licence || undefined, language: command[ 'language' ] || defaultAttributes.language || undefined, privacy: command[ 'privacy' ] || defaultAttributes.privacy || VideoPrivacy.PUBLIC, - support: command[ 'support' ] || defaultAttributes.support || undefined + support: command[ 'support' ] || defaultAttributes.support || undefined, + description: command[ 'videoDescription' ] || defaultAttributes.description || undefined, + tags: command[ 'tags' ] || defaultAttributes.tags || undefined } Object.assign(videoAttributes, booleanAttributes) diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index d9f9a8ead..4569cbb85 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -46,11 +46,7 @@ async function run (url: string, username: string, password: string) { console.log('Uploading %s video...', program[ 'videoName' ]) - const defaultAttributes = { - tags: command[ 'tags' ], - description: command[ 'videoDescription' ] - } - const videoAttributes = await buildVideoAttributesFromCommander(url, program, defaultAttributes) + const videoAttributes = await buildVideoAttributesFromCommander(url, program) Object.assign(videoAttributes, { fixture: program[ 'file' ], -- 2.25.1