aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-11-20 10:05:51 +0100
committerChocobozzz <me@florianbigard.com>2018-11-20 10:44:48 +0100
commit04b8c3fba614efc3827f583096c78b08cb668470 (patch)
tree63172b40e4b029e4a14553c2fb39bd249d6cd0dd /server/controllers/api/videos
parentf107470e50236e2a073f3f7dbab87c79e8364b56 (diff)
downloadPeerTube-04b8c3fba614efc3827f583096c78b08cb668470.tar.gz
PeerTube-04b8c3fba614efc3827f583096c78b08cb668470.tar.zst
PeerTube-04b8c3fba614efc3827f583096c78b08cb668470.zip
Delete invalid or deleted remote videos
Diffstat (limited to 'server/controllers/api/videos')
-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,