aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/video-view.ts
blob: 091c9208364dce448361d89dd41837c165d549d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
import { exists } from './misc'

function isVideoTimeValid (value: number, videoDuration?: number) {
  if (value < 0) return false
  if (exists(videoDuration) && value > videoDuration) return false

  return true
}

export {
  isVideoTimeValid
}