aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r--server/controllers/api/videos/index.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index ebc07e179..a5414cc50 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -12,10 +12,10 @@ import {
12 resetSequelizeInstance, 12 resetSequelizeInstance,
13 retryTransactionWrapper 13 retryTransactionWrapper
14} from '../../../helpers' 14} from '../../../helpers'
15import { getActivityPubUrl } from '../../../helpers/activitypub' 15import { getActivityPubUrl, shareVideoByServer } from '../../../helpers/activitypub'
16import { CONFIG, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_MIMETYPE_EXT, VIDEO_PRIVACIES } from '../../../initializers' 16import { CONFIG, VIDEO_CATEGORIES, VIDEO_LANGUAGES, VIDEO_LICENCES, VIDEO_MIMETYPE_EXT, VIDEO_PRIVACIES } from '../../../initializers'
17import { database as db } from '../../../initializers/database' 17import { database as db } from '../../../initializers/database'
18import { sendAddVideo, sendUpdateVideoChannel } from '../../../lib/activitypub/send-request' 18import { sendAddVideo, sendUpdateVideo } from '../../../lib/activitypub/send-request'
19import { transcodingJobScheduler } from '../../../lib/jobs/transcoding-job-scheduler/transcoding-job-scheduler' 19import { transcodingJobScheduler } from '../../../lib/jobs/transcoding-job-scheduler/transcoding-job-scheduler'
20import { 20import {
21 asyncMiddleware, 21 asyncMiddleware,
@@ -56,7 +56,7 @@ const storage = multer.diskStorage({
56 randomString = 'fake-random-string' 56 randomString = 'fake-random-string'
57 } 57 }
58 58
59 cb(null, randomString + '.' + extension) 59 cb(null, randomString + extension)
60 } 60 }
61}) 61})
62 62
@@ -237,6 +237,7 @@ async function addVideo (req: express.Request, res: express.Response, videoPhysi
237 if (video.privacy === VideoPrivacy.PRIVATE) return undefined 237 if (video.privacy === VideoPrivacy.PRIVATE) return undefined
238 238
239 await sendAddVideo(video, t) 239 await sendAddVideo(video, t)
240 await shareVideoByServer(video, t)
240 }) 241 })
241 242
242 logger.info('Video with name %s and uuid %s created.', videoInfo.name, videoUUID) 243 logger.info('Video with name %s and uuid %s created.', videoInfo.name, videoUUID)
@@ -254,7 +255,7 @@ async function updateVideoRetryWrapper (req: express.Request, res: express.Respo
254} 255}
255 256
256async function updateVideo (req: express.Request, res: express.Response) { 257async function updateVideo (req: express.Request, res: express.Response) {
257 const videoInstance = res.locals.video 258 const videoInstance: VideoInstance = res.locals.video
258 const videoFieldsSave = videoInstance.toJSON() 259 const videoFieldsSave = videoInstance.toJSON()
259 const videoInfoToUpdate: VideoUpdate = req.body 260 const videoInfoToUpdate: VideoUpdate = req.body
260 const wasPrivateVideo = videoInstance.privacy === VideoPrivacy.PRIVATE 261 const wasPrivateVideo = videoInstance.privacy === VideoPrivacy.PRIVATE
@@ -284,7 +285,7 @@ async function updateVideo (req: express.Request, res: express.Response) {
284 285
285 // Now we'll update the video's meta data to our friends 286 // Now we'll update the video's meta data to our friends
286 if (wasPrivateVideo === false) { 287 if (wasPrivateVideo === false) {
287 await sendUpdateVideoChannel(videoInstance, t) 288 await sendUpdateVideo(videoInstance, t)
288 } 289 }
289 290
290 // Video is not private anymore, send a create action to remote servers 291 // Video is not private anymore, send a create action to remote servers