update more!

This commit is contained in:
eyjhb 2025-01-26 22:37:37 +01:00
parent 1efe2d08e1
commit a706a38252
Signed by: eyjhb
GPG key ID: 609F508E3239F920
2 changed files with 169 additions and 0 deletions

12
cmd/helpers.go Normal file
View 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
}