Add basic auth and fix repair issues

This commit is contained in:
Ben Sarmiento
2024-01-09 16:53:12 +01:00
parent eb3f2785ce
commit 91f6d35831
7 changed files with 73 additions and 39 deletions

View File

@@ -11,6 +11,8 @@ type ConfigInterface interface {
EnableRepair() bool
GetHost() string
GetPort() string
GetUsername() string
GetPassword() string
GetDirectories() []string
MeetsConditions(directory, torrentName string, torrentSize int64, torrentIDs, fileNames []string, fileSizes []int64) bool
GetOnLibraryUpdate() string
@@ -34,6 +36,8 @@ type ZurgConfig struct {
Host string `yaml:"host" json:"host"`
Port string `yaml:"port" json:"port"`
Username string `yaml:"username" json:"username"`
Password string `yaml:"password" json:"password"`
NumOfWorkers int `yaml:"concurrent_workers" json:"concurrent_workers"`
RefreshEverySeconds int `yaml:"check_for_changes_every_secs" json:"check_for_changes_every_secs"`
@@ -78,6 +82,14 @@ func (z *ZurgConfig) GetPort() string {
return z.Port
}
func (z *ZurgConfig) GetUsername() string {
return z.Username
}
func (z *ZurgConfig) GetPassword() string {
return z.Password
}
func (z *ZurgConfig) GetNumOfWorkers() int {
if z.NumOfWorkers == 0 {
return 50