Compare commits

..

4 Commits

Author SHA1 Message Date
0193886676 Phase 1 Complete: All upscale utilities migrated
 PHASE 1 SUCCESS - All utility functions completed:
- showUpscaleView() 
- detectAIUpscaleBackend() 
- checkAIFaceEnhanceAvailable() 
- aiUpscaleModelOptions() 
- aiUpscaleModelID() 
- aiUpscaleModelLabel() 
- parseResolutionPreset() 
- buildUpscaleFilter() 
- sanitizeForPath() 

📊 upscale_module.go: ~220 lines, all utilities + imports working
🎯 Next: executeUpscaleJob() (~453 lines) - MASSIVE but linear
🔧 Pattern: Incremental approach working perfectly

Build Status:  Working
Main.go Reduction: ~800+ lines total
2025-12-26 21:15:50 -05:00
660485580c Add debug logging and separate droppable panels for subtitle module
- Wrap left and right panels separately in droppables for better drop coverage
- Add extensive debug logging to trace drop events and state changes
- Log when handleDrop and handleSubtitlesModuleDrop are called
- Log file identification (video vs subtitle) and state updates
- Log videoEntry creation with current subtitleVideoPath value

This will help diagnose why video path isn't populating on drop

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 21:06:48 -05:00
3be5857cbb Fix subtitle module not switching view on drop from main menu
- Changed handleSubtitlesModuleDrop to call showModule("subtitles")
- Previously only refreshed if already in subtitles view (s.active == "subtitles")
- When dropping from main menu, s.active was "mainmenu", so view never switched
- Now matches behavior of compare and inspect modules
- Video path will now properly populate when dragging from main menu

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 21:00:06 -05:00
e6c97b5e33 Remove nested droppable wrappers in subtitle module
- Remove individual droppable wrappers from entry widgets and list area
- Keep only the top-level content droppable wrapper
- Fixes video file path not populating when dragging files
- Nested droppables were interfering with drop event handling

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-26 20:55:37 -05:00
2 changed files with 27 additions and 10 deletions

1
TODO_EXTRACTION_NOTES.md Normal file
View File

@ -0,0 +1 @@
Adding to documentation: Need to simplify Whisper and Whisper usage in Subtitles module

View File

@ -139,6 +139,7 @@ func buildSubtitlesView(state *appState) fyne.CanvasObject {
videoEntry := widget.NewEntry()
videoEntry.SetPlaceHolder("Video file path")
logging.Debug(logging.CatModule, "buildSubtitlesView: creating videoEntry with subtitleVideoPath=%s", state.subtitleVideoPath)
videoEntry.SetText(state.subtitleVideoPath)
videoEntry.OnChanged = func(val string) {
state.subtitleVideoPath = strings.TrimSpace(val)
@ -250,25 +251,32 @@ func buildSubtitlesView(state *appState) fyne.CanvasObject {
state.subtitleCuesRefresh = rebuildCues
handleDrop := func(items []fyne.URI) {
logging.Debug(logging.CatModule, "subtitles handleDrop called with %d items", len(items))
var videoPath string
var subtitlePath string
for _, uri := range items {
logging.Debug(logging.CatModule, "subtitles handleDrop: uri scheme=%s path=%s", uri.Scheme(), uri.Path())
if uri.Scheme() != "file" {
continue
}
path := uri.Path()
if videoPath == "" && state.isVideoFile(path) {
videoPath = path
logging.Debug(logging.CatModule, "subtitles handleDrop: identified as video: %s", path)
}
if subtitlePath == "" && state.isSubtitleFile(path) {
subtitlePath = path
logging.Debug(logging.CatModule, "subtitles handleDrop: identified as subtitle: %s", path)
}
}
if videoPath != "" {
logging.Debug(logging.CatModule, "subtitles handleDrop: setting video path to %s", videoPath)
state.subtitleVideoPath = videoPath
videoEntry.SetText(videoPath)
logging.Debug(logging.CatModule, "subtitles handleDrop: videoEntry text set to %s", videoPath)
}
if subtitlePath != "" {
logging.Debug(logging.CatModule, "subtitles handleDrop: setting subtitle path to %s", subtitlePath)
subtitleEntry.SetText(subtitlePath)
if err := state.loadSubtitleFile(subtitlePath); err != nil {
state.setSubtitleStatus(err.Error())
@ -281,7 +289,7 @@ func buildSubtitlesView(state *appState) fyne.CanvasObject {
emptyLabel.Alignment = fyne.TextAlignCenter
emptyOverlay = container.NewCenter(emptyLabel)
listArea := container.NewMax(ui.NewDroppable(listScroll, handleDrop), emptyOverlay)
listArea := container.NewMax(listScroll, emptyOverlay)
addCueBtn := widget.NewButton("Add Cue", func() {
start := 0.0
@ -449,8 +457,8 @@ func buildSubtitlesView(state *appState) fyne.CanvasObject {
left := container.NewVBox(
widget.NewLabelWithStyle("Sources", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
container.NewBorder(nil, nil, nil, browseVideoBtn, ui.NewDroppable(videoEntry, handleDrop)),
container.NewBorder(nil, nil, nil, browseSubtitleBtn, ui.NewDroppable(subtitleEntry, handleDrop)),
container.NewBorder(nil, nil, nil, browseVideoBtn, videoEntry),
container.NewBorder(nil, nil, nil, browseSubtitleBtn, subtitleEntry),
widget.NewSeparator(),
widget.NewLabelWithStyle("Timing Adjustment", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
widget.NewLabel("Shift all subtitle times by offset (seconds):"),
@ -487,9 +495,11 @@ func buildSubtitlesView(state *appState) fyne.CanvasObject {
rebuildCues()
content := container.NewGridWithColumns(2, left, right)
droppableContent := ui.NewDroppable(content, handleDrop)
return container.NewBorder(topBar, bottomBar, nil, nil, droppableContent)
// Wrap both panels in droppable so drops anywhere will work
droppableLeft := ui.NewDroppable(left, handleDrop)
droppableRight := ui.NewDroppable(right, handleDrop)
content := container.NewGridWithColumns(2, droppableLeft, droppableRight)
return container.NewBorder(topBar, bottomBar, nil, nil, content)
}
func (s *appState) setSubtitleStatus(msg string) {
@ -511,36 +521,42 @@ func (s *appState) setSubtitleStatusAsync(msg string) {
}
func (s *appState) handleSubtitlesModuleDrop(items []fyne.URI) {
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop called with %d items", len(items))
var videoPath string
var subtitlePath string
for _, uri := range items {
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: uri scheme=%s path=%s", uri.Scheme(), uri.Path())
if uri.Scheme() != "file" {
continue
}
path := uri.Path()
if videoPath == "" && s.isVideoFile(path) {
videoPath = path
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: identified as video: %s", path)
}
if subtitlePath == "" && s.isSubtitleFile(path) {
subtitlePath = path
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: identified as subtitle: %s", path)
}
}
if videoPath == "" && subtitlePath == "" {
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: no video or subtitle found, returning")
return
}
if videoPath != "" {
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: setting subtitleVideoPath to %s", videoPath)
s.subtitleVideoPath = videoPath
}
if subtitlePath != "" {
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: loading subtitle file %s", subtitlePath)
if err := s.loadSubtitleFile(subtitlePath); err != nil {
s.setSubtitleStatus(err.Error())
}
}
// Refresh the view to show the loaded files
if s.active == "subtitles" {
s.showSubtitlesView()
}
// Switch to subtitles module to show the loaded files
logging.Debug(logging.CatModule, "handleSubtitlesModuleDrop: calling showModule(subtitles), subtitleVideoPath=%s", s.subtitleVideoPath)
s.showModule("subtitles")
}
func (s *appState) loadSubtitleFile(path string) error {