mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Constantize the defaultFocus value for each module
This commit is contained in:
@@ -7,7 +7,10 @@ import (
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
)
|
||||
|
||||
const defaultTitle = "Spotify Web"
|
||||
const (
|
||||
defaultFocusable = true
|
||||
defaultTitle = "Spotify Web"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
@@ -20,7 +23,7 @@ type Settings struct {
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
|
||||
settings := Settings{
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, ymlConfig, globalConfig),
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
callbackPort: ymlConfig.UString("callbackPort", "8080"),
|
||||
clientID: ymlConfig.UString("clientID", os.Getenv("SPOTIFY_ID")),
|
||||
|
||||
@@ -12,6 +12,15 @@ import (
|
||||
"github.com/zmb3/spotify"
|
||||
)
|
||||
|
||||
var (
|
||||
auth spotify.Authenticator
|
||||
tempClientChan = make(chan *spotify.Client)
|
||||
state = "wtfSpotifyWebStateString"
|
||||
authURL string
|
||||
callbackPort string
|
||||
redirectURI string
|
||||
)
|
||||
|
||||
// Info is the struct that contains all the information the Spotify player displays to the user
|
||||
type Info struct {
|
||||
Artists string
|
||||
@@ -34,15 +43,6 @@ type Widget struct {
|
||||
settings *Settings
|
||||
}
|
||||
|
||||
var (
|
||||
auth spotify.Authenticator
|
||||
tempClientChan = make(chan *spotify.Client)
|
||||
state = "wtfSpotifyWebStateString"
|
||||
authURL string
|
||||
callbackPort string
|
||||
redirectURI string
|
||||
)
|
||||
|
||||
func authHandler(w http.ResponseWriter, r *http.Request) {
|
||||
tok, err := auth.Token(state, r)
|
||||
if err != nil {
|
||||
@@ -70,7 +70,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) *
|
||||
|
||||
widget := Widget{
|
||||
KeyboardWidget: view.NewKeyboardWidget(app, pages, settings.common),
|
||||
TextWidget: view.NewTextWidget(app, settings.common, true),
|
||||
TextWidget: view.NewTextWidget(app, settings.common),
|
||||
|
||||
Info: Info{},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user