Adds additional config for resuming torrents #175

that were previously marked as noHL
This commit is contained in:
bobokun 2022-10-29 15:02:05 -04:00
parent 218ca69371
commit e86c775776
No known key found for this signature in database
GPG key ID: B73932169607D927
3 changed files with 14 additions and 2 deletions

View file

@ -151,7 +151,8 @@ nohardlinks:
# <OPTIONAL> min seeding time var: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (min).
# Delete this key from a category's config to use the tracker's configured min_seeding_time. Will default to 0 if not specified for the category or tracker.
min_seeding_time: 43200
# <OPTIONAL> resume_torrent_after_untagging_noHL var: If a torrent was previously tagged as NoHL and now has hardlinks, this variable will resume your torrent after restoring original share limits
resume_torrent_after_untagging_noHL: false
# Can have additional categories set with separate ratio/seeding times defined.
series-completed:
# <OPTIONAL> exclude_tags var: Will exclude the following tags when searching through the category.
@ -168,6 +169,8 @@ nohardlinks:
limit_upload_speed:
# <OPTIONAL> min seeding time var: Will prevent torrent deletion by cleanup variable if torrent has not yet minimum seeding time (min).
# min_seeding_time: # Not specified for this category; tracker's value will be used. Will default to 0 if not specified for the category or tracker.
# <OPTIONAL> resume_torrent_after_untagging_noHL var: If a torrent was previously tagged as NoHL and now has hardlinks, this variable will resume your torrent after restoring original share limits
resume_torrent_after_untagging_noHL: false
recyclebin:
# Recycle Bin method of deletion will move files into the recycle bin (Located in /root_dir/.RecycleBin) instead of directly deleting them in qbit

View file

@ -291,6 +291,15 @@ class Config:
default_is_none=True,
do_print=False,
)
self.nohardlinks[cat]["resume_torrent_after_untagging_noHL"] = self.util.check_for_attribute(
self.data,
"resume_torrent_after_untagging_noHL",
parent="nohardlinks",
subparent=cat,
var_type="bool",
default=True,
do_print=False,
)
else:
e = f"Config Error: Category {cat} is defined under nohardlinks attribute "
"but is not defined in the cat attribute."

View file

@ -475,7 +475,7 @@ class Qbt:
torrent, restore_max_ratio, restore_max_seeding_time, restore_limit_upload_speed, restore=True
)
)
if torrent.state == "pausedUP":
if torrent.state == "pausedUP" and nohardlinks[category]["resume_torrent_after_untagging_noHL"]:
torrent.resume()
attr = {
"function": "untag_nohardlinks",