aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/videos/files.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-11-18 14:35:08 +0100
committerChocobozzz <me@florianbigard.com>2021-11-18 15:20:57 +0100
commitad5db1044c8599eaaaa2a578b350777ae996b068 (patch)
tree3e003cccf021152405d49b21c6c91b703c8ae96c /server/controllers/api/videos/files.ts
parentb46cf4b920984492df598c1b61179acfc7f6f22e (diff)
downloadPeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.gz
PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.tar.zst
PeerTube-ad5db1044c8599eaaaa2a578b350777ae996b068.zip
Add ability to run transcoding jobs
Diffstat (limited to 'server/controllers/api/videos/files.ts')
-rw-r--r--server/controllers/api/videos/files.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/api/videos/files.ts b/server/controllers/api/videos/files.ts
index 2fe4b5a3f..a8b32411d 100644
--- a/server/controllers/api/videos/files.ts
+++ b/server/controllers/api/videos/files.ts
@@ -3,10 +3,11 @@ import toInt from 'validator/lib/toInt'
3import { logger, loggerTagsFactory } from '@server/helpers/logger' 3import { logger, loggerTagsFactory } from '@server/helpers/logger'
4import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' 4import { federateVideoIfNeeded } from '@server/lib/activitypub/videos'
5import { VideoFileModel } from '@server/models/video/video-file' 5import { VideoFileModel } from '@server/models/video/video-file'
6import { HttpStatusCode } from '@shared/models' 6import { HttpStatusCode, UserRight } from '@shared/models'
7import { 7import {
8 asyncMiddleware, 8 asyncMiddleware,
9 authenticate, 9 authenticate,
10 ensureUserHasRight,
10 videoFileMetadataGetValidator, 11 videoFileMetadataGetValidator,
11 videoFilesDeleteHLSValidator, 12 videoFilesDeleteHLSValidator,
12 videoFilesDeleteWebTorrentValidator 13 videoFilesDeleteWebTorrentValidator
@@ -22,12 +23,14 @@ filesRouter.get('/:id/metadata/:videoFileId',
22 23
23filesRouter.delete('/:id/hls', 24filesRouter.delete('/:id/hls',
24 authenticate, 25 authenticate,
26 ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
25 asyncMiddleware(videoFilesDeleteHLSValidator), 27 asyncMiddleware(videoFilesDeleteHLSValidator),
26 asyncMiddleware(removeHLSPlaylist) 28 asyncMiddleware(removeHLSPlaylist)
27) 29)
28 30
29filesRouter.delete('/:id/webtorrent', 31filesRouter.delete('/:id/webtorrent',
30 authenticate, 32 authenticate,
33 ensureUserHasRight(UserRight.MANAGE_VIDEO_FILES),
31 asyncMiddleware(videoFilesDeleteWebTorrentValidator), 34 asyncMiddleware(videoFilesDeleteWebTorrentValidator),
32 asyncMiddleware(removeWebTorrentFiles) 35 asyncMiddleware(removeWebTorrentFiles)
33) 36)