config

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCacheDir

func GetCacheDir() (string, error)

GetCacheDir returns the cache directory path

func GetConfigDir

func GetConfigDir() (string, error)

GetConfigDir returns the platform-specific config directory

func GetConfigPath

func GetConfigPath() (string, error)

GetConfigPath returns the full path to the config file

Types

type Config

type Config struct {
	// Legacy single-server fields (for backward compatibility)
	PlexURL      string `json:"plex_url,omitempty"`
	PlexToken    string `json:"plex_token"`
	PlexUsername string `json:"plex_username,omitempty"`

	// Multi-server support
	Servers []PlexServer `json:"servers,omitempty"`

	// Tool paths
	MPVPath    string `json:"mpv_path,omitempty"`
	RclonePath string `json:"rclone_path,omitempty"`
	FzfPath    string `json:"fzf_path,omitempty"`
}

func Load

func Load() (*Config, error)

Load reads the config file and returns a Config struct

func (*Config) GetEnabledServers

func (c *Config) GetEnabledServers() []PlexServer

GetEnabledServers returns all servers that should be indexed

func (*Config) MigrateLegacy

func (c *Config) MigrateLegacy() error

MigrateLegacy converts old single-server config to multi-server format

func (*Config) Save

func (c *Config) Save() error

Save writes the config to disk

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the config has required fields

type PlexServer

type PlexServer struct {
	Name    string `json:"name"`
	URL     string `json:"url"`
	Enabled bool   `json:"enabled"` // Whether to index this server
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL