mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-03 17:59:37 +02:00
Add ability to set start/end date to timeserie
This commit is contained in:
parent
ac907dc7c1
commit
901bcf5c18
12 changed files with 296 additions and 22 deletions
|
@ -1,3 +1,4 @@
|
|||
import { pick } from '@shared/core-utils'
|
||||
import { HttpStatusCode, VideoStatsOverall, VideoStatsRetention, VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@shared/models'
|
||||
import { AbstractCommand, OverrideCommandOptions } from '../shared'
|
||||
|
||||
|
@ -20,6 +21,8 @@ export class VideoStatsCommand extends AbstractCommand {
|
|||
getTimeserieStats (options: OverrideCommandOptions & {
|
||||
videoId: number | string
|
||||
metric: VideoStatsTimeserieMetric
|
||||
startDate?: Date
|
||||
endDate?: Date
|
||||
}) {
|
||||
const path = '/api/v1/videos/' + options.videoId + '/stats/timeseries/' + options.metric
|
||||
|
||||
|
@ -27,6 +30,7 @@ export class VideoStatsCommand extends AbstractCommand {
|
|||
...options,
|
||||
path,
|
||||
|
||||
query: pick(options, [ 'startDate', 'endDate' ]),
|
||||
implicitToken: true,
|
||||
defaultExpectedStatus: HttpStatusCode.OK_200
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue