mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(downloadclients): do not load Deluge from cache (#1743)
Co-authored-by: ze0s <>
This commit is contained in:
parent
91db3cfd0f
commit
e9726363b4
1 changed files with 19 additions and 2 deletions
|
@ -7,6 +7,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/autobrr/autobrr/internal/domain"
|
"github.com/autobrr/autobrr/internal/domain"
|
||||||
"github.com/autobrr/autobrr/pkg/errors"
|
"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) {
|
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
|
// perform connection to Deluge server
|
||||||
err := downloadClient.Connect(ctx)
|
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) {
|
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
|
// perform connection to Deluge server
|
||||||
err := downloadClient.Connect(ctx)
|
err := downloadClient.Connect(ctx)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue