Allow passing IDs from standard input
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/dweymouth/supersonic/res"
|
||||
"github.com/dweymouth/supersonic/ui"
|
||||
"github.com/dweymouth/supersonic/ui/util"
|
||||
"golang.org/x/term"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/app"
|
||||
@@ -31,6 +32,15 @@ func main() {
|
||||
flag.Usage()
|
||||
return
|
||||
}
|
||||
if !term.IsTerminal(int(os.Stdin.Fd())) {
|
||||
if *backend.FlagPlayAlbum {
|
||||
fmt.Scanln(&backend.PlayAlbumCLIArg)
|
||||
} else if *backend.FlagPlayPlaylist {
|
||||
fmt.Scanln(&backend.PlayPlaylistCLIArg)
|
||||
} else if *backend.FlagPlayTrack {
|
||||
fmt.Scanln(&backend.PlayTrackCLIArg)
|
||||
}
|
||||
}
|
||||
// rest of flag actions are handled in backend.StartupApp
|
||||
|
||||
myApp, err := backend.StartupApp(res.AppName, res.DisplayName, res.AppVersion, res.AppVersionTag, res.LatestReleaseURL)
|
||||
|
||||
Reference in New Issue
Block a user