mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +00:00
fix(qbittorrent): remove client cache (#357)
* fix(qbittorrent): permit multiple uploads again * fix(qbittorrent): remove client cache
This commit is contained in:
parent
a63e022c15
commit
dfe2ac56a2
3 changed files with 40 additions and 59 deletions
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
// Login https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#authentication
|
||||
func (c *client) Login() error {
|
||||
func (c *Client) Login() error {
|
||||
opts := map[string]string{
|
||||
"username": c.settings.Username,
|
||||
"password": c.settings.Password,
|
||||
|
@ -55,7 +55,7 @@ func (c *client) Login() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *client) GetTorrents() ([]Torrent, error) {
|
||||
func (c *Client) GetTorrents() ([]Torrent, error) {
|
||||
|
||||
resp, err := c.get("torrents/info", nil)
|
||||
if err != nil {
|
||||
|
@ -78,7 +78,7 @@ func (c *client) GetTorrents() ([]Torrent, error) {
|
|||
return torrents, nil
|
||||
}
|
||||
|
||||
func (c *client) GetTorrentsFilter(filter TorrentFilter) ([]Torrent, error) {
|
||||
func (c *Client) GetTorrentsFilter(filter TorrentFilter) ([]Torrent, error) {
|
||||
opts := map[string]string{
|
||||
"filter": string(filter),
|
||||
}
|
||||
|
@ -104,7 +104,7 @@ func (c *client) GetTorrentsFilter(filter TorrentFilter) ([]Torrent, error) {
|
|||
return torrents, nil
|
||||
}
|
||||
|
||||
func (c *client) GetTorrentsActiveDownloads() ([]Torrent, error) {
|
||||
func (c *Client) GetTorrentsActiveDownloads() ([]Torrent, error) {
|
||||
var filter = TorrentFilterDownloading
|
||||
|
||||
opts := map[string]string{
|
||||
|
@ -141,7 +141,7 @@ func (c *client) GetTorrentsActiveDownloads() ([]Torrent, error) {
|
|||
return res, nil
|
||||
}
|
||||
|
||||
func (c *client) GetTorrentsRaw() (string, error) {
|
||||
func (c *Client) GetTorrentsRaw() (string, error) {
|
||||
resp, err := c.get("torrents/info", nil)
|
||||
if err != nil {
|
||||
return "", errors.Wrap(err, "could not get torrents raw")
|
||||
|
@ -157,7 +157,7 @@ func (c *client) GetTorrentsRaw() (string, error) {
|
|||
return string(data), nil
|
||||
}
|
||||
|
||||
func (c *client) GetTorrentTrackers(hash string) ([]TorrentTracker, error) {
|
||||
func (c *Client) GetTorrentTrackers(hash string) ([]TorrentTracker, error) {
|
||||
opts := map[string]string{
|
||||
"hash": hash,
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ func (c *client) GetTorrentTrackers(hash string) ([]TorrentTracker, error) {
|
|||
}
|
||||
|
||||
// AddTorrentFromFile add new torrent from torrent file
|
||||
func (c *client) AddTorrentFromFile(file string, options map[string]string) error {
|
||||
func (c *Client) AddTorrentFromFile(file string, options map[string]string) error {
|
||||
|
||||
res, err := c.postFile("torrents/add", file, options)
|
||||
if err != nil {
|
||||
|
@ -214,7 +214,7 @@ func (c *client) AddTorrentFromFile(file string, options map[string]string) erro
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *client) DeleteTorrents(hashes []string, deleteFiles bool) error {
|
||||
func (c *Client) DeleteTorrents(hashes []string, deleteFiles bool) error {
|
||||
// Add hashes together with | separator
|
||||
hv := strings.Join(hashes, "|")
|
||||
|
||||
|
@ -235,7 +235,7 @@ func (c *client) DeleteTorrents(hashes []string, deleteFiles bool) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *client) ReAnnounceTorrents(hashes []string) error {
|
||||
func (c *Client) ReAnnounceTorrents(hashes []string) error {
|
||||
// Add hashes together with | separator
|
||||
hv := strings.Join(hashes, "|")
|
||||
opts := map[string]string{
|
||||
|
@ -254,7 +254,7 @@ func (c *client) ReAnnounceTorrents(hashes []string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (c *client) GetTransferInfo() (*TransferInfo, error) {
|
||||
func (c *Client) GetTransferInfo() (*TransferInfo, error) {
|
||||
resp, err := c.get("transfer/info", nil)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "could not get transfer info")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue