Support network proxies

This commit is contained in:
Ben Sarmiento
2024-01-11 04:15:40 +01:00
parent dfa3ef99b0
commit b2e02c7e1f
5 changed files with 66 additions and 34 deletions

View File

@@ -13,6 +13,7 @@ type ConfigInterface interface {
GetPort() string
GetUsername() string
GetPassword() string
GetProxy() string
GetDirectories() []string
MeetsConditions(directory, torrentName string, torrentSize int64, torrentIDs, fileNames []string, fileSizes []int64) bool
GetOnLibraryUpdate() string
@@ -39,6 +40,7 @@ type ZurgConfig struct {
Port string `yaml:"port" json:"port"`
Username string `yaml:"username" json:"username"`
Password string `yaml:"password" json:"password"`
Proxy string `yaml:"proxy" json:"proxy"`
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
@@ -92,6 +94,10 @@ func (z *ZurgConfig) GetPassword() string {
return z.Password
}
func (z *ZurgConfig) GetProxy() string {
return z.Proxy
}
func (z *ZurgConfig) GetNumOfWorkers() int {
if z.NumOfWorkers == 0 {
return 50