Remove unnecessary configs

This commit is contained in:
Ben Sarmiento
2023-12-02 20:17:58 +01:00
parent 1d5f7fb1b6
commit e4bdecd979
2 changed files with 11 additions and 29 deletions

View File

@@ -14,13 +14,11 @@ type ConfigInterface interface {
MeetsConditions(directory, torrentName string, torrentIDs, fileNames []string) bool
GetOnLibraryUpdate() string
GetNetworkBufferSize() int
GetMountPoint() string
EnableRetainFolderNameExtension() bool
EnableRetainRDTorrentName() bool
GetRandomPreferredHost() string
ShouldServeFromRclone() bool
ShouldForceIPv6() bool
GetRateLimitSleepSeconds() int
GetRealDebridTimeout() int
GetRetriesUntilFailed() int
EnableDownloadCache() bool
@@ -32,12 +30,10 @@ type ZurgConfig struct {
Host string `yaml:"host"`
Port string `yaml:"port"`
NumOfWorkers int `yaml:"concurrent_workers"`
RateLimitSleepSeconds int `yaml:"rate_limit_sleep_secs"`
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"`
MountPoint string `yaml:"mount_point"`
RetainFolderNameExtension bool `yaml:"retain_folder_name_extension"`
RetainRDTorrentName bool `yaml:"retain_rd_torrent_name"`
PreferredHosts []string `yaml:"preferred_hosts"`
@@ -95,13 +91,6 @@ func (z *ZurgConfig) GetNetworkBufferSize() int {
return z.NetworkBufferSize
}
func (z *ZurgConfig) GetMountPoint() string {
if z.MountPoint == "" {
return "/app/mnt"
}
return z.MountPoint
}
func (z *ZurgConfig) EnableRetainFolderNameExtension() bool {
return z.RetainFolderNameExtension
}
@@ -126,20 +115,6 @@ func (z *ZurgConfig) ShouldForceIPv6() bool {
return z.ForceIPv6
}
func (z *ZurgConfig) GetRateLimitSleepSeconds() int {
if z.RateLimitSleepSeconds == 0 {
return 4
}
return z.RateLimitSleepSeconds
}
func (z *ZurgConfig) GetRealDebridTimeout() int {
if z.RealDebridTimeout == 0 {
return 60
}
return z.RealDebridTimeout
}
func (z *ZurgConfig) GetRetriesUntilFailed() int {
if z.RetriesUntilFailed == 0 {
return 5
@@ -150,3 +125,10 @@ func (z *ZurgConfig) GetRetriesUntilFailed() int {
func (z *ZurgConfig) EnableDownloadCache() bool {
return z.UseDownloadCache
}
func (z *ZurgConfig) GetRealDebridTimeout() int {
if z.RealDebridTimeout == 0 {
return 60
}
return z.RealDebridTimeout
}

View File

@@ -155,23 +155,23 @@ func (t *TorrentManager) RefreshTorrents() {
}
t.log.Infof("Compiled into %d torrents, %d were missing info", oldTorrents.Count(), noInfoCount)
somthingChanged := false
somethingChanged := false
// removed
strset.Difference(t.accessKeySet, freshKeys).Each(func(accessKey string) bool {
somthingChanged = true
somethingChanged = true
t.Delete(accessKey, false, false)
return true
})
// new
strset.Difference(freshKeys, t.accessKeySet).Each(func(accessKey string) bool {
somthingChanged = true
somethingChanged = true
torrent, _ := oldTorrents.Get(accessKey)
t.UpdateTorrentResponseCache(torrent)
t.accessKeySet.Add(accessKey)
return true
})
// now we can build the directory responses
if somthingChanged {
if somethingChanged {
t.UpdateDirectoryResponsesCache()
}