Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cmd/go2tv/FyneApp.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Website = "https://go2tv.app"

[Details]
Icon = "assets/go2tv-icon-desktop-512.png"
Name = "go2tv"
ID = "app.go2tv.go2tv"
Version = "1.19.0"
Build = 1
Icon = "assets/go2tv-icon-desktop-512.png"
Name = "go2tv"
ID = "app.go2tv.go2tv"
Version = "1.19.0"
Build = 2

[Migrations]
fyneDo = true
fyneDo = true
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ require (
github.com/rs/zerolog v1.34.0
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966
github.com/sqweek/dialog v0.0.0-20260123140253-64c163d53aac
golang.org/x/time v0.14.0
)

require (
fyne.io/systray v1.11.1-0.20250603113521-ca66a66d8b58 // indirect
github.com/BurntSushi/toml v1.5.0 // indirect
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf // indirect
github.com/clipperhouse/stringish v0.1.1 // indirect
github.com/clipperhouse/uax29/v2 v2.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ fyne.io/systray v1.11.1-0.20250603113521-ca66a66d8b58 h1:eA5/u2XRd8OUkoMqEv3IBlF
fyne.io/systray v1.11.1-0.20250603113521-ca66a66d8b58/go.mod h1:RVwqP9nYMo7h5zViCBHri2FgjXF7H2cub7MAq4NSoLs=
github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg=
github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf h1:FPsprx82rdrX2jiKyS17BH6IrTmUBYqZa/CXT4uvb+I=
github.com/TheTitanrain/w32 v0.0.0-20180517000239-4f5cfb03fabf/go.mod h1:peYoMncQljjNS6tZwI9WVyQB3qZS6u79/N3mBOcnd3I=
github.com/alexballas/go-ssdp v0.0.3 h1:wTtHib45NtrkYZ/saCaB/2qJ9ci6EWeQFl6imaW4gPg=
github.com/alexballas/go-ssdp v0.0.3/go.mod h1:jUwvJl32BZxBQiRbW5Q0h1QrDGMuA+HRg5qTQvIquJE=
github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs=
Expand Down Expand Up @@ -101,6 +103,8 @@ github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d h1:hrujxIzL1woJ7
github.com/saintfish/chardet v0.0.0-20230101081208-5e3ef4b5456d/go.mod h1:uugorj2VCxiV1x+LzaIdVa9b4S4qGAcH6cbhh4qVxOU=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/sqweek/dialog v0.0.0-20260123140253-64c163d53aac h1:/QqP+ajFMma4hNWQyBDVaQQhz9Z1kDyXScNWMO3owx0=
github.com/sqweek/dialog v0.0.0-20260123140253-64c163d53aac/go.mod h1:/qNPSY91qTz/8TgHEMioAUc6q7+3SOybeKczHMXFcXw=
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c h1:km8GpoQut05eY3GiYWEedbTT0qnSxrCjsVbb7yKY1KE=
github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c/go.mod h1:cNQ3dwVJtS5Hmnjxy6AgTPd0Inb3pW05ftPSX7NZO7Q=
github.com/srwiley/rasterx v0.0.0-20220730225603-2ab79fcdd4ef h1:Ch6Q+AZUxDBCVqdkI8FSpFyZDtCVBc2VmejdNrm5rRQ=
Expand Down
65 changes: 26 additions & 39 deletions internal/gui/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (

"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/lang"
"fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/theme"
Expand All @@ -27,6 +26,7 @@ import (
"github.com/alexballas/go2tv/soapcalls/utils"
"github.com/pkg/errors"
"github.com/skratchdot/open-golang/open"
nativedialog "github.com/sqweek/dialog"
)

func muteAction(screen *FyneScreen) {
Expand Down Expand Up @@ -131,57 +131,44 @@ func selectSubsFile(screen *FyneScreen, f fyne.URI) {
}

func mediaAction(screen *FyneScreen) {
w := screen.Current
fd := dialog.NewFileOpen(func(reader fyne.URIReadCloser, err error) {
check(screen, err)

if reader == nil {
return
}
defer reader.Close()
extensions := translateExtensions(screen.mediaFormats)
filename, err := showFileDialog(screen.currentmfolder, extensions, "Media Files")

selectMediaFile(screen, reader.URI())
}, w)

fd.SetFilter(storage.NewExtensionFileFilter(screen.mediaFormats))
if errors.Is(err, nativedialog.ErrCancelled) {
return
}
if err != nil {
check(screen, err)
return
}

if screen.currentmfolder != "" {
mfileURI := storage.NewFileURI(screen.currentmfolder)
mfileLister, err := storage.ListerForURI(mfileURI)
furi, err := storage.ParseURI("file://" + filename)
if err != nil {
check(screen, err)
fd.SetLocation(mfileLister)
return
}

fd.Resize(fyne.NewSize(w.Canvas().Size().Width*1.2, w.Canvas().Size().Height*1.3))
fd.Show()
selectMediaFile(screen, furi)
}

func subsAction(screen *FyneScreen) {
w := screen.Current
fd := dialog.NewFileOpen(func(reader fyne.URIReadCloser, err error) {
check(screen, err)
filename, err := showFileDialog(screen.currentmfolder, []string{"srt"}, "Subtitles Files")

if reader == nil {
return
}
defer reader.Close()

selectSubsFile(screen, reader.URI())
}, w)
fd.SetFilter(storage.NewExtensionFileFilter([]string{".srt"}))
if errors.Is(err, nativedialog.ErrCancelled) {
return
}
if err != nil {
check(screen, err)
return
}

if screen.currentmfolder != "" {
mfileURI := storage.NewFileURI(screen.currentmfolder)
mfileLister, err := storage.ListerForURI(mfileURI)
furi, err := storage.ParseURI("file://" + filename)
if err != nil {
check(screen, err)
if err != nil {
return
}
fd.SetLocation(mfileLister)
return
}
fd.Resize(fyne.NewSize(w.Canvas().Size().Width*1.2, w.Canvas().Size().Height*1.3))

fd.Show()
selectSubsFile(screen, furi)
}

func playAction(screen *FyneScreen) {
Expand Down
54 changes: 28 additions & 26 deletions internal/gui/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package gui

import (
"os"
"os/exec"
"path/filepath"

Expand All @@ -13,6 +14,8 @@ import (
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"github.com/pkg/errors"
nativedialog "github.com/sqweek/dialog"
)

func settingsWindow(s *FyneScreen) fyne.CanvasObject {
Expand Down Expand Up @@ -50,22 +53,18 @@ func settingsWindow(s *FyneScreen) fyne.CanvasObject {
})

ffmpegFolderSelect := widget.NewButtonWithIcon("", theme.FolderOpenIcon(), func() {
fd := dialog.NewFolderOpen(func(lu fyne.ListableURI, err error) {
if err != nil {
dialog.ShowError(err, w)
return
}
if lu == nil {
return
}

p := filepath.ToSlash(lu.Path() + string(filepath.Separator) + "ffmpeg")
ffmpegTextEntry.SetText(p)
}, w)
directory, err := showFolderDialog("", "Select FFmpeg Directory")

fd.Resize(fyne.NewSize(w.Canvas().Size().Width*1.2, w.Canvas().Size().Height*1.3))
fd.Show()
if errors.Is(err, nativedialog.ErrCancelled) {
return
}
if err != nil {
dialog.ShowError(err, w)
return
}

p := filepath.ToSlash(directory + string(filepath.Separator) + "ffmpeg")
ffmpegTextEntry.SetText(p)
})

ffmpegRightButtons := container.NewHBox(ffmpegFolderSelect, ffmpegFolderReset)
Expand Down Expand Up @@ -104,20 +103,23 @@ func settingsWindow(s *FyneScreen) fyne.CanvasObject {
return
}

fd := dialog.NewFileSave(func(writer fyne.URIWriteCloser, err error) {
if err != nil {
dialog.ShowError(err, s.Current)
return
}
if writer == nil {
return
}
filename, err := showSaveDialog("", []string{"log", "txt"}, "Log Files", "Export Debug Logs")

saveDebugLogs(writer, s)
}, s.Current)
if errors.Is(err, nativedialog.ErrCancelled) {
return
}
if err != nil {
dialog.ShowError(err, s.Current)
return
}

file, err := os.Create(filename)
if err != nil {
dialog.ShowError(err, s.Current)
return
}

fd.Resize(fyne.NewSize(w.Canvas().Size().Width*1.2, w.Canvas().Size().Height*1.3))
fd.Show()
saveDebugLogs(&fileWriteCloser{file}, s)
})

gaplessText := widget.NewLabel(lang.L("Gapless Playback"))
Expand Down