mirror of
https://github.com/idanoo/autobrr
synced 2025-07-24 01:09:13 +00:00
fix(downloadclients): arrs change size type to uint64 (#1744)
* fix(downloadclients): arrs change size type to uint64 * fix(downloadclients): check resp.Body
This commit is contained in:
parent
e9726363b4
commit
bf7e1381ac
15 changed files with 98 additions and 10 deletions
|
@ -16,6 +16,10 @@ import (
|
|||
|
||||
func (c *client) get(ctx context.Context, endpoint string) (*http.Response, error) {
|
||||
u, err := url.Parse(c.config.Hostname)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not parse url: %s", c.config.Hostname)
|
||||
}
|
||||
|
||||
u.Path = path.Join(u.Path, "/api/v3/", endpoint)
|
||||
reqUrl := u.String()
|
||||
|
||||
|
@ -45,6 +49,10 @@ func (c *client) get(ctx context.Context, endpoint string) (*http.Response, erro
|
|||
|
||||
func (c *client) post(ctx context.Context, endpoint string, data interface{}) (*http.Response, error) {
|
||||
u, err := url.Parse(c.config.Hostname)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not parse url: %s", c.config.Hostname)
|
||||
}
|
||||
|
||||
u.Path = path.Join(u.Path, "/api/v3/", endpoint)
|
||||
reqUrl := u.String()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue