mirror of
https://github.com/idanoo/autobrr
synced 2025-07-25 17:59:14 +00:00
feat(qbit): implement errored filter (#447)
* feat(qbit): implement errored * well, evidently there's some crashes. * fix(qbit): contentlayout. reported by Vyerni a couple minutes ago * fix(clients): qbit contentLayout
This commit is contained in:
parent
5a7614f954
commit
c1d2697e18
2 changed files with 47 additions and 41 deletions
|
@ -176,6 +176,9 @@ const (
|
|||
|
||||
// Torrent is being downloaded, but no connection were made
|
||||
TorrentFilterStalledDownloading TorrentFilter = "stalled_downloading"
|
||||
|
||||
// Torrent is errored
|
||||
TorrentFilterError TorrentFilter = "errored"
|
||||
)
|
||||
|
||||
// TrackerStatus https://github.com/qbittorrent/qBittorrent/wiki/WebUI-API-(qBittorrent-4.1)#get-torrent-trackers
|
||||
|
@ -239,10 +242,11 @@ type TransferInfo struct {
|
|||
|
||||
type ContentLayout string
|
||||
|
||||
// https://www.youtube.com/watch?v=4N1iwQxiHrs
|
||||
const (
|
||||
ContentLayoutOriginal ContentLayout = "ORIGINAL"
|
||||
ContentLayoutSubfolderNone ContentLayout = "SUBFOLDER_NONE"
|
||||
ContentLayoutSubfolderCreate ContentLayout = "SUBFOLDER_CREATE"
|
||||
ContentLayoutOriginal ContentLayout = "Original"
|
||||
ContentLayoutSubfolderNone ContentLayout = "NoSubfolder"
|
||||
ContentLayoutSubfolderCreate ContentLayout = "Subfolder"
|
||||
)
|
||||
|
||||
type TorrentAddOptions struct {
|
||||
|
@ -270,9 +274,18 @@ func (o *TorrentAddOptions) Prepare() map[string]string {
|
|||
}
|
||||
if o.ContentLayout != nil {
|
||||
if *o.ContentLayout == ContentLayoutSubfolderCreate {
|
||||
// pre qBittorrent version 4.3.2
|
||||
options["root_folder"] = "true"
|
||||
|
||||
// post version 4.3.2
|
||||
options["contentLayout"] = string(ContentLayoutSubfolderCreate)
|
||||
|
||||
} else if *o.ContentLayout == ContentLayoutSubfolderNone {
|
||||
// pre qBittorrent version 4.3.2
|
||||
options["root_folder"] = "false"
|
||||
|
||||
// post version 4.3.2
|
||||
options["contentLayout"] = string(ContentLayoutSubfolderNone)
|
||||
}
|
||||
// if ORIGINAL then leave empty
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue