mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2024-11-10 17:47:13 +08:00
(fix) qbit nohardlinks ratio/seed time if tracker not set
(fix) not falling back to default for nohardlinks goals if not set Fixes #255
This commit is contained in:
parent
62a7c5327a
commit
32f2da75c9
1 changed files with 9 additions and 4 deletions
|
@ -547,22 +547,26 @@ class Qbt:
|
|||
# If neither set, use 0 (no limit)
|
||||
min_seeding_time = 0
|
||||
if (
|
||||
tracker["min_seeding_time"]
|
||||
tracker["min_seeding_time"] is not None
|
||||
and tracker["min_seeding_time"] >= nohardlinks[category]["min_seeding_time"]
|
||||
):
|
||||
min_seeding_time = tracker["min_seeding_time"]
|
||||
elif nohardlinks[category]["min_seeding_time"]:
|
||||
min_seeding_time = nohardlinks[category]["min_seeding_time"]
|
||||
else:
|
||||
min_seeding_time = min_seeding_time
|
||||
# Determine max_ratio.
|
||||
# If only tracker setting is set, use tracker's max_ratio
|
||||
# If only nohardlinks category setting is set, use nohardlinks category's max_ratio
|
||||
# If both tracker and nohardlinks category setting is set, use the larger of the two
|
||||
# If neither set, use -1 (no limit)
|
||||
max_ratio = -1
|
||||
if tracker["max_ratio"] and tracker["max_ratio"] >= nohardlinks[category]["max_ratio"]:
|
||||
if tracker["max_ratio"] is not None and tracker["max_ratio"] >= nohardlinks[category]["max_ratio"]:
|
||||
max_ratio = tracker["max_ratio"]
|
||||
elif nohardlinks[category]["max_ratio"]:
|
||||
max_ratio = nohardlinks[category]["max_ratio"]
|
||||
else:
|
||||
max_ratio = max_ratio
|
||||
# Determine max_seeding_time.
|
||||
# If only tracker setting is set, use tracker's max_seeding_time
|
||||
# If only nohardlinks category setting is set, use nohardlinks category's max_seeding_time
|
||||
|
@ -570,13 +574,14 @@ class Qbt:
|
|||
# If neither set, use -1 (no limit)
|
||||
max_seeding_time = -1
|
||||
if (
|
||||
tracker["max_seeding_time"]
|
||||
tracker["max_seeding_time"] is not None
|
||||
and tracker["max_seeding_time"] >= nohardlinks[category]["max_seeding_time"]
|
||||
):
|
||||
max_seeding_time = tracker["max_seeding_time"]
|
||||
elif nohardlinks[category]["max_seeding_time"]:
|
||||
max_seeding_time = nohardlinks[category]["max_seeding_time"]
|
||||
|
||||
else:
|
||||
max_seeding_time = max_seeding_time
|
||||
# Will only tag new torrents that don't have nohardlinks_tag tag
|
||||
if self.config.nohardlinks_tag not in torrent.tags:
|
||||
add_tag_no_hl(add_tag=True)
|
||||
|
|
Loading…
Reference in a new issue