Correctly import tags in CLI
This commit is contained in:
parent
2284f20207
commit
6f530096cb
|
@ -121,7 +121,7 @@ function buildCommonVideoOptions (command: Command) {
|
||||||
.option('-w, --wait-transcoding', 'Wait transcoding before publishing the video')
|
.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 = {
|
const defaultBooleanAttributes = {
|
||||||
nsfw: false,
|
nsfw: false,
|
||||||
commentsEnabled: true,
|
commentsEnabled: true,
|
||||||
|
@ -147,7 +147,9 @@ async function buildVideoAttributesFromCommander (url: string, command: Command,
|
||||||
licence: command[ 'licence' ] || defaultAttributes.licence || undefined,
|
licence: command[ 'licence' ] || defaultAttributes.licence || undefined,
|
||||||
language: command[ 'language' ] || defaultAttributes.language || undefined,
|
language: command[ 'language' ] || defaultAttributes.language || undefined,
|
||||||
privacy: command[ 'privacy' ] || defaultAttributes.privacy || VideoPrivacy.PUBLIC,
|
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)
|
Object.assign(videoAttributes, booleanAttributes)
|
||||||
|
|
|
@ -46,11 +46,7 @@ async function run (url: string, username: string, password: string) {
|
||||||
|
|
||||||
console.log('Uploading %s video...', program[ 'videoName' ])
|
console.log('Uploading %s video...', program[ 'videoName' ])
|
||||||
|
|
||||||
const defaultAttributes = {
|
const videoAttributes = await buildVideoAttributesFromCommander(url, program)
|
||||||
tags: command[ 'tags' ],
|
|
||||||
description: command[ 'videoDescription' ]
|
|
||||||
}
|
|
||||||
const videoAttributes = await buildVideoAttributesFromCommander(url, program, defaultAttributes)
|
|
||||||
|
|
||||||
Object.assign(videoAttributes, {
|
Object.assign(videoAttributes, {
|
||||||
fixture: program[ 'file' ],
|
fixture: program[ 'file' ],
|
||||||
|
|
Loading…
Reference in New Issue