Defer queue start until direct convert finishes
This commit is contained in:
parent
e0e7c33445
commit
846cd64419
11
main.go
11
main.go
|
|
@ -843,6 +843,15 @@ func (s *appState) executeConvertJob(ctx context.Context, job *queue.Job, progre
|
||||||
inputPath := cfg["inputPath"].(string)
|
inputPath := cfg["inputPath"].(string)
|
||||||
outputPath := cfg["outputPath"].(string)
|
outputPath := cfg["outputPath"].(string)
|
||||||
|
|
||||||
|
// If a direct conversion is running, wait until it finishes before starting queued jobs.
|
||||||
|
for s.convertBusy {
|
||||||
|
select {
|
||||||
|
case <-ctx.Done():
|
||||||
|
return ctx.Err()
|
||||||
|
case <-time.After(500 * time.Millisecond):
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Build FFmpeg arguments
|
// Build FFmpeg arguments
|
||||||
args := []string{
|
args := []string{
|
||||||
"-y",
|
"-y",
|
||||||
|
|
@ -1973,7 +1982,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
} else {
|
} else {
|
||||||
dialog.ShowInformation("Queue", "Job added to queue!", state.window)
|
dialog.ShowInformation("Queue", "Job added to queue!", state.window)
|
||||||
// Auto-start queue if not already running
|
// Auto-start queue if not already running
|
||||||
if state.jobQueue != nil && !state.jobQueue.IsRunning() {
|
if state.jobQueue != nil && !state.jobQueue.IsRunning() && !state.convertBusy {
|
||||||
state.jobQueue.Start()
|
state.jobQueue.Start()
|
||||||
logging.Debug(logging.CatUI, "queue auto-started after adding job")
|
logging.Debug(logging.CatUI, "queue auto-started after adding job")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user