mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
Add support for using freeleech tokens if available
This commit is contained in:
parent
74f777340e
commit
3656a68a27
28 changed files with 199 additions and 39 deletions
|
@ -32,12 +32,12 @@ func (c *Client) TestAPI(ctx context.Context) (bool, error) {
|
|||
return false, nil
|
||||
}
|
||||
|
||||
func (c *Client) GetTorrentByID(ctx context.Context, torrentID string) (*domain.TorrentBasic, error) {
|
||||
func (c *Client) GetTorrentByID(ctx context.Context, torrentID string, freeleechToken bool) (*domain.TorrentBasic, error) {
|
||||
if torrentID == "" {
|
||||
return nil, errors.New("btn client: must have torrentID")
|
||||
}
|
||||
|
||||
res, err := c.rpcClient.CallCtx(ctx, "getTorrentById", [2]string{c.APIKey, torrentID})
|
||||
res, err := c.rpcClient.CallCtx(ctx, "getTorrentById", [3]interface{}{c.APIKey, torrentID, freeleechToken})
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "call getTorrentById failed")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue