From 4ffdcfc63b8c804a0aea20609544c859ab57318b Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Mon, 8 Oct 2018 14:42:55 +0200 Subject: Fix some defaults values + indentation --- server/controllers/api/videos/index.ts | 2 +- server/helpers/custom-validators/activitypub/videos.ts | 1 + server/tools/peertube-upload.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'server') 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) { 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, 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) { // 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) && 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'] = [] 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 => { -- cgit v1.2.3