config

package module
v0.0.0-...-2886a1b Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultSettings = map[string]string{
	"anidbClient":               "error",
	"anidbVersion":              "error",
	"anidbSyncInterval":         "1440",
	"monitorSyncInterval":       "1",
	"prowlarrUrl":               "http://host.docker.internal:9696",
	"prowlarrApiKey":            "error",
	"prowlarrInterval":          "1",
	"downloaderInterval":        "1",
	"matchThreshold":            "80",
	"cacheFileLimit":            "10",
	"prowlarrCacheAge":          "3600",
	"autoMonitorOnAdd":          "false",
	"preferredQuality":          "1080p",
	"minSeeders":                "1",
	"qbittorrentUrl":            "http://host.docker.internal:8080",
	"qbittorrentUsername":       "",
	"qbittorrentPassword":       "",
	"downloadPath":              "/app/downloads",
	"mediaPath":                 "/app/media",
	"allowedVideoExtensions":    ".mkv,.mp4,.avi,.mov,.wmv,.m4v",
	"stallTimeout":              "300",
	"availabilityCheckInterval": "10",
	"devMode":                   "false",
	"authUsername":              "",
	"authPasswordHash":          "",
}

Functions

func EnsureDefaults

func EnsureDefaults(db *bun.DB) error

func Get

func Get(db *bun.DB, key, fallback string) string

Get returns the value for key from the settings table, or fallback if not found.

func GetMinutes

func GetMinutes(db *bun.DB, key string, fallback, min time.Duration) time.Duration

GetMinutes parses a setting stored as a minute count into a time.Duration. If the value is missing or below min, fallback is returned.

func GetSeconds

func GetSeconds(db *bun.DB, key string, fallback, min time.Duration) time.Duration

GetSeconds parses a setting stored as a second count into a time.Duration.

func GetSettingsMap

func GetSettingsMap(db *bun.DB) (map[string]string, error)

func SetSetting

func SetSetting(db *bun.DB, key, value string) error

Types

type Setting

type Setting struct {
	bun.BaseModel `bun:"table:settings,alias:s"`
	Key           string  `bun:"key,notnull,unique"`
	Value         *string `bun:"value"`
}

Jump to

Keyboard shortcuts

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