Use a proper client for fetch byte

This commit is contained in:
Ben Sarmiento
2023-11-24 21:35:22 +01:00
parent 1e8c50a350
commit 595040ad7e
6 changed files with 97 additions and 116 deletions

View File

@@ -18,6 +18,7 @@ type ConfigInterface interface {
EnableRetainFolderNameExtension() bool
EnableRetainRDTorrentName() bool
GetRandomPreferredHost() string
ShouldServeFromRclone() bool
}
type ZurgConfig struct {
@@ -34,6 +35,7 @@ type ZurgConfig struct {
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"`
}
func (z *ZurgConfig) GetToken() string {
@@ -105,3 +107,7 @@ func (z *ZurgConfig) GetRandomPreferredHost() string {
randomIndex := rand.Intn(len(z.PreferredHosts))
return z.PreferredHosts[randomIndex]
}
func (z *ZurgConfig) ShouldServeFromRclone() bool {
return z.ServeFromRclone
}