From b3db00c53385b112086c63b3c4de13743fad06ee Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sat, 29 Nov 2025 20:31:52 -0500 Subject: [PATCH] Auto-start queue when adding jobs from Convert module MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implements automatic queue processing when jobs are added from the Convert module via the 'Add to Queue' button: Features: - IsRunning() method added to queue package to check processing status - 'Add to Queue' button now auto-starts queue if not already running - Eliminates need to manually open Queue view and click 'Start Queue' - Seamless workflow: Add video → Queue → Auto-starts conversion Before: 1. Load video 2. Click 'Add to Queue' 3. Click 'View Queue' 4. Click 'Start Queue' After: 1. Load video 2. Click 'Add to Queue' (auto-starts!) 3. Load next video 4. Click 'Add to Queue' (already running) Perfect for batch operations where user loads multiple videos and expects them to start encoding immediately. --- internal/queue/queue.go | 7 +++++++ main.go | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/internal/queue/queue.go b/internal/queue/queue.go index aab9819..b248add 100644 --- a/internal/queue/queue.go +++ b/internal/queue/queue.go @@ -283,6 +283,13 @@ func (q *Queue) Stop() { q.running = false } +// IsRunning returns true if the queue is currently processing jobs +func (q *Queue) IsRunning() bool { + q.mu.RLock() + defer q.mu.RUnlock() + return q.running +} + // PauseAll pauses any running job and stops processing func (q *Queue) PauseAll() { q.mu.Lock() diff --git a/main.go b/main.go index 185c749..fd6421b 100644 --- a/main.go +++ b/main.go @@ -1880,6 +1880,11 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject { dialog.ShowError(err, state.window) } else { dialog.ShowInformation("Queue", "Job added to queue!", state.window) + // Auto-start queue if not already running + if state.jobQueue != nil && !state.jobQueue.IsRunning() { + state.jobQueue.Start() + logging.Debug(logging.CatUI, "queue auto-started after adding job") + } } }) if src == nil {