Fix some defaults values + indentation
authorLucas Declercq <lucas.declercq@ineat-conseil.fr>
Mon, 8 Oct 2018 12:42:55 +0000 (14:42 +0200)
committerLucas Declercq <lucas.declercq@ineat-conseil.fr>
Mon, 8 Oct 2018 12:42:55 +0000 (14:42 +0200)
client/src/app/videos/+video-edit/shared/video-edit.component.html
server/controllers/api/videos/index.ts
server/helpers/custom-validators/activitypub/videos.ts
server/tools/peertube-upload.ts

index 46eb019b12a4e88295cd3e97cc978ce2d704f894..70d53505518a4676e77f3d6dc208782b88f9699e 100644 (file)
             ></my-peertube-checkbox>
 
             <my-peertube-checkbox
-                    inputName="downloadingEnabled" formControlName="downloadingEnabled"
-                    i18n-labelText labelText="Disable downloading"
+              inputName="downloadingEnabled" formControlName="downloadingEnabled"
+              i18n-labelText labelText="Disable downloading"
             ></my-peertube-checkbox>
 
             <my-peertube-checkbox
index ec25006e86b8409a2d11e9c3fb4b5650573196ed..4b6d1b8470d548f1e0477df0c3db5066e29b331a 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 || false,
+    downloadingEnabled: videoInfo.downloadingEnabled || true,
     waitTranscoding: videoInfo.waitTranscoding || false,
     state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED,
     nsfw: videoInfo.nsfw || false,
index 34e4cdff9e0e1691d1c3859a4bfaebeebd06ed06..59964f91a020cfa2f664d0267932066fba9b67d9 100644 (file)
@@ -56,6 +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
 
   return isActivityPubUrlValid(video.id) &&
     isVideoNameValid(video.name) &&
index e7b885a3887c150de1de9cc9e0255ecd0ba6d779..e2ba4bdbc67310ce5f86b7eeea0c21f9d4015940 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'] = false
+if (!program['downloadingEnabled']) program['downloadingEnabled'] = true
 
 getSettings()
   .then(settings => {