Skip to content

Commit

Permalink
fix download limit passing
Browse files Browse the repository at this point in the history
  • Loading branch information
chapmanjacobd committed Dec 10, 2024
1 parent 4551a8e commit fe8a0ee
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
10 changes: 9 additions & 1 deletion xklb/mediafiles/torrents_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,22 @@

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


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)

Expand Down
10 changes: 10 additions & 0 deletions xklb/multidb/allocate_torrents.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
strings,
)
from xklb.utils.file_utils import trash
from xklb.utils.log_utils import log


def parse_args():
Expand All @@ -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")
Expand Down Expand Up @@ -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)
8 changes: 0 additions & 8 deletions xklb/utils/arggroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit fe8a0ee

Please sign in to comment.