From 8e5cac5653a07c79ae4f6a5a5d9083ab885def50 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Wed, 10 Dec 2025 16:14:52 -0500 Subject: [PATCH] Handle drag/drop into merge list --- main.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/main.go b/main.go index c234620..56d6aac 100644 --- a/main.go +++ b/main.go @@ -1311,6 +1311,39 @@ func (s *appState) handleModuleDrop(moduleID string, items []fyne.URI) { return } + if moduleID == "merge" { + go func() { + var clips []mergeClip + for _, p := range videoPaths { + src, err := probeVideo(p) + if err != nil { + logging.Debug(logging.CatModule, "failed to probe merge clip %s: %v", p, err) + continue + } + clips = append(clips, mergeClip{ + Path: p, + Chapter: strings.TrimSuffix(filepath.Base(p), filepath.Ext(p)), + Duration: src.Duration, + }) + } + if len(clips) == 0 { + fyne.CurrentApp().Driver().DoFromGoroutine(func() { + dialog.ShowInformation("Merge", "No valid video files found.", s.window) + }, false) + return + } + fyne.CurrentApp().Driver().DoFromGoroutine(func() { + s.mergeClips = append(s.mergeClips, clips...) + if len(s.mergeClips) >= 2 && strings.TrimSpace(s.mergeOutput) == "" { + first := filepath.Dir(s.mergeClips[0].Path) + s.mergeOutput = filepath.Join(first, "merged.mkv") + } + s.showMergeView() + }, false) + }() + return + } + // Single file or non-convert module: load first video and show module path := videoPaths[0] logging.Debug(logging.CatModule, "drop on module %s path=%s - starting load", moduleID, path)