X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fvideo.ts;h=e5af028ea93fff653f2fc26a65fba017f1667fc2;hb=3cf68b869decf07ff7435fe1436d4f3134df1bf4;hp=1cfe4f27cd318df81c330fea0ea1d74978bc260b;hpb=ad5db1044c8599eaaaa2a578b350777ae996b068;p=github%2FChocobozzz%2FPeerTube.git 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 import { ThumbnailType, VideoCreate, VideoPrivacy, VideoTranscodingPayload } from '@shared/models' import { CreateJobOptions, JobQueue } from './job-queue/job-queue' import { updateVideoMiniatureFromExisting } from './thumbnail' +import { CONFIG } from '@server/initializers/config' function buildLocalVideoFromReq (videoInfo: VideoCreate, channelId: number): FilteredModelAttributes { return { name: videoInfo.name, remote: false, category: videoInfo.category, - licence: videoInfo.licence, + licence: videoInfo.licence ?? CONFIG.DEFAULTS.PUBLISH.LICENCE, language: videoInfo.language, - commentsEnabled: videoInfo.commentsEnabled !== false, // If the value is not "false", the default is "true" - downloadEnabled: videoInfo.downloadEnabled !== false, + commentsEnabled: videoInfo.commentsEnabled ?? CONFIG.DEFAULTS.PUBLISH.COMMENTS_ENABLED, + downloadEnabled: videoInfo.downloadEnabled ?? CONFIG.DEFAULTS.PUBLISH.DOWNLOAD_ENABLED, waitTranscoding: videoInfo.waitTranscoding || false, nsfw: videoInfo.nsfw || false, description: videoInfo.description,