aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucas Declercq <lucas.declercq@ineat-conseil.fr>2018-10-08 14:42:55 +0200
committerLucas Declercq <lucas.declercq@ineat-conseil.fr>2018-10-08 14:42:55 +0200
commit4ffdcfc63b8c804a0aea20609544c859ab57318b (patch)
tree079c10d28490fd1861c3643ae67c19570f483761
parente0d827e29afc1b29eaf550deb0627c13088c0c65 (diff)
downloadPeerTube-4ffdcfc63b8c804a0aea20609544c859ab57318b.tar.gz
PeerTube-4ffdcfc63b8c804a0aea20609544c859ab57318b.tar.zst
PeerTube-4ffdcfc63b8c804a0aea20609544c859ab57318b.zip
Fix some defaults values + indentation
-rw-r--r--client/src/app/videos/+video-edit/shared/video-edit.component.html4
-rw-r--r--server/controllers/api/videos/index.ts2
-rw-r--r--server/helpers/custom-validators/activitypub/videos.ts1
-rw-r--r--server/tools/peertube-upload.ts2
4 files changed, 5 insertions, 4 deletions
diff --git a/client/src/app/videos/+video-edit/shared/video-edit.component.html b/client/src/app/videos/+video-edit/shared/video-edit.component.html
index 46eb019b1..70d535055 100644
--- a/client/src/app/videos/+video-edit/shared/video-edit.component.html
+++ b/client/src/app/videos/+video-edit/shared/video-edit.component.html
@@ -126,8 +126,8 @@
126 ></my-peertube-checkbox> 126 ></my-peertube-checkbox>
127 127
128 <my-peertube-checkbox 128 <my-peertube-checkbox
129 inputName="downloadingEnabled" formControlName="downloadingEnabled" 129 inputName="downloadingEnabled" formControlName="downloadingEnabled"
130 i18n-labelText labelText="Disable downloading" 130 i18n-labelText labelText="Disable downloading"
131 ></my-peertube-checkbox> 131 ></my-peertube-checkbox>
132 132
133 <my-peertube-checkbox 133 <my-peertube-checkbox
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index ec25006e8..4b6d1b847 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -179,7 +179,7 @@ async function addVideo (req: express.Request, res: express.Response) {
179 licence: videoInfo.licence, 179 licence: videoInfo.licence,
180 language: videoInfo.language, 180 language: videoInfo.language,
181 commentsEnabled: videoInfo.commentsEnabled || false, 181 commentsEnabled: videoInfo.commentsEnabled || false,
182 downloadingEnabled: videoInfo.downloadingEnabled || false, 182 downloadingEnabled: videoInfo.downloadingEnabled || true,
183 waitTranscoding: videoInfo.waitTranscoding || false, 183 waitTranscoding: videoInfo.waitTranscoding || false,
184 state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED, 184 state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED,
185 nsfw: videoInfo.nsfw || false, 185 nsfw: videoInfo.nsfw || false,
diff --git a/server/helpers/custom-validators/activitypub/videos.ts b/server/helpers/custom-validators/activitypub/videos.ts
index 34e4cdff9..59964f91a 100644
--- a/server/helpers/custom-validators/activitypub/videos.ts
+++ b/server/helpers/custom-validators/activitypub/videos.ts
@@ -56,6 +56,7 @@ function sanitizeAndCheckVideoTorrentObject (video: any) {
56 // Default attributes 56 // Default attributes
57 if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED 57 if (!isVideoStateValid(video.state)) video.state = VideoState.PUBLISHED
58 if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false 58 if (!isBooleanValid(video.waitTranscoding)) video.waitTranscoding = false
59 if (!isBooleanValid(video.downloadingEnabled)) video.downloadingEnabled = true
59 60
60 return isActivityPubUrlValid(video.id) && 61 return isActivityPubUrlValid(video.id) &&
61 isVideoNameValid(video.name) && 62 isVideoNameValid(video.name) &&
diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts
index e7b885a38..e2ba4bdbc 100644
--- a/server/tools/peertube-upload.ts
+++ b/server/tools/peertube-upload.ts
@@ -30,7 +30,7 @@ if (!program['tags']) program['tags'] = []
30if (!program['nsfw']) program['nsfw'] = false 30if (!program['nsfw']) program['nsfw'] = false
31if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC 31if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC
32if (!program['commentsEnabled']) program['commentsEnabled'] = false 32if (!program['commentsEnabled']) program['commentsEnabled'] = false
33if (!program['downloadingEnabled']) program['downloadingEnabled'] = false 33if (!program['downloadingEnabled']) program['downloadingEnabled'] = true
34 34
35getSettings() 35getSettings()
36 .then(settings => { 36 .then(settings => {