aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/live.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers/live.ts')
-rw-r--r--server/controllers/live.ts29
1 files changed, 29 insertions, 0 deletions
diff --git a/server/controllers/live.ts b/server/controllers/live.ts
new file mode 100644
index 000000000..fa4c2cc1a
--- /dev/null
+++ b/server/controllers/live.ts
@@ -0,0 +1,29 @@
1import * as express from 'express'
2import { mapToJSON } from '@server/helpers/core-utils'
3import { LiveManager } from '@server/lib/live-manager'
4
5const liveRouter = express.Router()
6
7liveRouter.use('/segments-sha256/:videoUUID',
8 getSegmentsSha256
9)
10
11// ---------------------------------------------------------------------------
12
13export {
14 liveRouter
15}
16
17// ---------------------------------------------------------------------------
18
19function getSegmentsSha256 (req: express.Request, res: express.Response) {
20 const videoUUID = req.params.videoUUID
21
22 const result = LiveManager.Instance.getSegmentsSha256(videoUUID)
23
24 if (!result) {
25 return res.sendStatus(404)
26 }
27
28 return res.json(mapToJSON(result))
29}