From 901bcf5c188ea79350fecd499ad76460b866617b Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 7 Apr 2022 10:53:35 +0200 Subject: Add ability to set start/end date to timeserie --- shared/server-commands/videos/video-stats-command.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shared/server-commands/videos/video-stats-command.ts') diff --git a/shared/server-commands/videos/video-stats-command.ts b/shared/server-commands/videos/video-stats-command.ts index 90f7ffeaf..bd4808f63 100644 --- a/shared/server-commands/videos/video-stats-command.ts +++ b/shared/server-commands/videos/video-stats-command.ts @@ -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 }) -- cgit v1.2.3