From e9726363b42a2640122a204b15d07a5ae7cb71b0 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Sun, 29 Sep 2024 12:48:53 +0200 Subject: [PATCH] fix(downloadclients): do not load Deluge from cache (#1743) Co-authored-by: ze0s <> --- internal/action/deluge.go | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/internal/action/deluge.go b/internal/action/deluge.go index 04c8ba6..85ba50a 100644 --- a/internal/action/deluge.go +++ b/internal/action/deluge.go @@ -7,6 +7,7 @@ import ( "context" "encoding/base64" "os" + "time" "github.com/autobrr/autobrr/internal/domain" "github.com/autobrr/autobrr/pkg/errors" @@ -88,7 +89,15 @@ func (s *service) delugeCheckRulesCanDownload(ctx context.Context, del deluge.De } func (s *service) delugeV1(ctx context.Context, client *domain.DownloadClient, action *domain.Action, release domain.Release) ([]string, error) { - downloadClient := client.Client.(*deluge.Client) + //downloadClient := client.Client.(*deluge.Client) + downloadClient := deluge.NewV1(deluge.Settings{ + Hostname: client.Host, + Port: uint(client.Port), + Login: client.Username, + Password: client.Password, + DebugServerResponses: true, + ReadWriteTimeout: time.Second * 60, + }) // perform connection to Deluge server err := downloadClient.Connect(ctx) @@ -191,7 +200,15 @@ func (s *service) delugeV1(ctx context.Context, client *domain.DownloadClient, a } func (s *service) delugeV2(ctx context.Context, client *domain.DownloadClient, action *domain.Action, release domain.Release) ([]string, error) { - downloadClient := client.Client.(*deluge.ClientV2) + //downloadClient := client.Client.(*deluge.ClientV2) + downloadClient := deluge.NewV2(deluge.Settings{ + Hostname: client.Host, + Port: uint(client.Port), + Login: client.Username, + Password: client.Password, + DebugServerResponses: true, + ReadWriteTimeout: time.Second * 60, + }) // perform connection to Deluge server err := downloadClient.Connect(ctx)