keep-around/fdb88b04b32b9392e76795099e2ec47c9856b38b
parent
6ed39e2570
commit
47c07a32e5
@ -0,0 +1,11 @@ |
||||
import find from 'lodash/find' |
||||
|
||||
import type { MatchInfo } from 'requests/getMatchInfo' |
||||
|
||||
import { FULL_MATCH_BOUNDARY } from 'features/MatchPage/components/LiveMatch/helpers' |
||||
|
||||
export const calculateDuration = (profile: MatchInfo) => { |
||||
const bound = find(profile?.video_bounds, { h: FULL_MATCH_BOUNDARY }) |
||||
if (!bound) return 0 |
||||
return Number(bound.e) - Number(bound.s) |
||||
} |
||||
Loading…
Reference in new issue