Remove cache time limit for info
This commit is contained in:
@@ -8,24 +8,6 @@ import (
|
|||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConfigInterface interface {
|
|
||||||
GetVersion() string
|
|
||||||
GetToken() string
|
|
||||||
GetNumOfWorkers() int
|
|
||||||
GetRefreshEverySeconds() int
|
|
||||||
GetCacheTimeHours() int
|
|
||||||
EnableRepair() bool
|
|
||||||
GetHost() string
|
|
||||||
GetPort() string
|
|
||||||
GetDirectories() []string
|
|
||||||
MeetsConditions(directory, torrentName string, torrentIDs, fileNames []string) bool
|
|
||||||
GetOnLibraryUpdate() string
|
|
||||||
GetNetworkBufferSize() int
|
|
||||||
GetMountPoint() string
|
|
||||||
EnableRetainFolderNameExtension() bool
|
|
||||||
GetRandomPreferredHost() string
|
|
||||||
}
|
|
||||||
|
|
||||||
func LoadZurgConfig(filename string) (ConfigInterface, error) {
|
func LoadZurgConfig(filename string) (ConfigInterface, error) {
|
||||||
log := logutil.NewLogger().Named("config")
|
log := logutil.NewLogger().Named("config")
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,23 @@ package config
|
|||||||
|
|
||||||
import "math/rand"
|
import "math/rand"
|
||||||
|
|
||||||
|
type ConfigInterface interface {
|
||||||
|
GetVersion() string
|
||||||
|
GetToken() string
|
||||||
|
GetNumOfWorkers() int
|
||||||
|
GetRefreshEverySeconds() int
|
||||||
|
EnableRepair() bool
|
||||||
|
GetHost() string
|
||||||
|
GetPort() string
|
||||||
|
GetDirectories() []string
|
||||||
|
MeetsConditions(directory, torrentName string, torrentIDs, fileNames []string) bool
|
||||||
|
GetOnLibraryUpdate() string
|
||||||
|
GetNetworkBufferSize() int
|
||||||
|
GetMountPoint() string
|
||||||
|
EnableRetainFolderNameExtension() bool
|
||||||
|
GetRandomPreferredHost() string
|
||||||
|
}
|
||||||
|
|
||||||
type ZurgConfig struct {
|
type ZurgConfig struct {
|
||||||
Version string `yaml:"zurg"`
|
Version string `yaml:"zurg"`
|
||||||
Token string `yaml:"token"`
|
Token string `yaml:"token"`
|
||||||
@@ -9,7 +26,6 @@ type ZurgConfig struct {
|
|||||||
Port string `yaml:"port"`
|
Port string `yaml:"port"`
|
||||||
NumOfWorkers int `yaml:"concurrent_workers"`
|
NumOfWorkers int `yaml:"concurrent_workers"`
|
||||||
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
|
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
|
||||||
CacheTimeHours int `yaml:"info_cache_time_hours"`
|
|
||||||
CanRepair bool `yaml:"enable_repair"`
|
CanRepair bool `yaml:"enable_repair"`
|
||||||
OnLibraryUpdate string `yaml:"on_library_update"`
|
OnLibraryUpdate string `yaml:"on_library_update"`
|
||||||
NetworkBufferSize int `yaml:"network_buffer_size"`
|
NetworkBufferSize int `yaml:"network_buffer_size"`
|
||||||
@@ -50,10 +66,6 @@ func (z *ZurgConfig) GetRefreshEverySeconds() int {
|
|||||||
return z.RefreshEverySeconds
|
return z.RefreshEverySeconds
|
||||||
}
|
}
|
||||||
|
|
||||||
func (z *ZurgConfig) GetCacheTimeHours() int {
|
|
||||||
return z.CacheTimeHours
|
|
||||||
}
|
|
||||||
|
|
||||||
func (z *ZurgConfig) EnableRepair() bool {
|
func (z *ZurgConfig) EnableRepair() bool {
|
||||||
return z.CanRepair
|
return z.CanRepair
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user