diff options
Diffstat (limited to 'server/controllers/api/videos/index.ts')
-rw-r--r-- | server/controllers/api/videos/index.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/controllers/api/videos/index.ts b/server/controllers/api/videos/index.ts index be233722c..d4e08293e 100644 --- a/server/controllers/api/videos/index.ts +++ b/server/controllers/api/videos/index.ts | |||
@@ -26,6 +26,7 @@ import { | |||
26 | setDefaultVideosSort, | 26 | setDefaultVideosSort, |
27 | videosCustomGetValidator, | 27 | videosCustomGetValidator, |
28 | videosGetValidator, | 28 | videosGetValidator, |
29 | videoSourceGetValidator, | ||
29 | videosRemoveValidator, | 30 | videosRemoveValidator, |
30 | videosSortValidator | 31 | videosSortValidator |
31 | } from '../../../middlewares' | 32 | } from '../../../middlewares' |
@@ -96,6 +97,14 @@ videosRouter.get('/:id/description', | |||
96 | asyncMiddleware(videosGetValidator), | 97 | asyncMiddleware(videosGetValidator), |
97 | asyncMiddleware(getVideoDescription) | 98 | asyncMiddleware(getVideoDescription) |
98 | ) | 99 | ) |
100 | |||
101 | videosRouter.get('/:id/source', | ||
102 | openapiOperationDoc({ operationId: 'getVideoSource' }), | ||
103 | authenticate, | ||
104 | asyncMiddleware(videoSourceGetValidator), | ||
105 | getVideoSource | ||
106 | ) | ||
107 | |||
99 | videosRouter.get('/:id', | 108 | videosRouter.get('/:id', |
100 | openapiOperationDoc({ operationId: 'getVideo' }), | 109 | openapiOperationDoc({ operationId: 'getVideo' }), |
101 | optionalAuthenticate, | 110 | optionalAuthenticate, |
@@ -155,6 +164,10 @@ async function getVideoDescription (req: express.Request, res: express.Response) | |||
155 | return res.json({ description }) | 164 | return res.json({ description }) |
156 | } | 165 | } |
157 | 166 | ||
167 | function getVideoSource (req: express.Request, res: express.Response) { | ||
168 | return res.json(res.locals.videoSource.toFormattedJSON()) | ||
169 | } | ||
170 | |||
158 | async function listVideos (req: express.Request, res: express.Response) { | 171 | async function listVideos (req: express.Request, res: express.Response) { |
159 | const serverActor = await getServerActor() | 172 | const serverActor = await getServerActor() |
160 | 173 | ||