aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/utils
diff options
context:
space:
mode:
Diffstat (limited to 'shared/utils')
-rw-r--r--shared/utils/videos/videos.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/shared/utils/videos/videos.ts b/shared/utils/videos/videos.ts
index b5b33e038..39c808d1f 100644
--- a/shared/utils/videos/videos.ts
+++ b/shared/utils/videos/videos.ts
@@ -28,6 +28,7 @@ type VideoAttributes = {
28 language?: string 28 language?: string
29 nsfw?: boolean 29 nsfw?: boolean
30 commentsEnabled?: boolean 30 commentsEnabled?: boolean
31 downloadEnabled?: boolean
31 waitTranscoding?: boolean 32 waitTranscoding?: boolean
32 description?: string 33 description?: string
33 tags?: string[] 34 tags?: string[]
@@ -320,6 +321,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
320 tags: [ 'tag' ], 321 tags: [ 'tag' ],
321 privacy: VideoPrivacy.PUBLIC, 322 privacy: VideoPrivacy.PUBLIC,
322 commentsEnabled: true, 323 commentsEnabled: true,
324 downloadEnabled: true,
323 fixture: 'video_short.webm' 325 fixture: 'video_short.webm'
324 }, videoAttributesArg) 326 }, videoAttributesArg)
325 327
@@ -330,6 +332,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
330 .field('name', attributes.name) 332 .field('name', attributes.name)
331 .field('nsfw', JSON.stringify(attributes.nsfw)) 333 .field('nsfw', JSON.stringify(attributes.nsfw))
332 .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled)) 334 .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
335 .field('downloadEnabled', JSON.stringify(attributes.downloadEnabled))
333 .field('waitTranscoding', JSON.stringify(attributes.waitTranscoding)) 336 .field('waitTranscoding', JSON.stringify(attributes.waitTranscoding))
334 .field('privacy', attributes.privacy.toString()) 337 .field('privacy', attributes.privacy.toString())
335 .field('channelId', attributes.channelId) 338 .field('channelId', attributes.channelId)
@@ -380,6 +383,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att
380 if (attributes.language) body['language'] = attributes.language 383 if (attributes.language) body['language'] = attributes.language
381 if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw) 384 if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw)
382 if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled) 385 if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled)
386 if (attributes.downloadEnabled !== undefined) body['downloadEnabled'] = JSON.stringify(attributes.downloadEnabled)
383 if (attributes.description) body['description'] = attributes.description 387 if (attributes.description) body['description'] = attributes.description
384 if (attributes.tags) body['tags'] = attributes.tags 388 if (attributes.tags) body['tags'] = attributes.tags
385 if (attributes.privacy) body['privacy'] = attributes.privacy 389 if (attributes.privacy) body['privacy'] = attributes.privacy
@@ -445,6 +449,7 @@ async function completeVideoCheck (
445 language: string 449 language: string
446 nsfw: boolean 450 nsfw: boolean
447 commentsEnabled: boolean 451 commentsEnabled: boolean
452 downloadEnabled: boolean
448 description: string 453 description: string
449 publishedAt?: string 454 publishedAt?: string
450 support: string 455 support: string
@@ -519,6 +524,7 @@ async function completeVideoCheck (
519 expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true 524 expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true
520 expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true 525 expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true
521 expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled) 526 expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled)
527 expect(videoDetails.downloadEnabled).to.equal(attributes.downloadEnabled)
522 528
523 for (const attributeFile of attributes.files) { 529 for (const attributeFile of attributes.files) {
524 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution) 530 const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)