Documentation
¶
Overview ¶
Package config manages pixeltui's JSON config file at <dataDir>/config.json. It supports a setup wizard (Save) plus env-var overrides at load time.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
LastfmKey string `json:"lastfm_key"`
Subsonic Subsonic `json:"subsonic"`
LocalDirs []string `json:"local_dirs"` // folders of local audio files
DownloadDir string `json:"download_dir"` // where downloads are saved
Theme string `json:"theme"` // accent theme name (default if empty)
Explore int `json:"explore"` // 0..10, default 5
Autoplay bool `json:"autoplay"` // default true
}
Config is the persisted application configuration.
func Default ¶
func Default() *Config
Default returns a Config with sensible defaults (Explore=5, Autoplay=true).
func Load ¶
Load reads <dataDir>/config.json and overlays environment variables (env wins). A missing or malformed file is non-fatal: it falls back to Default() then applies env. It returns an error only for unexpected IO failures.
func (*Config) HasSubsonic ¶
HasSubsonic reports whether a Subsonic URL is configured.
Click to show internal directories.
Click to hide internal directories.