.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,
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)
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' ],