]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/helpers/custom-validators/video-view.ts
/!\ Use a dedicated config file for development
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / video-view.ts
1 import { exists } from './misc'
2
3 function isVideoTimeValid (value: number, videoDuration?: number) {
4 if (value < 0) return false
5 if (exists(videoDuration) && value > videoDuration) return false
6
7 return true
8 }
9
10 export {
11 isVideoTimeValid
12 }