feat(downloadclients): qBit rules add speed threshold condition (#652)

* fix: qbit add rules min check

* feat(downloadclients): add check condition

* feat(downloadclient): return on rejection
This commit is contained in:
ze0s 2023-01-17 23:34:03 +01:00 committed by GitHub
parent 4ae2773dc9
commit a6c1944df8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 194 additions and 34 deletions

View file

@ -44,11 +44,12 @@ type DownloadClientSettings struct {
}
type DownloadClientRules struct {
Enabled bool `json:"enabled"`
MaxActiveDownloads int `json:"max_active_downloads"`
IgnoreSlowTorrents bool `json:"ignore_slow_torrents"`
DownloadSpeedThreshold int64 `json:"download_speed_threshold"`
UploadSpeedThreshold int64 `json:"upload_speed_threshold"`
Enabled bool `json:"enabled"`
MaxActiveDownloads int `json:"max_active_downloads"`
IgnoreSlowTorrents bool `json:"ignore_slow_torrents"`
IgnoreSlowTorrentsCondition IgnoreSlowTorrentsCondition `json:"ignore_slow_torrents_condition,omitempty"`
DownloadSpeedThreshold int64 `json:"download_speed_threshold"`
UploadSpeedThreshold int64 `json:"upload_speed_threshold"`
}
type BasicAuth struct {
@ -57,6 +58,13 @@ type BasicAuth struct {
Password string `json:"password,omitempty"`
}
type IgnoreSlowTorrentsCondition string
const (
IgnoreSlowTorrentsModeAlways IgnoreSlowTorrentsCondition = "ALWAYS"
IgnoreSlowTorrentsModeMaxReached IgnoreSlowTorrentsCondition = "MAX_DOWNLOADS_REACHED"
)
type DownloadClientType string
const (