From fe8a0ee0da2777af3818467589b68b7f6ec422b4 Mon Sep 17 00:00:00 2001 From: Jacob Chapman <7908073+chapmanjacobd@users.noreply.github.com> Date: Tue, 10 Dec 2024 02:14:24 +0000 Subject: [PATCH] fix download limit passing --- xklb/mediafiles/torrents_start.py | 10 +++++++++- xklb/multidb/allocate_torrents.py | 10 ++++++++++ xklb/utils/arggroups.py | 8 -------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/xklb/mediafiles/torrents_start.py b/xklb/mediafiles/torrents_start.py index 30de7463..54c62a96 100644 --- a/xklb/mediafiles/torrents_start.py +++ b/xklb/mediafiles/torrents_start.py @@ -5,7 +5,7 @@ from xklb import usage from xklb.createdb.torrents_add import get_tracker -from xklb.utils import arggroups, argparse_utils, processes +from xklb.utils import arggroups, argparse_utils, nums, processes from xklb.utils.file_utils import trash from xklb.utils.log_utils import log @@ -13,6 +13,14 @@ def parse_args(): parser = argparse_utils.ArgumentParser(usage=usage.torrents_start) arggroups.qBittorrent(parser) + parser.add_argument( + "--dl-limit", + "--download-limit", + type=nums.human_to_bytes, + help="Download limit. If set then a few additional global preferences will also be changed", + ) + parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=nums.human_to_bytes, help="Upload limit") + arggroups.capability_delete(parser) arggroups.debug(parser) diff --git a/xklb/multidb/allocate_torrents.py b/xklb/multidb/allocate_torrents.py index dd4d1f5b..f68ba46c 100644 --- a/xklb/multidb/allocate_torrents.py +++ b/xklb/multidb/allocate_torrents.py @@ -20,6 +20,7 @@ strings, ) from xklb.utils.file_utils import trash +from xklb.utils.log_utils import log def parse_args(): @@ -33,6 +34,14 @@ def parse_args(): parser.add_argument("--max-io-rate", type=nums.human_to_bytes, default="100MiB", help="Skip disks that are busy") arggroups.qBittorrent(parser) + parser.add_argument( + "--dl-limit", + "--download-limit", + type=str, + help="Download limit. If set then a few additional global preferences will also be changed", + ) + parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=str, help="Upload limit") + arggroups.debug(parser) parser.add_argument("computer_database") @@ -179,4 +188,5 @@ def allocate_torrents(): if args.delete_torrent: for path in torrent_files: + log.debug("Trashed %s", path) trash(args, path, detach=False) diff --git a/xklb/utils/arggroups.py b/xklb/utils/arggroups.py index 2a57f522..6b6a24e9 100644 --- a/xklb/utils/arggroups.py +++ b/xklb/utils/arggroups.py @@ -1976,14 +1976,6 @@ def qBittorrent(parent_parser): parser.add_argument("--username", help="qBittorrent WebUI username") parser.add_argument("--password", help="qBittorrent WebUI password") - parser.add_argument( - "--dl-limit", - "--download-limit", - type=nums.human_to_bytes, - help="Download limit. If set then a few additional global preferences will also be changed", - ) - parser.add_argument("--up-limit", "--ul-limit", "--upload-limit", type=nums.human_to_bytes, help="Upload limit") - parser.add_argument("--download-drive", "--prefix", default=str(Path.cwd()), help="Download drive") parser.add_argument("--download-prefix", default="seeding", help="Download root") parser.add_argument("--temp-drive", help="Temporary download drive")