* 'master' of https://github.com/StuffAnThings/qbit_manage:
  [pre-commit.ci] pre-commit autoupdate
  send notification on nohardlink warning and remove force failure
  3.4.2
  Fixes #196
  refactor noHL
  better logging for FileNotFoundError
  removes alive-progress dependency  causing issues with rolling logs found. Once this is fixed then it can be implemented again https://github.com/rsalmei/alive-progress/issues/104
  better error handling for noHL
  fixes noHL bug with remote not being replaced
  better trace for nohardlink
  better error checking in commands
  minor bug fix in torrent tagging
  bug fix on prev refactor
  bit a refactoring
  Fixes #192 Fixes noHL logic with false negatives not being caught with small files.
  3.4.1
This commit is contained in:
bobokun 2022-12-19 17:13:52 -05:00
commit fd18d54783
No known key found for this signature in database
GPG key ID: B73932169607D927
3 changed files with 7 additions and 6 deletions

View file

@ -36,12 +36,12 @@ repos:
hooks:
- id: reorder-python-imports
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.0
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py3-plus]
- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
language_version: python3

View file

@ -1 +1 @@
3.4.1
3.4.2

View file

@ -270,7 +270,7 @@ def remove_empty_directories(pathlib_root_dir, pattern):
# If a folder is passed, it will take the largest file in that folder and only check for hardlinks
# of the remaining files where the file is greater size a percentage of the largest file
# This fixes the bug in #192
def nohardlink(file):
def nohardlink(file, notify):
check = True
if os.path.isfile(file):
logger.trace(f"Checking file: {file}")
@ -284,9 +284,10 @@ def nohardlink(file):
if not sorted_files:
msg = (
f"Nohardlink Error: Unable to open the folder {file}. "
"Please make sure qbit_manage has access to this directory."
"Please make sure folder exists and qbit_manage has access to this directory."
)
raise Failed(msg)
notify(msg, "nohardlink")
logger.warning(msg)
largest_file_size = os.stat(sorted_files[0]).st_size
logger.trace(f"Largest file: {sorted_files[0]}")
logger.trace(f"Largest file size: {largest_file_size}")