fix hours bug

This commit is contained in:
2026-02-27 15:32:33 +01:00
parent d0eef4853a
commit fa6b69045d
2 changed files with 3 additions and 3 deletions

View File

@@ -50,9 +50,9 @@ func uploadHandler(c *gin.Context) {
return return
} }
durationHours := 24 // default durationHours := 24
if val := c.PostForm("duration"); val != "" { if val := c.PostForm("duration"); val != "" {
fmt.Println("Duration provided:", val) fmt.Println("Duration:", val)
if parsed, err := strconv.Atoi(val); err == nil { if parsed, err := strconv.Atoi(val); err == nil {
durationHours = parsed durationHours = parsed
} }

View File

@@ -267,7 +267,7 @@
fd.append("file", file); fd.append("file", file);
fd.append("once", document.getElementById("once").checked ? "true" : "false"); fd.append("once", document.getElementById("once").checked ? "true" : "false");
const hours = parseInt(document.getElementById("duration").value, 10); const hours = parseInt(document.getElementById("duration").value, 10);
fd.append("duration", hours * 3600); // convert hours to seconds fd.append("duration", hours);
const xhr = new XMLHttpRequest(); const xhr = new XMLHttpRequest();
currentXhr = xhr; currentXhr = xhr;