diff options
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/api/videos/index.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index 76a318d13..6ac13e6a4 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -190,7 +190,8 @@ async function addVideo (req: express.Request, res: express.Response) { | |||
190 | support: videoInfo.support, | 190 | support: videoInfo.support, |
191 | privacy: videoInfo.privacy, | 191 | privacy: videoInfo.privacy, |
192 | duration: videoPhysicalFile['duration'], // duration was added by a previous middleware | 192 | duration: videoPhysicalFile['duration'], // duration was added by a previous middleware |
193 | channelId: res.locals.videoChannel.id | 193 | channelId: res.locals.videoChannel.id, |
194 | originallyPublishedAt: videoInfo.originallyPublishedAt | ||
194 | } | 195 | } |
195 | const video = new VideoModel(videoData) | 196 | const video = new VideoModel(videoData) |
196 | video.url = getVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object | 197 | video.url = getVideoActivityPubUrl(video) // We use the UUID, so set the URL after building the object |
@@ -328,6 +329,11 @@ async function updateVideo (req: express.Request, res: express.Response) { | |||
328 | if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description) | 329 | if (videoInfoToUpdate.description !== undefined) videoInstance.set('description', videoInfoToUpdate.description) |
329 | if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled) | 330 | if (videoInfoToUpdate.commentsEnabled !== undefined) videoInstance.set('commentsEnabled', videoInfoToUpdate.commentsEnabled) |
330 | if (videoInfoToUpdate.downloadEnabled !== undefined) videoInstance.set('downloadEnabled', videoInfoToUpdate.downloadEnabled) | 331 | if (videoInfoToUpdate.downloadEnabled !== undefined) videoInstance.set('downloadEnabled', videoInfoToUpdate.downloadEnabled) |
332 | |||
333 | if (videoInfoToUpdate.originallyPublishedAt !== undefined && videoInfoToUpdate.originallyPublishedAt !== null) { | ||
334 | videoInstance.set('originallyPublishedAt', videoInfoToUpdate.originallyPublishedAt) | ||
335 | } | ||
336 | |||
331 | if (videoInfoToUpdate.privacy !== undefined) { | 337 | if (videoInfoToUpdate.privacy !== undefined) { |
332 | const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) | 338 | const newPrivacy = parseInt(videoInfoToUpdate.privacy.toString(), 10) |
333 | videoInstance.set('privacy', newPrivacy) | 339 | videoInstance.set('privacy', newPrivacy) |