diff options
Diffstat (limited to 'shared')
-rw-r--r-- | shared/models/activitypub/objects/video-torrent-object.ts | 3 | ||||
-rw-r--r-- | shared/models/videos/video-create.model.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/video-update.model.ts | 1 | ||||
-rw-r--r-- | shared/models/videos/video.model.ts | 1 | ||||
-rw-r--r-- | shared/utils/videos/videos.ts | 6 |
5 files changed, 11 insertions, 1 deletions
diff --git a/shared/models/activitypub/objects/video-torrent-object.ts b/shared/models/activitypub/objects/video-torrent-object.ts index 8504c178f..4231fbb68 100644 --- a/shared/models/activitypub/objects/video-torrent-object.ts +++ b/shared/models/activitypub/objects/video-torrent-object.ts | |||
@@ -20,7 +20,8 @@ export interface VideoTorrentObject { | |||
20 | subtitleLanguage: ActivityIdentifierObject[] | 20 | subtitleLanguage: ActivityIdentifierObject[] |
21 | views: number | 21 | views: number |
22 | sensitive: boolean | 22 | sensitive: boolean |
23 | commentsEnabled: boolean | 23 | commentsEnabled: boolean, |
24 | downloadEnabled: boolean, | ||
24 | waitTranscoding: boolean | 25 | waitTranscoding: boolean |
25 | state: VideoState | 26 | state: VideoState |
26 | published: string | 27 | published: string |
diff --git a/shared/models/videos/video-create.model.ts b/shared/models/videos/video-create.model.ts index 190d63783..f153a1d00 100644 --- a/shared/models/videos/video-create.model.ts +++ b/shared/models/videos/video-create.model.ts | |||
@@ -13,6 +13,7 @@ export interface VideoCreate { | |||
13 | name: string | 13 | name: string |
14 | tags?: string[] | 14 | tags?: string[] |
15 | commentsEnabled?: boolean | 15 | commentsEnabled?: boolean |
16 | downloadEnabled?: boolean | ||
16 | privacy: VideoPrivacy | 17 | privacy: VideoPrivacy |
17 | scheduleUpdate?: VideoScheduleUpdate | 18 | scheduleUpdate?: VideoScheduleUpdate |
18 | } | 19 | } |
diff --git a/shared/models/videos/video-update.model.ts b/shared/models/videos/video-update.model.ts index ed141a824..6f96633ae 100644 --- a/shared/models/videos/video-update.model.ts +++ b/shared/models/videos/video-update.model.ts | |||
@@ -11,6 +11,7 @@ export interface VideoUpdate { | |||
11 | privacy?: VideoPrivacy | 11 | privacy?: VideoPrivacy |
12 | tags?: string[] | 12 | tags?: string[] |
13 | commentsEnabled?: boolean | 13 | commentsEnabled?: boolean |
14 | downloadEnabled?: boolean | ||
14 | nsfw?: boolean | 15 | nsfw?: boolean |
15 | waitTranscoding?: boolean | 16 | waitTranscoding?: boolean |
16 | channelId?: number | 17 | channelId?: number |
diff --git a/shared/models/videos/video.model.ts b/shared/models/videos/video.model.ts index 803db8255..891831a9e 100644 --- a/shared/models/videos/video.model.ts +++ b/shared/models/videos/video.model.ts | |||
@@ -83,6 +83,7 @@ export interface VideoDetails extends Video { | |||
83 | files: VideoFile[] | 83 | files: VideoFile[] |
84 | account: Account | 84 | account: Account |
85 | commentsEnabled: boolean | 85 | commentsEnabled: boolean |
86 | downloadEnabled: boolean | ||
86 | 87 | ||
87 | // Not optional in details (unlike in Video) | 88 | // Not optional in details (unlike in Video) |
88 | waitTranscoding: boolean | 89 | waitTranscoding: boolean |
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) |