mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00

* Add support for the 'Test' button to work * Make Porla show up in filter actions select * Add an empty Porla action * Make Porla action find download client * Make implementation actually add torrent to Porla * Fix qBittorrent import * Finish up Porla action * Check length on commitish before slicing * Move Porla to the other DL clients * Add Porla to type name map * Move Porla to beneath the other download clients
30 lines
515 B
Go
30 lines
515 B
Go
package porla
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/autobrr/autobrr/pkg/jsonrpc"
|
|
)
|
|
|
|
type Client struct {
|
|
Name string
|
|
Hostname string
|
|
rpcClient jsonrpc.Client
|
|
}
|
|
|
|
type Settings struct {
|
|
Hostname string
|
|
AuthToken string
|
|
Log *log.Logger
|
|
}
|
|
|
|
func NewClient(settings Settings) *Client {
|
|
c := &Client{
|
|
rpcClient: jsonrpc.NewClientWithOpts(settings.Hostname+"/api/v1/jsonrpc", &jsonrpc.ClientOpts{
|
|
Headers: map[string]string{
|
|
"Authorization": "Bearer " + settings.AuthToken,
|
|
},
|
|
}),
|
|
}
|
|
return c
|
|
}
|