its a bit broken
This commit is contained in:
@@ -25,7 +25,6 @@ import (
|
||||
authpkg "jiggablend/internal/auth"
|
||||
"jiggablend/pkg/types"
|
||||
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/gorilla/websocket"
|
||||
|
||||
"jiggablend/pkg/scripts"
|
||||
@@ -62,7 +61,7 @@ func (s *Server) handleCreateJob(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
var req types.CreateJobRequest
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid request body")
|
||||
s.respondError(w, http.StatusBadRequest, fmt.Sprintf("Invalid request body: expected valid JSON - %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -83,7 +82,7 @@ func (s *Server) handleCreateJob(w http.ResponseWriter, r *http.Request) {
|
||||
s.respondError(w, http.StatusBadRequest, "frame_start and frame_end are required for render jobs")
|
||||
return
|
||||
}
|
||||
if *req.FrameStart < 0 || *req.FrameEnd < *req.FrameStart {
|
||||
if *req.FrameEnd < *req.FrameStart {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid frame range")
|
||||
return
|
||||
}
|
||||
@@ -671,7 +670,7 @@ func (s *Server) handleBatchGetJobs(w http.ResponseWriter, r *http.Request) {
|
||||
JobIDs []int64 `json:"job_ids"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid request body")
|
||||
s.respondError(w, http.StatusBadRequest, fmt.Sprintf("Invalid request body: expected valid JSON - %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1677,7 +1676,7 @@ func (s *Server) extractMetadataFromTempContext(contextPath string) (*types.Blen
|
||||
})
|
||||
|
||||
if err != nil || blendFile == "" {
|
||||
return nil, fmt.Errorf("no .blend file found in context")
|
||||
return nil, fmt.Errorf("no .blend file found in context - the uploaded context archive must contain at least one .blend file to render")
|
||||
}
|
||||
|
||||
// Use the same extraction script and process as extractMetadataFromContext
|
||||
@@ -1894,7 +1893,7 @@ func (s *Server) createContextFromDir(sourceDir, destPath string, excludeFiles .
|
||||
}
|
||||
|
||||
if blendFilesAtRoot == 0 {
|
||||
return "", fmt.Errorf("no .blend file found at root level in context archive")
|
||||
return "", fmt.Errorf("no .blend file found at root level in context archive - .blend files must be at the root level of the uploaded archive, not in subdirectories")
|
||||
}
|
||||
if blendFilesAtRoot > 1 {
|
||||
return "", fmt.Errorf("multiple .blend files found at root level in context archive (found %d, expected 1)", blendFilesAtRoot)
|
||||
@@ -2958,7 +2957,7 @@ func (s *Server) handleBatchGetTasks(w http.ResponseWriter, r *http.Request) {
|
||||
TaskIDs []int64 `json:"task_ids"`
|
||||
}
|
||||
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid request body")
|
||||
s.respondError(w, http.StatusBadRequest, fmt.Sprintf("Invalid request body: expected valid JSON - %v", err))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3057,10 +3056,9 @@ func (s *Server) handleGetTaskLogs(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
taskIDStr := chi.URLParam(r, "taskId")
|
||||
taskID, err := strconv.ParseInt(taskIDStr, 10, 64)
|
||||
taskID, err := parseID(r, "taskId")
|
||||
if err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid task ID")
|
||||
s.respondError(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3196,10 +3194,9 @@ func (s *Server) handleGetTaskSteps(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
taskIDStr := chi.URLParam(r, "taskId")
|
||||
taskID, err := strconv.ParseInt(taskIDStr, 10, 64)
|
||||
taskID, err := parseID(r, "taskId")
|
||||
if err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid task ID")
|
||||
s.respondError(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3304,10 +3301,9 @@ func (s *Server) handleRetryTask(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
|
||||
taskIDStr := chi.URLParam(r, "taskId")
|
||||
taskID, err := strconv.ParseInt(taskIDStr, 10, 64)
|
||||
taskID, err := parseID(r, "taskId")
|
||||
if err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid task ID")
|
||||
s.respondError(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
@@ -3396,10 +3392,9 @@ func (s *Server) handleStreamTaskLogsWebSocket(w http.ResponseWriter, r *http.Re
|
||||
return
|
||||
}
|
||||
|
||||
taskIDStr := chi.URLParam(r, "taskId")
|
||||
taskID, err := strconv.ParseInt(taskIDStr, 10, 64)
|
||||
taskID, err := parseID(r, "taskId")
|
||||
if err != nil {
|
||||
s.respondError(w, http.StatusBadRequest, "Invalid task ID")
|
||||
s.respondError(w, http.StatusBadRequest, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user