refactor: extract anime service layer and optimize API calls

This commit is contained in:
2026-05-05 16:05:45 +02:00
parent 6d6446f73c
commit cb16d8e6c7
5 changed files with 457 additions and 387 deletions

View File

@@ -85,10 +85,19 @@ func GetRenderer() *Renderer {
"toFloat": func(a int) float64 {
return float64(a)
},
"seq": func(start, end int) []int {
res := make([]int, 0, end-start)
for i := start; i < end; i++ {
res = append(res, i)
"seq": func(v any) []int {
var count int
switch n := v.(type) {
case int:
count = n
case int64:
count = int(n)
default:
count = 0
}
res := make([]int, count)
for i := 0; i < count; i++ {
res[i] = i
}
return res
},