mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(clients): add support for qBittorrent 4.4.0+ (#558)
* refactor: move client to go-qbittorrent * refactor: move client to go-qbittorrent * feat(downloadclient): cache qbittorrent client * feat(downloadclient): update qbit * feat(downloadclient): client test and remove pkg qbit * feat(downloadclient): update pkg qbit * fix(release): method * feat(release): make GetCachedClient concurrent safe * feat(release): add additional tests for buildLegacyHost * feat(release): remove branching * chore: update pkg autobrr/go-qbittorrent to v.1.2.0
This commit is contained in:
parent
6ad4abe296
commit
29da2416ec
17 changed files with 379 additions and 1764 deletions
|
@ -273,7 +273,15 @@ func (r *Release) ParseSizeBytesString(size string) {
|
|||
r.Size = s
|
||||
}
|
||||
|
||||
func (r *Release) DownloadTorrentFileCtx(ctx context.Context) error {
|
||||
return r.downloadTorrentFile(ctx)
|
||||
}
|
||||
|
||||
func (r *Release) DownloadTorrentFile() error {
|
||||
return r.downloadTorrentFile(context.Background())
|
||||
}
|
||||
|
||||
func (r *Release) downloadTorrentFile(ctx context.Context) error {
|
||||
if r.TorrentURL == "" {
|
||||
return errors.New("download_file: url can't be empty")
|
||||
} else if r.TorrentTmpFile != "" {
|
||||
|
@ -294,7 +302,7 @@ func (r *Release) DownloadTorrentFile() error {
|
|||
Timeout: time.Second * 45,
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodGet, r.TorrentURL, nil)
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, r.TorrentURL, nil)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "error downloading file")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue