Skip to content

Commit b937677

Browse files
committed
torrents-start: move qbt pref defaults to /home/xk/bin/qbt_set_defaults.py
1 parent cbac4a6 commit b937677

File tree

1 file changed

+1
-29
lines changed

1 file changed

+1
-29
lines changed

library/mediafiles/torrents_start.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,14 @@
55

66
from library import usage
77
from library.createdb.torrents_add import get_tracker
8-
from library.utils import arggroups, argparse_utils, nums, processes
8+
from library.utils import arggroups, argparse_utils, processes
99
from library.utils.file_utils import trash
1010
from library.utils.log_utils import log
1111

1212

1313
def parse_args():
1414
parser = argparse_utils.ArgumentParser(usage=usage.torrents_start)
1515
arggroups.qBittorrent(parser)
16-
parser.add_argument(
17-
"--dl-limit",
18-
"--download-limit",
19-
type=nums.human_to_bytes,
20-
help="Download limit. If set then a few additional global preferences will also be changed",
21-
)
22-
parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=nums.human_to_bytes, help="Upload limit")
2316

2417
arggroups.capability_delete(parser)
2518
arggroups.debug(parser)
@@ -104,27 +97,6 @@ def torrents_start():
10497

10598
qbt_client = start_qBittorrent(args)
10699

107-
if args.dl_limit: # type: ignore
108-
current_count = qbt_client.torrents_count()
109-
max_active_uploads = current_count + 5000
110-
111-
qbt_client.app_set_preferences(
112-
{
113-
"preallocate_all": True,
114-
"add_stopped_enabled": False,
115-
"dl_limit": args.dl_limit,
116-
"up_limit": args.up_limit,
117-
"max_active_downloads": 1,
118-
"max_active_uploads": max_active_uploads,
119-
"max_active_torrents": max_active_uploads + 1,
120-
"max_active_checking_torrents": 3,
121-
"slow_torrent_inactive_timer": 80,
122-
# divide by 10 but also some bps -> kbps BS
123-
"slow_torrent_dl_rate_threshold": (args.dl_limit) // 10_000, # type: ignore
124-
"slow_torrent_ul_rate_threshold": (args.up_limit or args.dl_limit) // 10_000, # type: ignore
125-
}
126-
)
127-
128100
if args.temp_drive and Path(args.temp_drive).is_absolute():
129101
temp_prefix = Path(args.temp_drive)
130102
else:

0 commit comments

Comments
 (0)