update more!
This commit is contained in:
parent
1efe2d08e1
commit
a706a38252
2 changed files with 169 additions and 0 deletions
12
cmd/helpers.go
Normal file
12
cmd/helpers.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package cmd
|
||||
|
||||
import "time"
|
||||
|
||||
func videoPercentageWatched(pos time.Duration, dur time.Duration) float64 {
|
||||
var percentage float64
|
||||
if dur.Milliseconds() > 0 {
|
||||
percentage = (float64(pos.Milliseconds()) / float64(dur.Milliseconds())) * 100
|
||||
}
|
||||
|
||||
return percentage
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue