From 5e56c7f0e801e45526f87a8a6c433868701dcbad Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Fri, 2 Jan 2026 17:34:41 -0600 Subject: [PATCH 1/4] Implement file deletion after successful uploads in runner and encoding processes - Added logic to delete files after successful uploads in both runner and encode tasks to prevent duplicate uploads. - Included logging for any errors encountered during file deletion to ensure visibility of issues. --- internal/runner/runner.go | 4 ++++ internal/runner/tasks/encode.go | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/internal/runner/runner.go b/internal/runner/runner.go index 1d7fa9d..cb7e816 100644 --- a/internal/runner/runner.go +++ b/internal/runner/runner.go @@ -289,6 +289,10 @@ func (r *Runner) uploadOutputs(ctx *tasks.Context, job *api.NextJobResponse) err log.Printf("Failed to upload %s: %v", filePath, err) } else { ctx.OutputUploaded(entry.Name()) + // Delete file after successful upload to prevent duplicate uploads + if err := os.Remove(filePath); err != nil { + log.Printf("Warning: Failed to delete file %s after upload: %v", filePath, err) + } } } diff --git a/internal/runner/tasks/encode.go b/internal/runner/tasks/encode.go index 06ebd8d..f0d6984 100644 --- a/internal/runner/tasks/encode.go +++ b/internal/runner/tasks/encode.go @@ -373,6 +373,12 @@ func (p *EncodeProcessor) Process(ctx *Context) error { ctx.Info(fmt.Sprintf("Successfully uploaded %s: %s", strings.ToUpper(outputExt), filepath.Base(outputVideo))) + // Delete file after successful upload to prevent duplicate uploads + if err := os.Remove(outputVideo); err != nil { + log.Printf("Warning: Failed to delete video file %s after upload: %v", outputVideo, err) + ctx.Warn(fmt.Sprintf("Warning: Failed to delete video file after upload: %v", err)) + } + log.Printf("Successfully generated and uploaded %s for job %d: %s", strings.ToUpper(outputExt), ctx.JobID, filepath.Base(outputVideo)) return nil } From 0b852c5087ecedbca6bb8f0c51112e788293158e Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Fri, 2 Jan 2026 17:40:34 -0600 Subject: [PATCH 2/4] Update Gitea workflow to specify output binary location for jiggablend build - Changed the build command in the test-pr.yaml workflow to output the jiggablend binary to the bin directory. - This modification enhances the organization of build artifacts and aligns with project structure. --- .gitea/workflows/test-pr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/test-pr.yaml b/.gitea/workflows/test-pr.yaml index 33a868a..2602c67 100644 --- a/.gitea/workflows/test-pr.yaml +++ b/.gitea/workflows/test-pr.yaml @@ -11,5 +11,5 @@ jobs: with: go-version-file: 'go.mod' - run: go mod tidy - - run: go build ./... + - run: go build -o bin/jiggablend ./cmd/jiggablend - run: go test -race -v -shuffle=on ./... \ No newline at end of file From 3f2982ddb3f122eeca0da5880ced212e152c6b17 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Fri, 2 Jan 2026 17:46:03 -0600 Subject: [PATCH 3/4] Update Gitea workflow to include frontend build step and adjust Go build command - Added a step to install and build the frontend using npm in the test-pr.yaml workflow. - Modified the Go build command to compile all packages instead of specifying the output binary location. - This change improves the build process by integrating frontend assets with the backend build. --- .gitea/workflows/test-pr.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/test-pr.yaml b/.gitea/workflows/test-pr.yaml index 2602c67..2c56f54 100644 --- a/.gitea/workflows/test-pr.yaml +++ b/.gitea/workflows/test-pr.yaml @@ -10,6 +10,7 @@ jobs: - uses: actions/setup-go@main with: go-version-file: 'go.mod' - - run: go mod tidy - - run: go build -o bin/jiggablend ./cmd/jiggablend + - run: go mod tidy + - run: cd web && npm install && npm run build + - run: go build ./... - run: go test -race -v -shuffle=on ./... \ No newline at end of file From 1c4bd78f56c724c90fad08d5e35f8a6795d0a17b Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Fri, 2 Jan 2026 17:48:46 -0600 Subject: [PATCH 4/4] Add FFmpeg setup step to Gitea workflow for enhanced media processing - Included a new step in the test-pr.yaml workflow to set up FFmpeg, improving the project's media handling capabilities. - This addition complements the existing build steps for Go and frontend assets, ensuring a more comprehensive build environment. --- .gitea/workflows/test-pr.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitea/workflows/test-pr.yaml b/.gitea/workflows/test-pr.yaml index 2c56f54..6da108e 100644 --- a/.gitea/workflows/test-pr.yaml +++ b/.gitea/workflows/test-pr.yaml @@ -10,6 +10,7 @@ jobs: - uses: actions/setup-go@main with: go-version-file: 'go.mod' + - uses: FedericoCarboni/setup-ffmpeg@v3 - run: go mod tidy - run: cd web && npm install && npm run build - run: go build ./...