aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-06-11 10:39:30 +0200
committerChocobozzz <me@florianbigard.com>2019-06-11 10:39:30 +0200
commitfc8c024a1b1b1e439ef8f5b34513033920852b82 (patch)
tree8ed5c2745cc4997c822eb62bf2e5047a6938262d
parent4c7f7761362224bb19573faa485b16a40eab0bc4 (diff)
downloadPeerTube-fc8c024a1b1b1e439ef8f5b34513033920852b82.tar.gz
PeerTube-fc8c024a1b1b1e439ef8f5b34513033920852b82.tar.zst
PeerTube-fc8c024a1b1b1e439ef8f5b34513033920852b82.zip
Fix upload script
-rw-r--r--server/tools/peertube-upload.ts3
-rw-r--r--shared/extra-utils/videos/videos.ts5
2 files changed, 5 insertions, 3 deletions
diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts
index 687f2e60b..bfce10e54 100644
--- a/server/tools/peertube-upload.ts
+++ b/server/tools/peertube-upload.ts
@@ -77,7 +77,7 @@ async function run (url: string, username: string, password: string) {
77 licence: program['licence'] || undefined, 77 licence: program['licence'] || undefined,
78 language: program['language'] || undefined, 78 language: program['language'] || undefined,
79 nsfw: program['nsfw'] !== undefined ? program['nsfw'] : false, 79 nsfw: program['nsfw'] !== undefined ? program['nsfw'] : false,
80 description: program['videoDescription'] || '', 80 description: program['videoDescription'] || undefined,
81 tags: program['tags'] || [], 81 tags: program['tags'] || [],
82 commentsEnabled: program['commentsEnabled'] !== undefined ? program['commentsEnabled'] : true, 82 commentsEnabled: program['commentsEnabled'] !== undefined ? program['commentsEnabled'] : true,
83 downloadEnabled: program['downloadEnabled'] !== undefined ? program['downloadEnabled'] : true, 83 downloadEnabled: program['downloadEnabled'] !== undefined ? program['downloadEnabled'] : true,
@@ -94,7 +94,6 @@ async function run (url: string, username: string, password: string) {
94 console.log(`Video ${program['videoName']} uploaded.`) 94 console.log(`Video ${program['videoName']} uploaded.`)
95 process.exit(0) 95 process.exit(0)
96 } catch (err) { 96 } catch (err) {
97 console.log('coucou')
98 console.error(require('util').inspect(err)) 97 console.error(require('util').inspect(err))
99 process.exit(-1) 98 process.exit(-1)
100 } 99 }
diff --git a/shared/extra-utils/videos/videos.ts b/shared/extra-utils/videos/videos.ts
index debaaf9a7..c78563232 100644
--- a/shared/extra-utils/videos/videos.ts
+++ b/shared/extra-utils/videos/videos.ts
@@ -355,7 +355,6 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
355 .set('Accept', 'application/json') 355 .set('Accept', 'application/json')
356 .set('Authorization', 'Bearer ' + accessToken) 356 .set('Authorization', 'Bearer ' + accessToken)
357 .field('name', attributes.name) 357 .field('name', attributes.name)
358 .field('support', attributes.support)
359 .field('nsfw', JSON.stringify(attributes.nsfw)) 358 .field('nsfw', JSON.stringify(attributes.nsfw))
360 .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled)) 359 .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
361 .field('downloadEnabled', JSON.stringify(attributes.downloadEnabled)) 360 .field('downloadEnabled', JSON.stringify(attributes.downloadEnabled))
@@ -363,6 +362,10 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
363 .field('privacy', attributes.privacy.toString()) 362 .field('privacy', attributes.privacy.toString())
364 .field('channelId', attributes.channelId) 363 .field('channelId', attributes.channelId)
365 364
365 if (attributes.support !== undefined) {
366 req.field('support', attributes.support)
367 }
368
366 if (attributes.description !== undefined) { 369 if (attributes.description !== undefined) {
367 req.field('description', attributes.description) 370 req.field('description', attributes.description)
368 } 371 }