]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Rename downloadingEnabled property to downloadEnabled
authorLucas Declercq <lucas.declercq@ineat-conseil.fr>
Mon, 8 Oct 2018 12:45:22 +0000 (14:45 +0200)
committerLucas Declercq <lucas.declercq@ineat-conseil.fr>
Mon, 8 Oct 2018 12:45:22 +0000 (14:45 +0200)
35 files changed:
client/src/app/shared/video-import/video-import.service.ts
client/src/app/shared/video/video-details.model.ts
client/src/app/shared/video/video-edit.model.ts
client/src/app/shared/video/video.service.ts
client/src/app/videos/+video-edit/shared/video-edit.component.html
client/src/app/videos/+video-edit/shared/video-edit.component.ts
client/src/app/videos/+video-edit/video-add-components/video-import-torrent.component.ts
client/src/app/videos/+video-edit/video-add-components/video-import-url.component.ts
client/src/app/videos/+video-edit/video-add-components/video-upload.component.ts
client/src/app/videos/+video-watch/video-watch.component.ts
server/controllers/api/videos/import.ts
server/controllers/api/videos/index.ts
server/helpers/activitypub.ts
server/helpers/audit-logger.ts
server/helpers/custom-validators/activitypub/videos.ts
server/initializers/migrations/0280-video-downloading-enabled.ts
server/lib/activitypub/videos.ts
server/middlewares/validators/videos/videos.ts
server/models/video/video-format-utils.ts
server/models/video/video.ts
server/tests/api/check-params/video-imports.ts
server/tests/api/check-params/videos.ts
server/tests/api/server/follows.ts
server/tests/api/server/handle-down.ts
server/tests/api/videos/multiple-servers.ts
server/tests/api/videos/single-server.ts
server/tests/utils/videos/videos.ts
server/tools/peertube-import-videos.ts
server/tools/peertube-upload.ts
shared/models/activitypub/objects/video-torrent-object.ts
shared/models/videos/video-create.model.ts
shared/models/videos/video-update.model.ts
shared/models/videos/video.model.ts
support/doc/api/openapi.yaml
support/doc/api/videos.yaml

index 74c458645a5f152b946d24c18eba5b256aad2bc9..2163eb905e9e981333941c01665958a68b63b98f 100644 (file)
@@ -81,7 +81,7 @@ export class VideoImportService {
       nsfw: video.nsfw,
       waitTranscoding: video.waitTranscoding,
       commentsEnabled: video.commentsEnabled,
-      downloadingEnabled: video.downloadingEnabled,
+      downloadEnabled: video.downloadEnabled,
       thumbnailfile: video.thumbnailfile,
       previewfile: video.previewfile,
       scheduleUpdate
index ad85641dcd63c5dbddef6fc80c5e6e61cbdd6665..5ff3926c478efa9d9f0afbff1ab1884dd6f64615 100644 (file)
@@ -12,7 +12,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
   files: VideoFile[]
   account: Account
   commentsEnabled: boolean
-  downloadingEnabled: boolean
+  downloadEnabled: boolean
 
   waitTranscoding: boolean
   state: VideoConstant<VideoState>
@@ -30,7 +30,7 @@ export class VideoDetails extends Video implements VideoDetailsServerModel {
     this.tags = hash.tags
     this.support = hash.support
     this.commentsEnabled = hash.commentsEnabled
-    this.downloadingEnabled = hash.downloadingEnabled
+    this.downloadEnabled = hash.downloadEnabled
 
     this.buildLikeAndDislikePercents()
   }
index 47703ff798b2cda015ccff1d19bf64ad559c600e..e385004e57b68600e42a675b8dd1dcfff5651491 100644 (file)
@@ -14,7 +14,7 @@ export class VideoEdit implements VideoUpdate {
   tags: string[]
   nsfw: boolean
   commentsEnabled: boolean
-  downloadingEnabled: boolean
+  downloadEnabled: boolean
   waitTranscoding: boolean
   channelId: number
   privacy: VideoPrivacy
@@ -27,7 +27,7 @@ export class VideoEdit implements VideoUpdate {
   id?: number
   scheduleUpdate?: VideoScheduleUpdate
 
-  constructor (video?: Video & { tags: string[], commentsEnabled: boolean, downloadingEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
+  constructor (video?: Video & { tags: string[], commentsEnabled: boolean, downloadEnabled: boolean, support: string, thumbnailUrl: string, previewUrl: string }) {
     if (video) {
       this.id = video.id
       this.uuid = video.uuid
@@ -39,7 +39,7 @@ export class VideoEdit implements VideoUpdate {
       this.tags = video.tags
       this.nsfw = video.nsfw
       this.commentsEnabled = video.commentsEnabled
-      this.downloadingEnabled = video.downloadingEnabled
+      this.downloadEnabled = video.downloadEnabled
       this.waitTranscoding = video.waitTranscoding
       this.channelId = video.channel.id
       this.privacy = video.privacy.id
@@ -82,7 +82,7 @@ export class VideoEdit implements VideoUpdate {
       tags: this.tags,
       nsfw: this.nsfw,
       commentsEnabled: this.commentsEnabled,
-      downloadingEnabled: this.downloadingEnabled,
+      downloadEnabled: this.downloadEnabled,
       waitTranscoding: this.waitTranscoding,
       channelId: this.channelId,
       privacy: this.privacy
index c0339dd39d806cca4efc1a402a9eec881c93db3b..c9d6da7a4e125e4a8107cc243275122552dd0bc3 100644 (file)
@@ -95,7 +95,7 @@ export class VideoService implements VideosProvider {
       nsfw: video.nsfw,
       waitTranscoding: video.waitTranscoding,
       commentsEnabled: video.commentsEnabled,
-      downloadingEnabled: video.downloadingEnabled,
+      downloadEnabled: video.downloadEnabled,
       thumbnailfile: video.thumbnailfile,
       previewfile: video.previewfile,
       scheduleUpdate
index 70d53505518a4676e77f3d6dc208782b88f9699e..8c74a1ca6f45a87d98662628802d92048943ed36 100644 (file)
             ></my-peertube-checkbox>
 
             <my-peertube-checkbox
-              inputName="downloadingEnabled" formControlName="downloadingEnabled"
+              inputName="downloadEnabled" formControlName="downloadEnabled"
               i18n-labelText labelText="Disable downloading"
             ></my-peertube-checkbox>
 
index b09664376f1afba9bd94e19b0a07ade16e4bcbcd..1dae931e2bb270139c33d7a52e085413e2f75988 100644 (file)
@@ -80,7 +80,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
     const defaultValues = {
       nsfw: 'false',
       commentsEnabled: 'true',
-      downloadingEnabled: 'true',
+      downloadEnabled: 'true',
       waitTranscoding: 'true',
       tags: []
     }
@@ -90,7 +90,7 @@ export class VideoEditComponent implements OnInit, OnDestroy {
       channelId: this.videoValidatorsService.VIDEO_CHANNEL,
       nsfw: null,
       commentsEnabled: null,
-      downloadingEnabled: null,
+      downloadEnabled: null,
       waitTranscoding: null,
       category: this.videoValidatorsService.VIDEO_CATEGORY,
       licence: this.videoValidatorsService.VIDEO_LICENCE,
index 57cf0e395639202b245cf41c849c4b2047602098..0f6fd17a9ca1d6b7f5f9aadbbda99e65372b1f30 100644 (file)
@@ -77,7 +77,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
       privacy: this.firstStepPrivacyId,
       waitTranscoding: false,
       commentsEnabled: true,
-      downloadingEnabled: true,
+      downloadEnabled: true,
       channelId: this.firstStepChannelId
     }
 
@@ -92,7 +92,7 @@ export class VideoImportTorrentComponent extends VideoSend implements OnInit, Ca
 
         this.video = new VideoEdit(Object.assign(res.video, {
           commentsEnabled: videoUpdate.commentsEnabled,
-          downloadingEnabled: videoUpdate.downloadingEnabled,
+          downloadEnabled: videoUpdate.downloadEnabled,
           support: null,
           thumbnailUrl: null,
           previewUrl: null
index 11db4a7ef42a73e12344c22f69cef3445c25be64..fbc85c74fef9a3fc7be80d8b1800c0c8290c6482 100644 (file)
@@ -69,7 +69,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
       privacy: this.firstStepPrivacyId,
       waitTranscoding: false,
       commentsEnabled: true,
-      downloadingEnabled: true,
+      downloadEnabled: true,
       channelId: this.firstStepChannelId
     }
 
@@ -84,7 +84,7 @@ export class VideoImportUrlComponent extends VideoSend implements OnInit, CanCom
 
         this.video = new VideoEdit(Object.assign(res.video, {
           commentsEnabled: videoUpdate.commentsEnabled,
-          downloadingEnabled: videoUpdate.downloadingEnabled,
+          downloadEnabled: videoUpdate.downloadEnabled,
           support: null,
           thumbnailUrl: null,
           previewUrl: null
index 53f72f4e6ee9038d467fa92e05dcae3d76f3089d..ac6c1786fa3036de02b272bddeec280f73b92da6 100644 (file)
@@ -159,7 +159,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
     const nsfw = false
     const waitTranscoding = true
     const commentsEnabled = true
-    const downloadingEnabled = true
+    const downloadEnabled = true
     const channelId = this.firstStepChannelId.toString()
 
     const formData = new FormData()
@@ -168,7 +168,7 @@ export class VideoUploadComponent extends VideoSend implements OnInit, OnDestroy
     formData.append('privacy', VideoPrivacy.PRIVATE.toString())
     formData.append('nsfw', '' + nsfw)
     formData.append('commentsEnabled', '' + commentsEnabled)
-    formData.append('downloadingEnabled', '' + downloadingEnabled)
+    formData.append('downloadEnabled', '' + downloadEnabled)
     formData.append('waitTranscoding', '' + waitTranscoding)
     formData.append('channelId', '' + channelId)
     formData.append('videofile', videofile)
index 7cc831ab15c7ed0802790c14bd887f61f12c66a1..a7fd456959350cca8d784c3346c492ef3c5cb3b6 100644 (file)
@@ -314,7 +314,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
   }
 
   isVideoDownloadable () {
-    return this.video && this.video.downloadingEnabled
+    return this.video && this.video.downloadEnabled
   }
 
   isVideoToImport () {
index a5cddba896b28ebe8f342c36ed9a2f04cadef71f..9e51e200042ce1f0667e62b55a31272bd7b740dd 100644 (file)
@@ -171,7 +171,7 @@ function buildVideo (channelId: number, body: VideoImportCreate, importData: You
     licence: body.licence || importData.licence,
     language: body.language || undefined,
     commentsEnabled: body.commentsEnabled || true,
-    downloadingEnabled: body.downloadingEnabled || true,
+    downloadEnabled: body.downloadEnabled || true,
     waitTranscoding: body.waitTranscoding || false,
     state: VideoState.TO_IMPORT,
     nsfw: body.nsfw || importData.nsfw || false,
index 4b6d1b8470d548f1e0477df0c3db5066e29b331a..7d55f06b67f841c9a8fd620aab5b328deaceea22 100644 (file)
@@ -179,7 +179,7 @@ async function addVideo (req: express.Request, res: express.Response) {
     licence: videoInfo.licence,
     language: videoInfo.language,
     commentsEnabled: videoInfo.commentsEnabled || false,
-    downloadingEnabled: videoInfo.downloadingEnabled || true,
+    downloadEnabled: videoInfo.downloadEnabled || true,
     waitTranscoding: videoInfo.waitTranscoding || false,
     state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED,
     nsfw: videoInfo.nsfw || false,
@@ -323,7 +323,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
       if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support)
       if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description)
       if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled)
-      if (videoInfoToUpdate.downloadingEnabled !== undefined) videoInstance.set('downloadingEnabled', videoInfoToUpdate.downloadingEnabled)
+      if (videoInfoToUpdate.downloadEnabled !== undefined) videoInstance.set('downloadEnabled', videoInfoToUpdate.downloadEnabled)
       if (videoInfoToUpdate.privacy !== undefined) {
         const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10)
         videoInstance.set('privacy', newPrivacy)
index 7f903e4866574b75e79b29c0bd470258718f398f..2469b37b1fced2b066b3a565cd367d41f1a748f3 100644 (file)
@@ -28,7 +28,7 @@ function activityPubContextify <T> (data: T) {
         size: 'schema:Number',
         fps: 'schema:Number',
         commentsEnabled: 'schema:Boolean',
-        downloadingEnabled: 'schema:Boolean',
+        downloadEnabled: 'schema:Boolean',
         waitTranscoding: 'schema:Boolean',
         expires: 'schema:expires',
         support: 'schema:Text',
index d2c9aee0188277cce5c3cb392452943f9bad9686..a121f0b8a1420d0bc783fc331918ce09b3ebd8ab 100644 (file)
@@ -118,7 +118,7 @@ const videoKeysToKeep = [
   'channel-name',
   'support',
   'commentsEnabled',
-  'downloadingEnabled'
+  'downloadEnabled'
 ]
 class VideoAuditView extends EntityAuditView {
   constructor (private video: VideoDetails) {
index 59964f91a020cfa2f664d0267932066fba9b67d9..5015c59ddf8fe31555fcd0b12c2e32f34ed19b26 100644 (file)
@@ -56,7 +56,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
   // Default attributes
   if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
   if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
-  if (!isBooleanValid(video.downloadingEnabled)) video.downloadingEnabled = true
+  if (!isBooleanValid(video.downloadEnabled)) video.downloadEnabled = true
 
   return isActivityPubUrlValid(video.id) &&
     isVideoNameValid(video.name) &&
@@ -68,7 +68,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
     isVideoViewsValid(video.views) &&
     isBooleanValid(video.sensitive) &&
     isBooleanValid(video.commentsEnabled) &&
-    isBooleanValid(video.downloadingEnabled) &&
+    isBooleanValid(video.downloadEnabled) &&
     isDateValid(video.published) &&
     isDateValid(video.updated) &&
     (!video.content || isRemoteVideoContentValid(video.mediaType, video.content)) &&
index c0700108cef08d04b235d0ac75166e19950ffa82..e79466447a940328a06d621c0b00ba19de8c4e27 100644 (file)
@@ -11,10 +11,10 @@ async function up (utils: {
     allowNull: false,
     defaultValue: true
   } as Migration.Boolean
-  await utils.queryInterface.addColumn('video', 'downloadingEnabled', data)
+  await utils.queryInterface.addColumn('video', 'downloadEnabled', data)
 
   data.defaultValue = null
-  return utils.queryInterface.changeColumn('video', 'downloadingEnabled', data)
+  return utils.queryInterface.changeColumn('video', 'downloadEnabled', data)
 }
 
 function down (options) {
index dd02141eeac07f96eb0d5526e7cfbcadb6f44ad8..8521572a1535142e0b410ace2b18f161c8c8f833 100644 (file)
@@ -230,7 +230,7 @@ async function updateVideoFromAP (options: {
       options.video.set('support', videoData.support)
       options.video.set('nsfw', videoData.nsfw)
       options.video.set('commentsEnabled', videoData.commentsEnabled)
-      options.video.set('downloadingEnabled', videoData.downloadingEnabled)
+      options.video.set('downloadEnabled', videoData.downloadEnabled)
       options.video.set('waitTranscoding', videoData.waitTranscoding)
       options.video.set('state', videoData.state)
       options.video.set('duration', videoData.duration)
@@ -442,7 +442,7 @@ async function videoActivityObjectToDBAttributes (
     support,
     nsfw: videoObject.sensitive,
     commentsEnabled: videoObject.commentsEnabled,
-    downloadingEnabled: videoObject.downloadingEnabled,
+    downloadEnabled: videoObject.downloadEnabled,
     waitTranscoding: videoObject.waitTranscoding,
     state: videoObject.state,
     channelId: videoChannel.id,
index bdba87496d79c3f42d696a3962d506c11a458400..27e8a7449c9f7db15324c09159b6dae8c7c27e33 100644 (file)
@@ -349,7 +349,7 @@ function getCommonVideoAttributes () {
       .optional()
       .toBoolean()
       .custom(isBooleanValid).withMessage('Should have comments enabled boolean'),
-    body('downloadingEnabled')
+    body('downloadEnabled')
       .optional()
       .toBoolean()
       .custom(isBooleanValid).withMessage('Should have downloading enabled boolean'),
index 0b0da41810c7b09c32588a0965bc7f063237085e..e7bff2ed79a3c992408fdc94f84965db8430b2a4 100644 (file)
@@ -128,7 +128,7 @@ function videoModelToFormattedDetailsJSON (video: VideoModel): VideoDetails {
     account: video.VideoChannel.Account.toFormattedJSON(),
     tags,
     commentsEnabled: video.commentsEnabled,
-    downloadingEnabled: video.downloadingEnabled,
+    downloadEnabled: video.downloadEnabled,
     waitTranscoding: video.waitTranscoding,
     state: {
       id: video.state,
@@ -260,7 +260,7 @@ function videoModelToActivityPubObject (video: VideoModel): VideoTorrentObject {
     waitTranscoding: video.waitTranscoding,
     state: video.state,
     commentsEnabled: video.commentsEnabled,
-    downloadingEnabled: video.downloadingEnabled,
+    downloadEnabled: video.downloadEnabled,
     published: video.publishedAt.toISOString(),
     updated: video.updatedAt.toISOString(),
     mediaType: 'text/markdown',
index a2fe53fb90bec9f78e407d192f3a468ee7eddfdf..a9baaf1dadbff1c466a938eb0a6c54742fe2e32e 100644 (file)
@@ -600,7 +600,7 @@ export class VideoModel extends Model<VideoModel> {
 
   @AllowNull(false)
   @Column
-  downloadingEnabled: boolean
+  downloadEnabled: boolean
 
   @AllowNull(false)
   @Column
index 8dd87b8aec303f723eb5f28d66e3ea769a7ea4b3..1ffb81a3869e6d28787803fc15f4a15fffa6c874 100644 (file)
@@ -84,7 +84,7 @@ describe('Test video imports API validator', function () {
         language: 'pt',
         nsfw: false,
         commentsEnabled: true,
-        downloadingEnabled: true,
+        downloadEnabled: true,
         waitTranscoding: true,
         description: 'my super description',
         support: 'my super support text',
index c5740087cb552aeb81c2d7487a838cd4f8b81f2e..bc28e24224fe65e5c753ff289c3fd96a722e9ae2 100644 (file)
@@ -175,7 +175,7 @@ describe('Test videos API validator', function () {
         language: 'pt',
         nsfw: false,
         commentsEnabled: true,
-        downloadingEnabled: true,
+        downloadEnabled: true,
         waitTranscoding: true,
         description: 'my super description',
         support: 'my super support text',
@@ -420,7 +420,7 @@ describe('Test videos API validator', function () {
       language: 'pt',
       nsfw: false,
       commentsEnabled: false,
-      downloadingEnabled: false,
+      downloadEnabled: false,
       description: 'my super description',
       privacy: VideoPrivacy.PUBLIC,
       tags: [ 'tag1', 'tag2' ]
index 5cad1d09deaed2dae8766249616ef151a39f394d..e8914a9d431307554edc164225051891f9b03a84 100644 (file)
@@ -305,7 +305,7 @@ describe('Test follows', function () {
         },
         isLocal,
         commentsEnabled: true,
-        downloadingEnabled: true,
+        downloadEnabled: true,
         duration: 5,
         tags: [ 'tag1', 'tag2', 'tag3' ],
         privacy: VideoPrivacy.PUBLIC,
index 971de4607538b566ad4a8010c02ef7bccbb55003..b0a3d029ab3075ed776679caa867cf54a6a8e2ef 100644 (file)
@@ -70,7 +70,7 @@ describe('Test handle downs', function () {
     tags: [ 'tag1p1', 'tag2p1' ],
     privacy: VideoPrivacy.PUBLIC,
     commentsEnabled: true,
-    downloadingEnabled: true,
+    downloadEnabled: true,
     channel: {
       name: 'root_channel',
       displayName: 'Main root channel',
index 83e391ccdae6403b652122ba03155965c80141bc..256be5d1c33edc1b60d403d3dc981f216b095c51 100644 (file)
@@ -127,7 +127,7 @@ describe('Test multiple servers', function () {
           tags: [ 'tag1p1', 'tag2p1' ],
           privacy: VideoPrivacy.PUBLIC,
           commentsEnabled: true,
-          downloadingEnabled: true,
+          downloadEnabled: true,
           channel: {
             displayName: 'my channel',
             name: 'super_channel_name',
@@ -199,7 +199,7 @@ describe('Test multiple servers', function () {
           },
           isLocal,
           commentsEnabled: true,
-          downloadingEnabled: true,
+          downloadEnabled: true,
           duration: 5,
           tags: [ 'tag1p2', 'tag2p2', 'tag3p2' ],
           privacy: VideoPrivacy.PUBLIC,
@@ -308,7 +308,7 @@ describe('Test multiple servers', function () {
           isLocal,
           duration: 5,
           commentsEnabled: true,
-          downloadingEnabled: true,
+          downloadEnabled: true,
           tags: [ 'tag1p3' ],
           privacy: VideoPrivacy.PUBLIC,
           channel: {
@@ -340,7 +340,7 @@ describe('Test multiple servers', function () {
             host: 'localhost:9003'
           },
           commentsEnabled: true,
-          downloadingEnabled: true,
+          downloadEnabled: true,
           isLocal,
           duration: 5,
           tags: [ 'tag2p3', 'tag3p3', 'tag4p3' ],
@@ -658,7 +658,7 @@ describe('Test multiple servers', function () {
           isLocal,
           duration: 5,
           commentsEnabled: true,
-          downloadingEnabled: true,
+          downloadEnabled: true,
           tags: [ 'tag_up_1', 'tag_up_2' ],
           privacy: VideoPrivacy.PUBLIC,
           channel: {
@@ -980,7 +980,7 @@ describe('Test multiple servers', function () {
           isLocal,
           duration: 5,
           commentsEnabled: false,
-          downloadingEnabled: false,
+          downloadEnabled: false,
           tags: [ ],
           privacy: VideoPrivacy.PUBLIC,
           channel: {
index 8995a85257d20c73c072e44a1c0f57b13633c83a..92d42eb80aef41f22b0de5f0c4d15cc94057957d 100644 (file)
@@ -55,7 +55,7 @@ describe('Test a single server', function () {
     tags: [ 'tag1', 'tag2', 'tag3' ],
     privacy: VideoPrivacy.PUBLIC,
     commentsEnabled: true,
-    downloadingEnabled: true,
+    downloadEnabled: true,
     channel: {
       displayName: 'Main root channel',
       name: 'root_channel',
@@ -88,7 +88,7 @@ describe('Test a single server', function () {
     privacy: VideoPrivacy.PUBLIC,
     duration: 5,
     commentsEnabled: false,
-    downloadingEnabled: false,
+    downloadEnabled: false,
     channel: {
       name: 'root_channel',
       displayName: 'Main root channel',
@@ -358,7 +358,7 @@ describe('Test a single server', function () {
       nsfw: false,
       description: 'my super description updated',
       commentsEnabled: false,
-      downloadingEnabled: false,
+      downloadEnabled: false,
       tags: [ 'tagup1', 'tagup2' ]
     }
     await updateVideo(server.url, server.accessToken, videoId, attributes)
index a7fd4c8a60b140a625ce52afa881aebb131281cb..bc878b039a25c22a8ec269e0b236695a838a7612 100644 (file)
@@ -27,7 +27,7 @@ type VideoAttributes = {
   language?: string
   nsfw?: boolean
   commentsEnabled?: boolean
-  downloadingEnabled?: boolean
+  downloadEnabled?: boolean
   waitTranscoding?: boolean
   description?: string
   tags?: string[]
@@ -311,7 +311,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
     tags: [ 'tag' ],
     privacy: VideoPrivacy.PUBLIC,
     commentsEnabled: true,
-    downloadingEnabled: true,
+    downloadEnabled: true,
     fixture: 'video_short.webm'
   }, videoAttributesArg)
 
@@ -322,7 +322,7 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
               .field('name', attributes.name)
               .field('nsfw', JSON.stringify(attributes.nsfw))
               .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
-              .field('downloadingEnabled', JSON.stringify(attributes.downloadingEnabled))
+              .field('downloadEnabled', JSON.stringify(attributes.downloadEnabled))
               .field('waitTranscoding', JSON.stringify(attributes.waitTranscoding))
               .field('privacy', attributes.privacy.toString())
               .field('channelId', attributes.channelId)
@@ -373,7 +373,7 @@ function updateVideo (url: string, accessToken: string, id: number | string, att
   if (attributes.language) body['language'] = attributes.language
   if (attributes.nsfw !== undefined) body['nsfw'] = JSON.stringify(attributes.nsfw)
   if (attributes.commentsEnabled !== undefined) body['commentsEnabled'] = JSON.stringify(attributes.commentsEnabled)
-  if (attributes.downloadingEnabled !== undefined) body['downloadingEnabled'] = JSON.stringify(attributes.downloadingEnabled)
+  if (attributes.downloadEnabled !== undefined) body['downloadEnabled'] = JSON.stringify(attributes.downloadEnabled)
   if (attributes.description) body['description'] = attributes.description
   if (attributes.tags) body['tags'] = attributes.tags
   if (attributes.privacy) body['privacy'] = attributes.privacy
@@ -439,7 +439,7 @@ async function completeVideoCheck (
     language: string
     nsfw: boolean
     commentsEnabled: boolean
-    downloadingEnabled: boolean
+    downloadEnabled: boolean
     description: string
     publishedAt?: string
     support: string
@@ -514,7 +514,7 @@ async function completeVideoCheck (
   expect(dateIsValid(videoDetails.channel.createdAt.toString())).to.be.true
   expect(dateIsValid(videoDetails.channel.updatedAt.toString())).to.be.true
   expect(videoDetails.commentsEnabled).to.equal(attributes.commentsEnabled)
-  expect(videoDetails.downloadingEnabled).to.equal(attributes.downloadingEnabled)
+  expect(videoDetails.downloadEnabled).to.equal(attributes.downloadEnabled)
 
   for (const attributeFile of attributes.files) {
     const file = videoDetails.files.find(f => f.resolution.id === attributeFile.resolution)
index 675c621dfdc93b834b9c19b7fbf396039ca74158..15f517cabb9ab22b850beea4edbc335438ac6383 100644 (file)
@@ -212,7 +212,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, cwd: st
     nsfw: isNSFW(videoInfo),
     waitTranscoding: true,
     commentsEnabled: true,
-    downloadingEnabled: true,
+    downloadEnabled: true,
     description: videoInfo.description || undefined,
     support: undefined,
     tags,
index e2ba4bdbc67310ce5f86b7eeea0c21f9d4015940..b17bc42882dfa4e6767d17fe1aba4f548c4a9b2a 100644 (file)
@@ -30,7 +30,7 @@ if (!program['tags']) program['tags'] = []
 if (!program['nsfw']) program['nsfw'] = false
 if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC
 if (!program['commentsEnabled']) program['commentsEnabled'] = false
-if (!program['downloadingEnabled']) program['downloadingEnabled'] = true
+if (!program['downloadEnabled']) program['downloadEnabled'] = true
 
 getSettings()
   .then(settings => {
@@ -117,7 +117,7 @@ async function run () {
     description: program['videoDescription'],
     tags: program['tags'],
     commentsEnabled: program['commentsEnabled'],
-    downloadingEnabled: program['downloadingEnabled'],
+    downloadEnabled: program['downloadEnabled'],
     fixture: program['file'],
     thumbnailfile: program['thumbnail'],
     previewfile: program['preview'],
index beb2f519ec9ce7123af553572dc9700018e85313..4231fbb682a6856d8a601ac754816dd6af1edf14 100644 (file)
@@ -21,7 +21,7 @@ export interface VideoTorrentObject {
   views: number
   sensitive: boolean
   commentsEnabled: boolean,
-  downloadingEnabled: boolean,
+  downloadEnabled: boolean,
   waitTranscoding: boolean
   state: VideoState
   published: string
index 6e5e03e0a03d4d37374f39296940cea92a5a47dd..f153a1d00bdf99eea83f910488fc30c7a04d2cb3 100644 (file)
@@ -13,7 +13,7 @@ export interface VideoCreate {
   name: string
   tags?: string[]
   commentsEnabled?: boolean
-  downloadingEnabled?: boolean
+  downloadEnabled?: boolean
   privacy: VideoPrivacy
   scheduleUpdate?: VideoScheduleUpdate
 }
index bf7a9af37a6436b489680b3b3508025416d5d398..6f96633ae480a19650dfeb9ee753c14e03baa3ee 100644 (file)
@@ -11,7 +11,7 @@ export interface VideoUpdate {
   privacy?: VideoPrivacy
   tags?: string[]
   commentsEnabled?: boolean
-  downloadingEnabled?: boolean
+  downloadEnabled?: boolean
   nsfw?: boolean
   waitTranscoding?: boolean
   channelId?: number
index 783cd86e5b41e6cd92bbe3deb056242d198896a9..4a792fcbc495f6d2867f4416ebc3fdcd7bdfaeb6 100644 (file)
@@ -82,7 +82,7 @@ export interface VideoDetails extends Video {
   files: VideoFile[]
   account: Account
   commentsEnabled: boolean
-  downloadingEnabled: boolean
+  downloadEnabled: boolean
 
   // Not optional in details (unlike in Video)
   waitTranscoding: boolean
index 9ce24c0ed7df733dd84603a43e4748c4efafe099..8ff81d3176ed53931f6b6cde5600b81b707f6d76 100644 (file)
@@ -536,7 +536,7 @@ paths:
         - $ref: "videos.yaml#/parameters/name"
         - $ref: "videos.yaml#/parameters/tags"
         - $ref: "videos.yaml#/parameters/commentsEnabled"
-        - $ref: "videos.yaml#/parameters/downloadingEnabled"
+        - $ref: "videos.yaml#/parameters/downloadEnabled"
         - $ref: "videos.yaml#/parameters/privacy"
         - $ref: "videos.yaml#/parameters/scheduleUpdate"
       responses:
@@ -633,7 +633,7 @@ paths:
         - $ref: "videos.yaml#/parameters/name"
         - $ref: "videos.yaml#/parameters/tags"
         - $ref: "videos.yaml#/parameters/commentsEnabled"
-        - $ref: "videos.yaml#/parameters/downloadingEnabled"
+        - $ref: "videos.yaml#/parameters/downloadEnabled"
         - $ref: "videos.yaml#/parameters/privacy"
         - $ref: "videos.yaml#/parameters/scheduleUpdate"
       responses:
index 93aa262854fe76166c4507cc3d249acf36d0b3d7..0c611e3a8123fa266105ebd97b2d86bae68f71cc 100644 (file)
@@ -65,8 +65,8 @@ parameters:
     in: formData
     type: boolean
     description: 'Enable or disable comments for this video'
-  downloadingEnabled:
-    name: downloadingEnabled
+  downloadEnabled:
+    name: downloadEnabled
     in: formData
     type: boolean
     description: 'Enable or disable downloading for this video'