aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
authorclementbrizard <clementbrizard53@gmail.com>2019-01-12 13:45:23 +0000
committerclementbrizard <clementbrizard53@gmail.com>2019-01-12 13:45:23 +0000
commit1e74f19a2179df7fc2e0da73163ef2c3118cbecb (patch)
treed00a7b500e5ffe4973f4ce4a52b85da28733ae28 /server/controllers/api/videos/index.ts
parentc80341655fce5e70ad6da7d812e2ddeb1f8ef7f2 (diff)
downloadPeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.tar.gz
PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.tar.zst
PeerTube-1e74f19a2179df7fc2e0da73163ef2c3118cbecb.zip
Enable video upload and edit
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 33521a8c1..b26dcabe1 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -188,7 +188,8 @@ async function addVideo (req: express.Request, res: express.Response) {
188 support: videoInfo.support, 188 support: videoInfo.support,
189 privacy: videoInfo.privacy, 189 privacy: videoInfo.privacy,
190 duration: videoPhysicalFile['duration'], // duration was added by a previous middleware 190 duration: videoPhysicalFile['duration'], // duration was added by a previous middleware
191 channelId: res.locals.videoChannel.id 191 channelId: res.locals.videoChannel.id,
192 originallyPublishedAt: videoInfo.originallyPublishedAt
192 } 193 }
193 const video = new VideoModel(videoData) 194 const video = new VideoModel(videoData)
194 video.url = getVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object 195 video.url = getVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object
@@ -325,6 +326,11 @@ async function updateVideo (req: express.Request, res: express.Response) {
325 if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support) 326 if (videoInfoToUpdate.support !== undefined) videoInstance.set('support', videoInfoToUpdate.support)
326 if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description) 327 if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description)
327 if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled) 328 if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled)
329 if (videoInfoToUpdate.originallyPublishedAt !== undefined &&
330 videoInfoToUpdate.originallyPublishedAt !== null) {
331 videoInstance.set('originallyPublishedAt', videoInfoToUpdate.originallyPublishedAt)
332 }
333
328 if (videoInfoToUpdate.privacy !== undefined) { 334 if (videoInfoToUpdate.privacy !== undefined) {
329 const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) 335 const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10)
330 videoInstance.set('privacy', newPrivacy) 336 videoInstance.set('privacy', newPrivacy)