aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api
diff options
context:
space:
mode:
authorLucas Declercq <lucas.declercq@ineat-conseil.fr>2018-10-06 19:17:21 +0200
committerLucas Declercq <lucas.declercq@ineat-conseil.fr>2018-10-06 19:17:39 +0200
commit156c50af3085468a47b8ae73fe8cfcae46b42398 (patch)
treef316355ebea2550c201a880cfc9f9b724bf0f7fd /server/controllers/api
parent35d50b7dd26b3cf646b8845784927bb1ef18dfb3 (diff)
downloadPeerTube-156c50af3085468a47b8ae73fe8cfcae46b42398.tar.gz
PeerTube-156c50af3085468a47b8ae73fe8cfcae46b42398.tar.zst
PeerTube-156c50af3085468a47b8ae73fe8cfcae46b42398.zip
Add downloadingEnabled property to video model
Diffstat (limited to 'server/controllers/api')
-rw-r--r--server/controllers/api/videos/import.ts1
-rw-r--r--server/controllers/api/videos/index.ts2
2 files changed, 3 insertions, 0 deletions
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
171 licence: body.licence || importData.licence, 171 licence: body.licence || importData.licence,
172 language: body.language || undefined, 172 language: body.language || undefined,
173 commentsEnabled: body.commentsEnabled || true, 173 commentsEnabled: body.commentsEnabled || true,
174 downloadingEnabled: body.downloadingEnabled || true,
174 waitTranscoding: body.waitTranscoding || false, 175 waitTranscoding: body.waitTranscoding || false,
175 state: VideoState.TO_IMPORT, 176 state: VideoState.TO_IMPORT,
176 nsfw: body.nsfw || importData.nsfw || false, 177 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) {
179 licence: videoInfo.licence, 179 licence: videoInfo.licence,
180 language: videoInfo.language, 180 language: videoInfo.language,
181 commentsEnabled: videoInfo.commentsEnabled || false, 181 commentsEnabled: videoInfo.commentsEnabled || false,
182 downloadingEnabled: videoInfo.downloadingEnabled || false,
182 waitTranscoding: videoInfo.waitTranscoding || false, 183 waitTranscoding: videoInfo.waitTranscoding || false,
183 state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED, 184 state: CONFIG.TRANSCODING.ENABLED ? VideoState.TO_TRANSCODE : VideoState.PUBLISHED,
184 nsfw: videoInfo.nsfw || false, 185 nsfw: videoInfo.nsfw || false,
@@ -322,6 +323,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
322 if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support) 323 if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support)
323 if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description) 324 if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description)
324 if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled) 325 if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled)
326 if (videoInfoToUpdate.downloadingEnabled !== undefined) videoInstance.set('downloadingEnabled', videoInfoToUpdate.downloadingEnabled)
325 if (videoInfoToUpdate.privacy !== undefined) { 327 if (videoInfoToUpdate.privacy !== undefined) {
326 const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) 328 const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10)
327 videoInstance.set('privacy', newPrivacy) 329 videoInstance.set('privacy', newPrivacy)