config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string `mapstructure:"version" yaml:"version,omitempty"`

	Trakt struct {
		ClientID     string `mapstructure:"client_id" json:"client_id" yaml:"client_id"`
		ClientSecret string `mapstructure:"client_secret" json:"client_secret" yaml:"client_secret"`
	} `mapstructure:"trakt" json:"trakt" yaml:"trakt"`

	Radarr struct {
		URL            string `mapstructure:"url" json:"url" yaml:"url"`
		APIKey         string `mapstructure:"api_key" json:"api_key" yaml:"api_key"`
		QualityProfile int    `mapstructure:"quality_profile" json:"quality_profile" yaml:"quality_profile"`
		RootFolder     string `mapstructure:"root_folder" json:"root_folder" yaml:"root_folder"`
	} `mapstructure:"radarr" json:"radarr" yaml:"radarr"`

	Sonarr struct {
		URL            string `mapstructure:"url" json:"url" yaml:"url"`
		APIKey         string `mapstructure:"api_key" json:"api_key" yaml:"api_key"`
		QualityProfile int    `mapstructure:"quality_profile" json:"quality_profile" yaml:"quality_profile"`
		RootFolder     string `mapstructure:"root_folder" json:"root_folder" yaml:"root_folder"`
	} `mapstructure:"sonarr" json:"sonarr" yaml:"sonarr"`

	Jellyseerr struct {
		URL    string `mapstructure:"url" json:"url" yaml:"url"`
		APIKey string `mapstructure:"api_key" json:"api_key" yaml:"api_key"`
		UserID string `mapstructure:"user_id" json:"user_id" yaml:"user_id"` // Optional: request as specific user
	} `mapstructure:"jellyseerr" json:"jellyseerr" yaml:"jellyseerr"`

	Jobs struct {
		SyncInterval string `mapstructure:"sync_interval" json:"sync_interval" yaml:"sync_interval"`
		Mode         string `mapstructure:"mode" json:"mode" yaml:"mode"` // "direct" or "jellyseerr"

		TrendingMovies struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"trending_movies" json:"trending_movies" yaml:"trending_movies"`

		TrendingShows struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"trending_shows" json:"trending_shows" yaml:"trending_shows"`

		PopularMovies struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"popular_movies" json:"popular_movies" yaml:"popular_movies"`

		PopularShows struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"popular_shows" json:"popular_shows" yaml:"popular_shows"`

		BoxOffice struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"box_office" json:"box_office" yaml:"box_office"`

		FavoritedMovies struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"favorited_movies" json:"favorited_movies" yaml:"favorited_movies"`

		PlayedMovies struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"played_movies" json:"played_movies" yaml:"played_movies"`

		WatchedMovies struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"watched_movies" json:"watched_movies" yaml:"watched_movies"`

		CollectedMovies struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"collected_movies" json:"collected_movies" yaml:"collected_movies"`

		AnticipatedMovies struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"anticipated_movies" json:"anticipated_movies" yaml:"anticipated_movies"`

		FavoritedShows struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"favorited_shows" json:"favorited_shows" yaml:"favorited_shows"`

		PlayedShows struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"played_shows" json:"played_shows" yaml:"played_shows"`

		WatchedShows struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"watched_shows" json:"watched_shows" yaml:"watched_shows"`

		CollectedShows struct {
			Enabled bool   `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int    `mapstructure:"limit" json:"limit" yaml:"limit"`
			Period  string `mapstructure:"period" json:"period" yaml:"period"`
		} `mapstructure:"collected_shows" json:"collected_shows" yaml:"collected_shows"`

		AnticipatedShows struct {
			Enabled bool `mapstructure:"enabled" json:"enabled" yaml:"enabled"`
			Limit   int  `mapstructure:"limit" json:"limit" yaml:"limit"`
		} `mapstructure:"anticipated_shows" json:"anticipated_shows" yaml:"anticipated_shows"`
	} `mapstructure:"jobs" json:"jobs" yaml:"jobs"`

	// Internal field to track config file path
	ConfigFilePath string `mapstructure:"-" json:"-" yaml:"-"`
}

Config represents the application configuration

func New

func New(version string) (*Config, error)

New creates a new Config instance with the given settings

func (*Config) Save

func (c *Config) Save() error

Save writes the current config back to the config file

Jump to

Keyboard shortcuts

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