mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
fix(actions): reject if client is disabled (#1626)
* fix(actions): error on disabled client * fix(actions): sql scan args * refactor: download client cache for actions * fix: tests client store * fix: tests client store and int conversion * fix: tests revert findbyid ctx timeout * fix: tests row.err * feat: add logging to download client cache
This commit is contained in:
parent
77e1c2c305
commit
861f30c144
30 changed files with 928 additions and 680 deletions
|
@ -9,20 +9,18 @@ import (
|
|||
"net/url"
|
||||
|
||||
"github.com/autobrr/autobrr/pkg/errors"
|
||||
|
||||
"github.com/autobrr/go-qbittorrent"
|
||||
)
|
||||
|
||||
type DownloadClientRepo interface {
|
||||
List(ctx context.Context) ([]DownloadClient, error)
|
||||
FindByID(ctx context.Context, id int32) (*DownloadClient, error)
|
||||
Store(ctx context.Context, client DownloadClient) (*DownloadClient, error)
|
||||
Update(ctx context.Context, client DownloadClient) (*DownloadClient, error)
|
||||
Delete(ctx context.Context, clientID int) error
|
||||
Store(ctx context.Context, client *DownloadClient) error
|
||||
Update(ctx context.Context, client *DownloadClient) error
|
||||
Delete(ctx context.Context, clientID int32) error
|
||||
}
|
||||
|
||||
type DownloadClient struct {
|
||||
ID int `json:"id"`
|
||||
ID int32 `json:"id"`
|
||||
Name string `json:"name"`
|
||||
Type DownloadClientType `json:"type"`
|
||||
Enabled bool `json:"enabled"`
|
||||
|
@ -33,11 +31,9 @@ type DownloadClient struct {
|
|||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
Settings DownloadClientSettings `json:"settings,omitempty"`
|
||||
}
|
||||
|
||||
type DownloadClientCached struct {
|
||||
Dc *DownloadClient
|
||||
Qbt *qbittorrent.Client
|
||||
// cached http client
|
||||
Client any
|
||||
}
|
||||
|
||||
type DownloadClientSettings struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue