Implement context archive handling and metadata extraction for render jobs. Add functionality to check for Blender availability, create context archives, and extract metadata from .blend files. Update job creation and retrieval processes to support new metadata structure and context file management. Enhance client-side components to display context files and integrate new API endpoints for context handling.

This commit is contained in:
2025-11-24 10:02:13 -06:00
parent f9ff4d0138
commit a029714e08
13 changed files with 3887 additions and 856 deletions

View File

@@ -6,6 +6,7 @@ import (
"log"
"net/http"
"os"
"os/exec"
"jiggablend/internal/api"
"jiggablend/internal/auth"
@@ -40,6 +41,14 @@ func main() {
log.Fatalf("Failed to initialize storage: %v", err)
}
// Check if Blender is available (required for metadata extraction)
if err := checkBlenderAvailable(); err != nil {
log.Fatalf("Blender is not available: %v\n"+
"The manager requires Blender to be installed and in PATH for metadata extraction.\n"+
"Please install Blender and ensure it's accessible via the 'blender' command.", err)
}
log.Printf("Blender is available")
// Create API server
server, err := api.NewServer(db, authHandler, storageHandler)
if err != nil {
@@ -76,3 +85,14 @@ func getEnv(key, defaultValue string) string {
}
return defaultValue
}
// checkBlenderAvailable checks if Blender is available by running `blender --version`
func checkBlenderAvailable() error {
cmd := exec.Command("blender", "--version")
output, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("failed to run 'blender --version': %w (output: %s)", err, string(output))
}
// If we got here, Blender is available
return nil
}