From 156c50af3085468a47b8ae73fe8cfcae46b42398 Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Sat, 6 Oct 2018 19:17:21 +0200 Subject: Add downloadingEnabled property to video model --- server/controllers/api/videos/import.ts | 1 + server/controllers/api/videos/index.ts | 2 ++ 2 files changed, 3 insertions(+) (limited to 'server/controllers') diff --git a/server/controllers/api/videos/import.ts b/server/controllers/api/videos/import.ts index 398fd5a7f..a5cddba89 100644 --- a/server/controllers/api/videos/import.ts +++ b/server/controllers/api/videos/import.ts @@ -171,6 +171,7 @@ function buildVideo (channelId: number, body: VideoImportCreate, importData: You licence: body.licence || importData.licence, language: body.language || undefined, commentsEnabled: body.commentsEnabled || true, + downloadingEnabled: body.downloadingEnabled || true, waitTranscoding: body.waitTranscoding || false, state: VideoState.TO_IMPORT, nsfw: body.nsfw || importData.nsfw || false, diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 6a73e13d0..ec25006e8 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts @@ -179,6 +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, waitTranscoding: videoInfo.waitTranscoding || false, state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED, nsfw: videoInfo.nsfw || false, @@ -322,6 +323,7 @@ async function updateVideo (req: express.Request, res: express.Response) { if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support) if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description) if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled) + if (videoInfoToUpdate.downloadingEnabled !== undefined) videoInstance.set('downloadingEnabled', videoInfoToUpdate.downloadingEnabled) if (videoInfoToUpdate.privacy !== undefined) { const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) videoInstance.set('privacy', newPrivacy) -- cgit v1.2.3