mirror of
https://github.com/StuffAnThings/qbit_manage.git
synced 2025-11-12 09:20:35 +08:00
Merge pull request #256 from bakerboy448/fix-maxratio
qbit nohardlinks fixes
This commit is contained in:
commit
e6b3642a72
3 changed files with 5 additions and 6 deletions
|
|
@ -41,7 +41,7 @@ repos:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py3-plus]
|
args: [--py3-plus]
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black
|
||||||
rev: 23.1.0
|
rev: 23.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
language_version: python3
|
language_version: python3
|
||||||
|
|
|
||||||
2
VERSION
2
VERSION
|
|
@ -1 +1 @@
|
||||||
3.5.0
|
3.5.1
|
||||||
|
|
|
||||||
|
|
@ -547,7 +547,7 @@ class Qbt:
|
||||||
# If neither set, use 0 (no limit)
|
# If neither set, use 0 (no limit)
|
||||||
min_seeding_time = 0
|
min_seeding_time = 0
|
||||||
if (
|
if (
|
||||||
tracker["min_seeding_time"]
|
tracker["min_seeding_time"] is not None
|
||||||
and tracker["min_seeding_time"] >= nohardlinks[category]["min_seeding_time"]
|
and tracker["min_seeding_time"] >= nohardlinks[category]["min_seeding_time"]
|
||||||
):
|
):
|
||||||
min_seeding_time = tracker["min_seeding_time"]
|
min_seeding_time = tracker["min_seeding_time"]
|
||||||
|
|
@ -559,7 +559,7 @@ class Qbt:
|
||||||
# If both tracker and nohardlinks category setting is set, use the larger of the two
|
# If both tracker and nohardlinks category setting is set, use the larger of the two
|
||||||
# If neither set, use -1 (no limit)
|
# If neither set, use -1 (no limit)
|
||||||
max_ratio = -1
|
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"]
|
max_ratio = tracker["max_ratio"]
|
||||||
elif nohardlinks[category]["max_ratio"]:
|
elif nohardlinks[category]["max_ratio"]:
|
||||||
max_ratio = nohardlinks[category]["max_ratio"]
|
max_ratio = nohardlinks[category]["max_ratio"]
|
||||||
|
|
@ -570,13 +570,12 @@ class Qbt:
|
||||||
# If neither set, use -1 (no limit)
|
# If neither set, use -1 (no limit)
|
||||||
max_seeding_time = -1
|
max_seeding_time = -1
|
||||||
if (
|
if (
|
||||||
tracker["max_seeding_time"]
|
tracker["max_seeding_time"] is not None
|
||||||
and tracker["max_seeding_time"] >= nohardlinks[category]["max_seeding_time"]
|
and tracker["max_seeding_time"] >= nohardlinks[category]["max_seeding_time"]
|
||||||
):
|
):
|
||||||
max_seeding_time = tracker["max_seeding_time"]
|
max_seeding_time = tracker["max_seeding_time"]
|
||||||
elif nohardlinks[category]["max_seeding_time"]:
|
elif nohardlinks[category]["max_seeding_time"]:
|
||||||
max_seeding_time = nohardlinks[category]["max_seeding_time"]
|
max_seeding_time = nohardlinks[category]["max_seeding_time"]
|
||||||
|
|
||||||
# Will only tag new torrents that don't have nohardlinks_tag tag
|
# Will only tag new torrents that don't have nohardlinks_tag tag
|
||||||
if self.config.nohardlinks_tag not in torrent.tags:
|
if self.config.nohardlinks_tag not in torrent.tags:
|
||||||
add_tag_no_hl(add_tag=True)
|
add_tag_no_hl(add_tag=True)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue