Skip to content

Commit

Permalink
Merge pull request #310 from StuffAnThings/develop
Browse files Browse the repository at this point in the history
3.6.4
  • Loading branch information
bobokun authored May 28, 2023
2 parents a1a67d2 + e94fd12 commit 1a5f8b2
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/dependabot-approve-and-auto-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
# will not occur.
- name: Dependabot metadata
id: dependabot-metadata
uses: dependabot/fetch-metadata@v1.5.0
uses: dependabot/fetch-metadata@v1.5.1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
# Here the PR gets approved.
Expand Down
20 changes: 4 additions & 16 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
# Requirements Updated
- pre-commit updated to 3.3.3
- requests updated to 2.31.0
- ruamel.yaml updated to 0.17.26
- Adds new dependency bencodepy to generate hash for cross-seed
- Adds new dependency GitPython for checking git branches
- Updates ruamel.yaml to 0.17.27

# Bug Fixes
- Changes HardLink Logic (Thanks to @ColinHebert for the suggestion) Fixes #291
- Additional error checking (Fixes #282)
- Fixes #287 (Thanks to @buthed010203 #290)
- Fixes Remove Orphan crashing when multiprocessing (Thanks to @buthed010203 #289)
- Speed optimization for Remove Orphan (Thanks to @buthed010203 #299)
- Fixes Remove Orphan from crashing in Windows (Fixes #275)
- Fixes #292
- Fixes #201
- Fixes #279
- Updates Dockerfile to debloat and move to Python 3.11
- Fixes #302
- Adds a way to bypass qbt version check (unsupported - Thanks to @ftc2 #307)

**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v3.6.2...v3.6.3
**Full Changelog**: https://github.com/StuffAnThings/qbit_manage/compare/v3.6.3...v3.6.4
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.6.3
3.6.4
2 changes: 2 additions & 0 deletions modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"rem_orphaned",
"tag_nohardlinks",
"skip_cleanup",
"skip_qb_version_check",
"dry_run",
]

Expand Down Expand Up @@ -82,6 +83,7 @@ def __init__(self, default_dir, args):
logger.debug(f" --rem-orphaned (QBT_REM_ORPHANED): {self.commands['rem_orphaned']}")
logger.debug(f" --tag-nohardlinks (QBT_TAG_NOHARDLINKS): {self.commands['tag_nohardlinks']}")
logger.debug(f" --skip-cleanup (QBT_SKIP_CLEANUP): {self.commands['skip_cleanup']}")
logger.debug(f" --skip-qb-version-check (QBT_SKIP_QB_VERSION_CHECK): {self.commands['skip_qb_version_check']}")
logger.debug(f" --dry-run (QBT_DRY_RUN): {self.commands['dry_run']}")
else:
self.commands = args
Expand Down
11 changes: 8 additions & 3 deletions modules/qbittorrent.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,24 @@ def __init__(self, config, params):
f"Qbittorrent Error: qbit_manage is only compatible with {self.MIN_SUPPORTED_VERSION} or higher. "
f"You are currently on {self.current_version}."
+ "\n"
+ f"Please upgrade to your Qbittorrent version to {self.MIN_SUPPORTED_VERSION} or higher to use qbit_manage."
+ f"Please upgrade your qBittorrent version to {self.MIN_SUPPORTED_VERSION} or higher to use qbit_manage."
)
elif not Version.is_app_version_supported(self.current_version):
ex = (
f"Qbittorrent Error: qbit_manage is only compatible with {self.SUPPORTED_VERSION} or lower. "
f"You are currently on {self.current_version}."
+ "\n"
+ f"Please downgrade to your Qbittorrent version to {self.SUPPORTED_VERSION} to use qbit_manage."
+ f"Please downgrade your qBittorrent version to {self.SUPPORTED_VERSION} to use qbit_manage."
)
if ex:
self.config.notify(ex, "Qbittorrent")
logger.print_line(ex, "CRITICAL")
sys.exit(0)
if self.config.commands["skip_qb_version_check"]:
logger.print_line(
"Continuing because qBittorrent version check is bypassed... Please do not ask for support!"
)
else:
sys.exit(0)
else:
logger.info("Qbt Connection Successful")
except LoginFailed as exc:
Expand Down
13 changes: 12 additions & 1 deletion modules/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,18 @@ def __init__(self, root_dir, remote_dir):
def get_inode_count(self):
self.inode_count = {}
for file in self.root_files:
inode_no = os.stat(file.replace(self.root_dir, self.remote_dir)).st_ino
try:
inode_no = os.stat(file.replace(self.root_dir, self.remote_dir)).st_ino
except PermissionError as perm:
logger.warning(f"{perm} : file {file} has permission issues. Skipping...")
continue
except FileNotFoundError as file_not_found_error:
logger.warning(f"{file_not_found_error} : File {file} not found. Skipping...")
continue
except Exception as ex:
logger.stacktrace()
logger.error(ex)
continue
if inode_no in self.inode_count:
self.inode_count[inode_no] += 1
else:
Expand Down
13 changes: 13 additions & 0 deletions qbit_manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,16 @@
default=False,
help="Use this to skip cleaning up Recycle Bin/Orphaned directory.",
)
parser.add_argument(
"-svc",
"--skip-qb-version-check",
dest="skip_qb_version_check",
action="store_true",
default=False,
# help="Bypass qBittorrent/libtorrent version compatibility check. "
# "You run the risk of undesirable behavior and will receive no support.",
help=argparse.SUPPRESS,
)
parser.add_argument(
"-dr",
"--dry-run",
Expand Down Expand Up @@ -228,6 +238,7 @@ def get_arg(env_str, default, arg_bool=False, arg_int=False):
rem_orphaned = get_arg("QBT_REM_ORPHANED", args.rem_orphaned, arg_bool=True)
tag_nohardlinks = get_arg("QBT_TAG_NOHARDLINKS", args.tag_nohardlinks, arg_bool=True)
skip_cleanup = get_arg("QBT_SKIP_CLEANUP", args.skip_cleanup, arg_bool=True)
skip_qb_version_check = get_arg("QBT_SKIP_QB_VERSION_CHECK", args.skip_qb_version_check, arg_bool=True)
dry_run = get_arg("QBT_DRY_RUN", args.dry_run, arg_bool=True)
log_level = get_arg("QBT_LOG_LEVEL", args.log_level)
divider = get_arg("QBT_DIVIDER", args.divider)
Expand Down Expand Up @@ -275,6 +286,7 @@ def get_arg(env_str, default, arg_bool=False, arg_int=False):
"rem_orphaned",
"tag_nohardlinks",
"skip_cleanup",
"skip_qb_version_check",
"dry_run",
"log_level",
"divider",
Expand Down Expand Up @@ -572,6 +584,7 @@ def calc_next_run(schd, write_out=False):
logger.debug(f" --rem-orphaned (QBT_REM_ORPHANED): {rem_orphaned}")
logger.debug(f" --tag-nohardlinks (QBT_TAG_NOHARDLINKS): {tag_nohardlinks}")
logger.debug(f" --skip-cleanup (QBT_SKIP_CLEANUP): {skip_cleanup}")
logger.debug(f" --skip-qb-version-check (QBT_SKIP_QB_VERSION_CHECK): {skip_qb_version_check}")
logger.debug(f" --dry-run (QBT_DRY_RUN): {dry_run}")
logger.debug(f" --log-level (QBT_LOG_LEVEL): {log_level}")
logger.debug(f" --divider (QBT_DIVIDER): {divider}")
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ pre-commit==3.3.2
qbittorrent-api==2023.4.47
requests==2.31.0
retrying==1.3.4
ruamel.yaml==0.17.26
ruamel.yaml==0.17.27
schedule==1.2.0

0 comments on commit 1a5f8b2

Please sign in to comment.