aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/index.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r--server/controllers/api/videos/index.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts
index 89fd0432f..b659f53ed 100644
--- a/server/controllers/api/videos/index.ts
+++ b/server/controllers/api/videos/index.ts
@@ -387,6 +387,11 @@ async function updateVideo (req: express.Request, res: express.Response) {
387function getVideo (req: express.Request, res: express.Response) { 387function getVideo (req: express.Request, res: express.Response) {
388 const videoInstance = res.locals.video 388 const videoInstance = res.locals.video
389 389
390 if (videoInstance.isOutdated()) {
391 JobQueue.Instance.createJob({ type: 'activitypub-refresher', payload: { type: 'video', videoUrl: videoInstance.url } })
392 .catch(err => logger.error('Cannot create AP refresher job for video %s.', videoInstance.url, { err }))
393 }
394
390 return res.json(videoInstance.toFormattedDetailsJSON()) 395 return res.json(videoInstance.toFormattedDetailsJSON())
391} 396}
392 397
@@ -429,7 +434,7 @@ async function getVideoDescription (req: express.Request, res: express.Response)
429 return res.json({ description }) 434 return res.json({ description })
430} 435}
431 436
432async function listVideos (req: express.Request, res: express.Response, next: express.NextFunction) { 437async function listVideos (req: express.Request, res: express.Response) {
433 const resultList = await VideoModel.listForApi({ 438 const resultList = await VideoModel.listForApi({
434 start: req.query.start, 439 start: req.query.start,
435 count: req.query.count, 440 count: req.query.count,