aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/videos/stats.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/server/controllers/api/videos/stats.ts b/server/controllers/api/videos/stats.ts
index 71452d9f0..30e2bb06c 100644
--- a/server/controllers/api/videos/stats.ts
+++ b/server/controllers/api/videos/stats.ts
@@ -1,6 +1,6 @@
1import express from 'express' 1import express from 'express'
2import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer' 2import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer'
3import { VideoStatsTimeserieMetric, VideoStatsTimeserieQuery } from '@shared/models' 3import { VideoStatsOverallQuery, VideoStatsTimeserieMetric, VideoStatsTimeserieQuery } from '@shared/models'
4import { 4import {
5 asyncMiddleware, 5 asyncMiddleware,
6 authenticate, 6 authenticate,
@@ -39,8 +39,13 @@ export {
39 39
40async function getOverallStats (req: express.Request, res: express.Response) { 40async function getOverallStats (req: express.Request, res: express.Response) {
41 const video = res.locals.videoAll 41 const video = res.locals.videoAll
42 const query = req.query as VideoStatsOverallQuery
42 43
43 const stats = await LocalVideoViewerModel.getOverallStats(video) 44 const stats = await LocalVideoViewerModel.getOverallStats({
45 video,
46 startDate: query.startDate,
47 endDate: query.endDate
48 })
44 49
45 return res.json(stats) 50 return res.json(stats)
46} 51}