diff options
author | Lucas Declercq <lucas.declercq@ineat-conseil.fr> | 2018-10-08 14:42:55 +0200 |
---|---|---|
committer | Lucas Declercq <lucas.declercq@ineat-conseil.fr> | 2018-10-08 14:42:55 +0200 |
commit | 4ffdcfc63b8c804a0aea20609544c859ab57318b (patch) | |
tree | 079c10d28490fd1861c3643ae67c19570f483761 /server | |
parent | e0d827e29afc1b29eaf550deb0627c13088c0c65 (diff) | |
download | PeerTube-4ffdcfc63b8c804a0aea20609544c859ab57318b.tar.gz PeerTube-4ffdcfc63b8c804a0aea20609544c859ab57318b.tar.zst PeerTube-4ffdcfc63b8c804a0aea20609544c859ab57318b.zip |
Fix some defaults values + indentation
Diffstat (limited to 'server')
-rw-r--r-- | server/controllers/api/videos/index.ts | 2 | ||||
-rw-r--r-- | server/helpers/custom-validators/activitypub/videos.ts | 1 | ||||
-rw-r--r-- | server/tools/peertube-upload.ts | 2 |
3 files changed, 3 insertions, 2 deletions
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'] = [] | |||
30 | if (!program['nsfw']) program['nsfw'] = false | 30 | if (!program['nsfw']) program['nsfw'] = false |
31 | if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC | 31 | if (!program['privacy']) program['privacy'] = VideoPrivacy.PUBLIC |
32 | if (!program['commentsEnabled']) program['commentsEnabled'] = false | 32 | if (!program['commentsEnabled']) program['commentsEnabled'] = false |
33 | if (!program['downloadingEnabled']) program['downloadingEnabled'] = false | 33 | if (!program['downloadingEnabled']) program['downloadingEnabled'] = true |
34 | 34 | ||
35 | getSettings() | 35 | getSettings() |
36 | .then(settings => { | 36 | .then(settings => { |