db

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *gorm.DB

Functions

func AddNotify added in v0.0.8

func AddNotify(n *Notify) error

func AddServer

func AddServer(s *EmbyServer) error

func CheckInit

func CheckInit() bool

func CreateUser

func CreateUser(username, password string) error

func DeleteNotify added in v0.0.8

func DeleteNotify(id uint) error

func DeleteServer

func DeleteServer(id uint) error

func Init

func Init(path string) error

func UpdateGlobalConfig

func UpdateGlobalConfig(g *GlobalConfig) error

func UpdateNotify added in v0.0.8

func UpdateNotify(n *Notify) error

func UpdatePassword

func UpdatePassword(username, newPassword string) error

func UpdateServer

func UpdateServer(s *EmbyServer) error

Types

type EmbyServer

type EmbyServer struct {
	ID                        uint   `gorm:"primaryKey" json:"ID"`
	Name                      string `gorm:"uniqueIndex" json:"Name"`
	HTTPPort                  int    `gorm:"uniqueIndex" json:"HTTPPort"`
	EmbyHost                  string `json:"EmbyHost"`
	EmbyToken                 string `json:"EmbyToken"`
	MountPath                 string `json:"MountPath"`
	LocalMediaRoot            string `json:"LocalMediaRoot"` // Emby 本地媒体根目录
	OpenlistHost              string `json:"OpenlistHost"`
	OpenlistToken             string `json:"OpenlistToken"`
	InternalRedirectEnable    bool   `json:"InternalRedirectEnable"`
	DirectLinkCacheExpired    string `json:"DirectLinkCacheExpired"`
	DirectLinkCacheIgnore     string `json:"DirectLinkCacheIgnore"`
	DirectLinkCacheIgnoreMode int    `json:"DirectLinkCacheIgnoreMode"` // 0: blacklist, 1: whitelist
	DisableProxy              bool   `json:"DisableProxy"`              // If true, only serve as config holder, don't start proxy
	CreatedAt                 time.Time
	UpdatedAt                 time.Time
}

func GetServers

func GetServers() ([]EmbyServer, error)

type GlobalConfig

type GlobalConfig struct {
	ID                            uint `gorm:"primaryKey"`
	EpisodesUnplayPrior           bool
	ResortRandomItems             bool
	ProxyErrorStrategy            string
	ImagesQuality                 int
	DownloadStrategy              string
	CacheEnable                   bool
	CacheExpired                  string
	VideoPreviewEnable            bool
	VideoPreviewContainers        string
	VideoPreviewIgnoreTemplateIds string
	PathEmby2Openlist             string
	LogDisableColor               bool
	StrmPathMap                   string
	CacheWhiteList                string
	LTGEnable                     bool
	LTGFFmpegEnable               bool
	LTGVirtualContainers          string
	LTGStrmContainers             string
	LTGMusicContainers            string
	LTGAutoRemoveMaxCount         int
	LTGRefreshInterval            int
	LTGScanPrefixes               string
	LTGIgnoreContainers           string
	LTGThreads                    int
	SslEnable                     bool
	SslSinglePort                 bool
	SslKey                        string
	SslCrt                        string
	NotifyEnable                  bool
	NotifyUrl                     string
	NotifyMethod                  string
	NotifyContentType             string
	NotifyTitleKey                string
	NotifyContentKey              string
}

func GetGlobalConfig

func GetGlobalConfig() (GlobalConfig, error)

type Notify added in v0.0.8

type Notify struct {
	ID          uint      `gorm:"primaryKey" json:"ID"`
	Name        string    `json:"Name"`
	Enable      bool      `json:"Enable"`
	Url         string    `json:"Url"`
	Method      string    `json:"Method"`
	ContentType string    `json:"ContentType"`
	TitleKey    string    `json:"TitleKey"`
	ContentKey  string    `json:"ContentKey"`
	CreatedAt   time.Time `json:"CreatedAt"`
	UpdatedAt   time.Time `json:"UpdatedAt"`
}

func GetNotifies added in v0.0.8

func GetNotifies() ([]Notify, error)

type User

type User struct {
	ID       uint   `gorm:"primaryKey"`
	Username string `gorm:"uniqueIndex"`
	Password string
}

func GetUser

func GetUser(username, password string) (*User, error)

Jump to

Keyboard shortcuts

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