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
43 lines
670 B
Go
43 lines
670 B
Go
package porla
|
|
|
|
func (c *Client) Version() (*SysVersionsPorla, error) {
|
|
response, err := c.rpcClient.Call("sys.versions")
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
if response.Error != nil {
|
|
return nil, response.Error
|
|
}
|
|
|
|
var versions *SysVersions
|
|
err = response.GetObject(&versions)
|
|
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &versions.Porla, nil
|
|
}
|
|
|
|
func (c *Client) TorrentsAdd(req *TorrentsAddReq) error {
|
|
response, err := c.rpcClient.Call("torrents.add", req)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
if response.Error != nil {
|
|
return response.Error
|
|
}
|
|
|
|
var res *TorrentsAddRes
|
|
err = response.GetObject(&res)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|