fix(actions): qBit handle Ignore slow torrents rule correctly when disabled (#1309)

* fix(qbittorrent): handle 'Ignore slow torrents' rule correctly when disabled

* move IgnoreSlowTorrents bool check
This commit is contained in:
soup 2023-12-17 22:46:44 +01:00 committed by GitHub
parent 6e12654f6a
commit 80c2530116
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -167,7 +167,7 @@ func (s *service) qbittorrentCheckRulesCanDownload(ctx context.Context, action *
return []string{rejection}, nil return []string{rejection}, nil
} }
if rules.IgnoreSlowTorrentsCondition == domain.IgnoreSlowTorrentsModeMaxReached { if rules.IgnoreSlowTorrents && rules.IgnoreSlowTorrentsCondition == domain.IgnoreSlowTorrentsModeMaxReached {
// get transfer info // get transfer info
info, err := qbt.GetTransferInfoCtx(ctx) info, err := qbt.GetTransferInfoCtx(ctx)
if err != nil { if err != nil {
@ -189,7 +189,7 @@ func (s *service) qbittorrentCheckRulesCanDownload(ctx context.Context, action *
} }
// if max active downloads is unlimited or not reached, lets check if ignore slow always should be checked // if max active downloads is unlimited or not reached, lets check if ignore slow always should be checked
if rules.IgnoreSlowTorrentsCondition == domain.IgnoreSlowTorrentsModeAlways { if rules.IgnoreSlowTorrents && rules.IgnoreSlowTorrentsCondition == domain.IgnoreSlowTorrentsModeAlways {
// get transfer info // get transfer info
info, err := qbt.GetTransferInfoCtx(ctx) info, err := qbt.GetTransferInfoCtx(ctx)
if err != nil { if err != nil {