aboutsummaryrefslogtreecommitdiffhomepage
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/tools/cli.ts6
-rw-r--r--server/tools/peertube-upload.ts6
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) {
121 .option('-w, --wait-transcoding', 'Wait transcoding before publishing the video') 121 .option('-w, --wait-transcoding', 'Wait transcoding before publishing the video')
122} 122}
123 123
124async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any) { 124async function buildVideoAttributesFromCommander (url: string, command: Command, defaultAttributes: any = {}) {
125 const defaultBooleanAttributes = { 125 const defaultBooleanAttributes = {
126 nsfw: false, 126 nsfw: false,
127 commentsEnabled: true, 127 commentsEnabled: true,
@@ -147,7 +147,9 @@ async function buildVideoAttributesFromCommander (url: string, command: Command,
147 licence: command[ 'licence' ] || defaultAttributes.licence || undefined, 147 licence: command[ 'licence' ] || defaultAttributes.licence || undefined,
148 language: command[ 'language' ] || defaultAttributes.language || undefined, 148 language: command[ 'language' ] || defaultAttributes.language || undefined,
149 privacy: command[ 'privacy' ] || defaultAttributes.privacy || VideoPrivacy.PUBLIC, 149 privacy: command[ 'privacy' ] || defaultAttributes.privacy || VideoPrivacy.PUBLIC,
150 support: command[ 'support' ] || defaultAttributes.support || undefined 150 support: command[ 'support' ] || defaultAttributes.support || undefined,
151 description: command[ 'videoDescription' ] || defaultAttributes.description || undefined,
152 tags: command[ 'tags' ] || defaultAttributes.tags || undefined
151 } 153 }
152 154
153 Object.assign(videoAttributes, booleanAttributes) 155 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) {
46 46
47 console.log('Uploading %s video...', program[ 'videoName' ]) 47 console.log('Uploading %s video...', program[ 'videoName' ])
48 48
49 const defaultAttributes = { 49 const videoAttributes = await buildVideoAttributesFromCommander(url, program)
50 tags: command[ 'tags' ],
51 description: command[ 'videoDescription' ]
52 }
53 const videoAttributes = await buildVideoAttributesFromCommander(url, program, defaultAttributes)
54 50
55 Object.assign(videoAttributes, { 51 Object.assign(videoAttributes, {
56 fixture: program[ 'file' ], 52 fixture: program[ 'file' ],