From 3cf68b869decf07ff7435fe1436d4f3134df1bf4 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Dec 2021 17:17:01 +0100 Subject: Ability for admins to set default upload values --- server/controllers/api/videos/import.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 52864bdfd..3c445efce 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -216,10 +216,10 @@ async function buildVideo (channelId: number, body: VideoImportCreate, importDat name: body.name || importData.name || 'Unknown name', remote: false, category: body.category || importData.category, - licence: body.licence || importData.licence, + licence: body.licence ?? importData.licence ?? CONFIG.DEFAULTS.PUBLISH.LICENCE, language: body.language || importData.language, - commentsEnabled: body.commentsEnabled !== false, // If the value is not "false", the default is "true" - downloadEnabled: body.downloadEnabled !== false, + commentsEnabled: body.commentsEnabled ?? CONFIG.DEFAULTS.PUBLISH.COMMENTS_ENABLED, + downloadEnabled: body.downloadEnabled ?? CONFIG.DEFAULTS.PUBLISH.DOWNLOAD_ENABLED, waitTranscoding: body.waitTranscoding || false, state: VideoState.TO_IMPORT, nsfw: body.nsfw || importData.nsfw || false, -- cgit v1.2.3