Skip to content

Commit

Permalink
2.1.6 (#40)
Browse files Browse the repository at this point in the history
* Fixes #32 with #33
* Fixes `BT_Backup` -> `BT_backup` in docs and strings.
  • Loading branch information
jslay88 authored Apr 15, 2022
1 parent 33ac07d commit 98caa3b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ Run the script and follow prompts or use CLI arguments with command `qbt_migrate
-t {Windows,Linux,Mac}, --target-os {Windows,Linux,Mac}
Target OS (converts slashes). Default will auto-detect if conversion is needed based on existing vs new.
-b BT_BACKUP_PATH, --bt-backup-path BT_BACKUP_PATH
BT_Backup Path Override.
BT_backup Path Override.
-s, --skip-bad-files Skips bad .fastresume files instead of exiting. Default behavior is to exit.
-l {DEBUG,INFO}, --log-level {DEBUG,INFO}
Log Level, Default is INFO.

By default, everything happens in the BT_Backup directory defined by the OS the script is running on.
By default, everything happens in the BT_backup directory defined by the OS the script is running on.
Override `BT_backup` path if needed.

Default BT_Backup paths:
Default BT_backup paths:
* Windows: `%LOCALAPPDATA%/qBittorrent/BT_backup`
* Linux/Mac: `$HOME/.local/share/data/qBittorrent/BT_backup`

Expand All @@ -59,25 +59,25 @@ The correct pattern for this would be `-e X: -n /torrents` or `-e X:\ -n /torren

#### Docker
You can also run this tool with Docker if you don't have Python, or don't want to install the package to your system directly.
The BT_Backup path is automatically overridden to `/tmp/BT_Backup`, so mount your `BT_Backup` there.
The BT_backup path is automatically overridden to `/tmp/BT_backup`, so mount your `BT_backup` there.

**NOTE:** When running `qbt_migrate` Docker image on a Linux/Mac machine, Windows paths will require double `\`. Ex. `C:\\Users\\user\\Downloads\\Torrents`

**The Docker image has all functionality as the pip install, following the same arguments/patterns listed in the above examples.**

For example, mounting in the default BT_Backup path on a Windows machine running Docker
For example, mounting in the default BT_backup path on a Windows machine running Docker

docker run -v %LOCALAPPDATA%/qBittorrent/BT_backup:/tmp/BT_backup jslay88/qbt_migrate -e X:\ -n Z:\ # Windows to Windows (Drive letter change)
docker run -v %LOCALAPPDATA%/qBittorrent/BT_backup:/tmp/BT_backup jslay88/qbt_migrate -e X:\Torrents -n X:\NewDir\Torrents -t Windows # Windows to Windows (Directory Change)
...

Mounting in the default BT_Backup path on a Linux/Mac machine running Docker
Mounting in the default BT_backup path on a Linux/Mac machine running Docker

docker run -v $HOME/.local/share/data/qBittorrent/BT_backup:/tmp/BT_backup jslay88/qbt_migrate -e X:\ -n Z:\ # Windows to Windows (Drive letter change)
docker run -v $HOME/.local/share/data/qBittorrent/BT_backup:/tmp/BT_backup jslay88/qbt_migrate -e X:\Torrents -n X:\NewDir\Torrents -t Windows # Windows to Windows (Directory Change)
...

If for some reason you wanted to override BT_Backup path from `/tmp/BT_Backup` within the container, simply set
If for some reason you wanted to override BT_backup path from `/tmp/BT_backup` within the container, simply set
environment variable `BT_BACKUP_PATH` on the container to where you will be mounting in.

**The `-e` for environment variable override must go before the image `jslay88/qbt_migrate` as the `-e` after the image is for `--existing-path`**
Expand All @@ -88,7 +88,7 @@ environment variable `BT_BACKUP_PATH` on the container to where you will be moun
You can also clone this repository, build the image, and run your own built image

docker build . -t qbt_migrate
docker run -v %LOCALAPPDATA%/qBittorrent/BT_Backup:/tmp/BT_backup qbt_migrate -e X:\ -n Z:\ # Windows to Windows (Drive letter change)
docker run -v %LOCALAPPDATA%/qBittorrent/BT_backup:/tmp/BT_backup qbt_migrate -e X:\ -n Z:\ # Windows to Windows (Drive letter change)
...


Expand Down
2 changes: 1 addition & 1 deletion qbt_migrate/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def run(
:type new_path: str
:param target_os: If targeting a different OS than the source. Must be Windows, Linux, or Mac.
:type target_os: str
:param create_backup: Create a backup archive of the BT_Backup directory?
:param create_backup: Create a backup archive of the BT_backup directory?
:type create_backup: bool
:param skip_bad_files: Skip .fastresume files that cannot be read successfully.
:type skip_bad_files: bool
Expand Down
4 changes: 2 additions & 2 deletions qbt_migrate/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parse_args():
choices=["Windows", "Linux", "Mac"],
)
parser.add_argument(
"-b", "--bt-backup-path", help="BT_Backup Path Override. " f"Default is {discover_bt_backup_path()}"
"-b", "--bt-backup-path", help="BT_backup Path Override. " f"Default is {discover_bt_backup_path()}"
)
parser.add_argument(
"-s",
Expand All @@ -47,7 +47,7 @@ def main():
if args.bt_backup_path is not None:
qbm.bt_backup_path = args.bt_backup_path
else:
bt_backup_path = input(f"BT_Backup Path {qbm.bt_backup_path}: ")
bt_backup_path = input(f"BT_backup Path {qbm.bt_backup_path}: ")
if bt_backup_path.strip():
qbm.bt_backup_path = bt_backup_path
if args.existing_path is None:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name="qbt_migrate",
version="2.1.5",
version="2.1.6",
packages=find_packages(),
install_requires=dependencies,
description="Migrate qBittorrent FastResume files.",
Expand Down

0 comments on commit 98caa3b

Please sign in to comment.