diff options
author | Chocobozzz <me@florianbigard.com> | 2021-11-18 14:35:08 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-11-18 15:20:57 +0100 |
commit | ad5db1044c8599eaaaa2a578b350777ae996b068 (patch) | |
tree | 3e003cccf021152405d49b21c6c91b703c8ae96c /server/controllers/api/videos/files.ts | |
parent | b46cf4b920984492df598c1b61179acfc7f6f22e (diff) | |
download | PeerTube-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.ts | 5 |
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' | |||
3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' | 3 | import { logger, loggerTagsFactory } from '@server/helpers/logger' |
4 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' | 4 | import { federateVideoIfNeeded } from '@server/lib/activitypub/videos' |
5 | import { VideoFileModel } from '@server/models/video/video-file' | 5 | import { VideoFileModel } from '@server/models/video/video-file' |
6 | import { HttpStatusCode } from '@shared/models' | 6 | import { HttpStatusCode, UserRight } from '@shared/models' |
7 | import { | 7 | import { |
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 | ||
23 | filesRouter.delete('/:id/hls', | 24 | filesRouter.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 | ||
29 | filesRouter.delete('/:id/webtorrent', | 31 | filesRouter.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 | ) |