aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/video.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-14 17:17:01 +0100
committerChocobozzz <me@florianbigard.com>2021-12-14 17:17:01 +0100
commit3cf68b869decf07ff7435fe1436d4f3134df1bf4 (patch)
tree836efe5ddc626fef3ba4c96269efbca305f46256 /server/lib/video.ts
parenta6f919e455f2c6ae8f2194da4aa66824a6bfd09e (diff)
downloadPeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.gz
PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.tar.zst
PeerTube-3cf68b869decf07ff7435fe1436d4f3134df1bf4.zip
Ability for admins to set default upload values
Diffstat (limited to 'server/lib/video.ts')
-rw-r--r--server/lib/video.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/lib/video.ts b/server/lib/video.ts
index 1cfe4f27c..e5af028ea 100644
--- a/server/lib/video.ts
+++ b/server/lib/video.ts
@@ -9,16 +9,17 @@ import { MThumbnail, MUserId, MVideoFile, MVideoTag, MVideoThumbnail, MVideoUUID
9import { ThumbnailType, VideoCreate, VideoPrivacy, VideoTranscodingPayload } from '@shared/models' 9import { ThumbnailType, VideoCreate, VideoPrivacy, VideoTranscodingPayload } from '@shared/models'
10import { CreateJobOptions, JobQueue } from './job-queue/job-queue' 10import { CreateJobOptions, JobQueue } from './job-queue/job-queue'
11import { updateVideoMiniatureFromExisting } from './thumbnail' 11import { updateVideoMiniatureFromExisting } from './thumbnail'
12import { CONFIG } from '@server/initializers/config'
12 13
13function buildLocalVideoFromReq (videoInfo: VideoCreate, channelId: number): FilteredModelAttributes<VideoModel> { 14function buildLocalVideoFromReq (videoInfo: VideoCreate, channelId: number): FilteredModelAttributes<VideoModel> {
14 return { 15 return {
15 name: videoInfo.name, 16 name: videoInfo.name,
16 remote: false, 17 remote: false,
17 category: videoInfo.category, 18 category: videoInfo.category,
18 licence: videoInfo.licence, 19 licence: videoInfo.licence ?? CONFIG.DEFAULTS.PUBLISH.LICENCE,
19 language: videoInfo.language, 20 language: videoInfo.language,
20 commentsEnabled: videoInfo.commentsEnabled !== false, // If the value is not "false", the default is "true" 21 commentsEnabled: videoInfo.commentsEnabled ?? CONFIG.DEFAULTS.PUBLISH.COMMENTS_ENABLED,
21 downloadEnabled: videoInfo.downloadEnabled !== false, 22 downloadEnabled: videoInfo.downloadEnabled ?? CONFIG.DEFAULTS.PUBLISH.DOWNLOAD_ENABLED,
22 waitTranscoding: videoInfo.waitTranscoding || false, 23 waitTranscoding: videoInfo.waitTranscoding || false,
23 nsfw: videoInfo.nsfw || false, 24 nsfw: videoInfo.nsfw || false,
24 description: videoInfo.description, 25 description: videoInfo.description,