diff options
Diffstat (limited to 'server/controllers/api/videos')
-rw-r--r-- | server/controllers/api/videos/stats.ts | 9 |
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 @@ | |||
1 | import express from 'express' | 1 | import express from 'express' |
2 | import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer' | 2 | import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer' |
3 | import { VideoStatsTimeserieMetric, VideoStatsTimeserieQuery } from '@shared/models' | 3 | import { VideoStatsOverallQuery, VideoStatsTimeserieMetric, VideoStatsTimeserieQuery } from '@shared/models' |
4 | import { | 4 | import { |
5 | asyncMiddleware, | 5 | asyncMiddleware, |
6 | authenticate, | 6 | authenticate, |
@@ -39,8 +39,13 @@ export { | |||
39 | 39 | ||
40 | async function getOverallStats (req: express.Request, res: express.Response) { | 40 | async 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 | } |