mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-04 10:19:35 +02:00
Add filter by start/end date overall stats in api
This commit is contained in:
parent
f18a060a83
commit
49f0468d44
9 changed files with 121 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
import express from 'express'
|
||||
import { LocalVideoViewerModel } from '@server/models/view/local-video-viewer'
|
||||
import { VideoStatsTimeserieMetric, VideoStatsTimeserieQuery } from '@shared/models'
|
||||
import { VideoStatsOverallQuery, VideoStatsTimeserieMetric, VideoStatsTimeserieQuery } from '@shared/models'
|
||||
import {
|
||||
asyncMiddleware,
|
||||
authenticate,
|
||||
|
@ -39,8 +39,13 @@ export {
|
|||
|
||||
async function getOverallStats (req: express.Request, res: express.Response) {
|
||||
const video = res.locals.videoAll
|
||||
const query = req.query as VideoStatsOverallQuery
|
||||
|
||||
const stats = await LocalVideoViewerModel.getOverallStats(video)
|
||||
const stats = await LocalVideoViewerModel.getOverallStats({
|
||||
video,
|
||||
startDate: query.startDate,
|
||||
endDate: query.endDate
|
||||
})
|
||||
|
||||
return res.json(stats)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue