Skip to content

Commit

Permalink
Changes to support updating the ffmpeg path from the settings tab #3
Browse files Browse the repository at this point in the history
  • Loading branch information
alexballas committed Aug 24, 2024
1 parent 024a6b5 commit fadd280
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions internal/gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/alexballas/go2tv/httphandlers"
Expand Down Expand Up @@ -66,6 +67,7 @@ type NewScreen struct {
mediaFormats []string
muError sync.RWMutex
mu sync.RWMutex
ffmpegPathChanged bool
Medialoop bool
sliderActive bool
Transcode bool
Expand Down Expand Up @@ -126,13 +128,22 @@ func Start(ctx context.Context, s *NewScreen) {
s.SelectInternalSubs.Disable()
}

if s.ffmpegPathChanged {
furi, err := storage.ParseURI("file://" + s.mediafile)
if err == nil {
go selectMediaFile(s, furi)
}
s.ffmpegPathChanged = false
}

if t.Text == "Go2TV" {
s.Hotkeys = true
return
}
s.Hotkeys = false
}

s.ffmpegPathChanged = false
if err := utils.CheckFFmpeg(s.ffmpegPath); err != nil {
s.TranscodeCheckBox.Disable()
}
Expand Down
1 change: 1 addition & 0 deletions internal/gui/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func settingsWindow(s *NewScreen) fyne.CanvasObject {
ffmpegTextEntry.OnChanged = func(update string) {
s.ffmpegPath = update
fyne.CurrentApp().Preferences().SetString("ffmpeg", update)
s.ffmpegPathChanged = true
}

debugText := widget.NewLabel("Debug")
Expand Down

0 comments on commit fadd280

Please sign in to comment.