feat: add cache busting and hls query param

This commit is contained in:
2026-06-14 21:51:02 +02:00
parent f9f3322797
commit 4a74fdcf31
8 changed files with 23 additions and 6 deletions

View File

@@ -5,6 +5,7 @@ import (
"fmt"
"html/template"
"net/url"
"os"
"slices"
"strconv"
"strings"
@@ -284,3 +285,14 @@ func episodeRangeStart(epNum, step int) int {
}
return ((epNum-1)/step)*step + 1
}
func assetURL(assetPath string) string {
info, err := os.Stat(strings.TrimPrefix(assetPath, "/"))
if err != nil {
return assetPath
}
values := url.Values{}
values.Set("v", fmt.Sprintf("%d-%d", info.ModTime().Unix(), info.Size()))
return assetPath + "?" + values.Encode()
}