R-1292: qBittorrent's 50 % rule owns the NORMAL limit only (up_limit through app/preferences), never the current speed mode's slot. Test with the alternative mode on, red-proved. Commit only.
gates / gates (push) Successful in 1m32s

This commit is contained in:
admin committed 2026-10-26 13:01:31 +01:00
1 parent 3d711ee611
commit 26191911c4
7 files changed
+107 -8

No files matched your search

+11
View File
@@ -338,6 +338,17 @@ func (q *QBittorrent) WriteLimit(ctx context.Context, l HeldLimit) (HeldLimit, e
return q.readSlot(ctx, h, l.Alt)
}
// NormalLimit / SetNormalLimit are the 50 % rule's side (R-1292): the NORMAL slot (`up_limit`) whatever the mode.
func (q *QBittorrent) NormalLimit(ctx context.Context) (int64, error) {
l, err := q.ReadLimitLike(ctx, HeldLimit{Alt: false})
return l.Bytes, err
}
func (q *QBittorrent) SetNormalLimit(ctx context.Context, bytesPerSec int64) (int64, error) {
l, err := q.WriteLimit(ctx, HeldLimit{Bytes: bytesPerSec, Alt: false})
return l.Bytes, err
}
// HoldValue: 1 KiB/s in the slot that applied when the hold began.
func (q *QBittorrent) HoldValue(prev HeldLimit) HeldLimit {
return HeldLimit{Bytes: 1024, Alt: prev.Alt}