fix: calculate actual progress percentage for continue watching

This commit is contained in:
2026-05-02 20:09:13 +02:00
parent 594c2859ea
commit 248f234f73
9 changed files with 145 additions and 58 deletions

View File

@@ -62,6 +62,21 @@ func GetRenderer() *Renderer {
"sub": func(a, b int) int {
return a - b
},
"mul": func(a, b float64) float64 {
return a * b
},
"div": func(a, b float64) float64 {
if b == 0 {
return 0
}
return a / b
},
"percent": func(current, total float64) float64 {
if total == 0 {
return 0
}
return (current / total) * 100
},
}
pages, err := filepath.Glob(filepath.Join(".", "templates", "*.gohtml"))