mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 00:39:13 +00:00
feat(actions): simplify macro parsing (#560)
* refactor(action): parse macros * feat(action): add ctx to arr clients and test
This commit is contained in:
parent
f6e68fae2b
commit
839eb9f3f3
31 changed files with 323 additions and 334 deletions
|
@ -5,6 +5,8 @@ import (
|
|||
"fmt"
|
||||
"net/url"
|
||||
|
||||
"github.com/autobrr/autobrr/pkg/errors"
|
||||
|
||||
"github.com/autobrr/go-qbittorrent"
|
||||
)
|
||||
|
||||
|
@ -69,6 +71,18 @@ const (
|
|||
DownloadClientTypeReadarr DownloadClientType = "READARR"
|
||||
)
|
||||
|
||||
// Validate basic validation of client
|
||||
func (c DownloadClient) Validate() error {
|
||||
// basic validation of client
|
||||
if c.Host == "" {
|
||||
return errors.New("validation error: missing host")
|
||||
} else if c.Type == "" {
|
||||
return errors.New("validation error: missing type")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c DownloadClient) BuildLegacyHost() string {
|
||||
if c.Type == DownloadClientTypeQbittorrent {
|
||||
return c.qbitBuildLegacyHost()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue