Init commit
This commit is contained in:
16
server/core/helpers/custom-validators/video-stats.ts
Normal file
16
server/core/helpers/custom-validators/video-stats.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { VideoStatsTimeserieMetric } from '@peertube/peertube-models'
|
||||
|
||||
const validMetrics = new Set<VideoStatsTimeserieMetric>([
|
||||
'viewers',
|
||||
'aggregateWatchTime'
|
||||
])
|
||||
|
||||
function isValidStatTimeserieMetric (value: VideoStatsTimeserieMetric) {
|
||||
return validMetrics.has(value)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export {
|
||||
isValidStatTimeserieMetric
|
||||
}
|
||||
Reference in New Issue
Block a user