Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearServerConfig ¶
func ClearServerConfig() error
ClearServerConfig removes all server-related configuration (type, URL, credentials) while preserving other settings (player, UI, logging)
func DefaultCachePath ¶
func DefaultCachePath() string
DefaultCachePath returns the default cache directory path for the current OS
func SaveConfig ¶
SaveConfig saves the current configuration to file
Types ¶
type Config ¶
type Config struct {
Server ServerConfig `mapstructure:"server"`
Player PlayerConfig `mapstructure:"player"`
UI UIConfig `mapstructure:"ui"`
Logging LoggingConfig `mapstructure:"logging"`
CurrentProfile string `mapstructure:"current_profile"`
Profiles map[string]ProfileConfig `mapstructure:"profiles"`
}
Config holds all application configuration
func LoadConfig ¶
LoadConfig loads configuration from file and environment
func (*Config) ApplyProfileForUI ¶
ApplyProfileForUI switches the active server profile in memory.
func (*Config) IsConfigured ¶
IsConfigured returns true if the server URL and token are set
func (*Config) ProfileNames ¶
ProfileNames returns configured profile names in stable insertion-free order.
type LoggingConfig ¶
LoggingConfig holds logging configuration
type PlayerConfig ¶
type PlayerConfig struct {
Command string `mapstructure:"command"`
Args []string `mapstructure:"args"`
StartFlag string `mapstructure:"start_flag"` // e.g., "--start=" or "--start-time="
}
PlayerConfig holds media player configuration
type ProfileConfig ¶
type ProfileConfig struct {
Server ServerConfig `mapstructure:"server"`
}
ProfileConfig stores a named server profile.
type ServerConfig ¶
type ServerConfig struct {
Type SourceType `mapstructure:"type" yaml:"type"` // "plex" or "jellyfin"
URL string `mapstructure:"url" yaml:"url"` // Server URL
Token string `mapstructure:"token" yaml:"token"` // Plex token OR Jellyfin API key
UserID string `mapstructure:"user_id" yaml:"user_id"` // Jellyfin only
Username string `mapstructure:"username" yaml:"username"` // Jellyfin only (display)
}
ServerConfig holds media server configuration
type SourceType ¶
type SourceType string
SourceType identifies the media server backend
const ( SourceTypePlex SourceType = "plex" SourceTypeJellyfin SourceType = "jellyfin" )
type UIConfig ¶
type UIConfig struct {
ShowWatchStatus bool `mapstructure:"show_watch_status"` // Show watched/unwatched/in-progress indicators
ShowLibraryCounts bool `mapstructure:"show_library_counts"` // Keep library item counts visible after sync
HideWatched bool `mapstructure:"hide_watched"` // Hide items that are already watched
Autoplay bool `mapstructure:"autoplay"` // Automatically play the next episode
}
UIConfig holds UI configuration