Hotfix on repairs

This commit is contained in:
Ben Sarmiento
2023-12-06 00:49:11 +01:00
parent de868d97c2
commit 121a28d46f
4 changed files with 44 additions and 38 deletions

View File

@@ -3,6 +3,7 @@ package config
import "math/rand"
type ConfigInterface interface {
GetConfig() ZurgConfig
GetVersion() string
GetToken() string
GetNumOfWorkers() int
@@ -26,24 +27,28 @@ type ConfigInterface interface {
}
type ZurgConfig struct {
Version string `yaml:"zurg"`
Token string `yaml:"token"`
Host string `yaml:"host"`
Port string `yaml:"port"`
NumOfWorkers int `yaml:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs"`
CanRepair bool `yaml:"enable_repair"`
OnLibraryUpdate string `yaml:"on_library_update"`
NetworkBufferSize int `yaml:"network_buffer_size"`
RateLimitSleepSeconds int `yaml:"rate_limit_sleep_secs"`
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension"`
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name"`
PreferredHosts []string `yaml:"preferred_hosts"`
ServeFromRclone bool `yaml:"serve_from_rclone"`
ForceIPv6 bool `yaml:"force_ipv6"`
RealDebridTimeout int `yaml:"realdebrid_timeout_secs"`
RetriesUntilFailed int `yaml:"retries_until_failed"`
UseDownloadCache bool `yaml:"use_download_cache"`
Version string `yaml:"zurg" json:"-"`
Token string `yaml:"token" json:"-"`
Host string `yaml:"host" json:"host"`
Port string `yaml:"port" json:"port"`
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
CanRepair bool `yaml:"enable_repair" json:"enable_repair"`
OnLibraryUpdate string `yaml:"on_library_update" json:"on_library_update"`
NetworkBufferSize int `yaml:"network_buffer_size" json:"network_buffer_size"`
RateLimitSleepSeconds int `yaml:"rate_limit_sleep_secs" json:"rate_limit_sleep_secs"`
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension" json:"retain_folder_name_extension"`
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name" json:"retain_rd_torrent_name"`
PreferredHosts []string `yaml:"preferred_hosts" json:"preferred_hosts"`
ServeFromRclone bool `yaml:"serve_from_rclone" json:"serve_from_rclone"`
ForceIPv6 bool `yaml:"force_ipv6" json:"force_ipv6"`
RealDebridTimeout int `yaml:"realdebrid_timeout_secs" json:"realdebrid_timeout_secs"`
RetriesUntilFailed int `yaml:"retries_until_failed" json:"retries_until_failed"`
UseDownloadCache bool `yaml:"use_download_cache" json:"use_download_cache"`
}
func (z *ZurgConfig) GetConfig() ZurgConfig {
return *z
}
func (z *ZurgConfig) GetToken() string {