diff options
Diffstat (limited to 'shared/server-commands/videos/video-stats-command.ts')
-rw-r--r-- | shared/server-commands/videos/video-stats-command.ts | 4 |
1 files changed, 4 insertions, 0 deletions
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 @@ | |||
1 | import { pick } from '@shared/core-utils' | ||
1 | import { HttpStatusCode, VideoStatsOverall, VideoStatsRetention, VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@shared/models' | 2 | import { HttpStatusCode, VideoStatsOverall, VideoStatsRetention, VideoStatsTimeserie, VideoStatsTimeserieMetric } from '@shared/models' |
2 | import { AbstractCommand, OverrideCommandOptions } from '../shared' | 3 | import { AbstractCommand, OverrideCommandOptions } from '../shared' |
3 | 4 | ||
@@ -20,6 +21,8 @@ export class VideoStatsCommand extends AbstractCommand { | |||
20 | getTimeserieStats (options: OverrideCommandOptions & { | 21 | getTimeserieStats (options: OverrideCommandOptions & { |
21 | videoId: number | string | 22 | videoId: number | string |
22 | metric: VideoStatsTimeserieMetric | 23 | metric: VideoStatsTimeserieMetric |
24 | startDate?: Date | ||
25 | endDate?: Date | ||
23 | }) { | 26 | }) { |
24 | const path = '/api/v1/videos/' + options.videoId + '/stats/timeseries/' + options.metric | 27 | const path = '/api/v1/videos/' + options.videoId + '/stats/timeseries/' + options.metric |
25 | 28 | ||
@@ -27,6 +30,7 @@ export class VideoStatsCommand extends AbstractCommand { | |||
27 | ...options, | 30 | ...options, |
28 | path, | 31 | path, |
29 | 32 | ||
33 | query: pick(options, [ 'startDate', 'endDate' ]), | ||
30 | implicitToken: true, | 34 | implicitToken: true, |
31 | defaultExpectedStatus: HttpStatusCode.OK_200 | 35 | defaultExpectedStatus: HttpStatusCode.OK_200 |
32 | }) | 36 | }) |