Implement try-except around ThreadPoolExecutor initialization to handle RuntimeError when thread creation fails, falling back to synchronous processing. This prevents application crashes in environments with thread limits and ensures the orphaned file removal process continues reliably. Updates parallel operations for fetching torrents, processing files, age checks, and directory removal to conditionally use threading or sync based on executor availability.
Replace manual threading with ThreadPoolExecutor for parallel file age checks,
add timeout handling to prevent hanging, and improve error management for
permission issues and exceptions.
- Enhance robustness in file system operations across config, orphaned file removal, and utility modules
- Add PermissionError and OSError handling to prevent crashes on access issues
- Implement threading-based timeout protection to avoid hanging on file operations
- Improve logging for better debugging of permission and system errors
Addresses potential file system reliability issues in cleanup and move operations.
Replace all instances of string `.replace()` for path manipulation with a new `util.path_replace()` function that handles cross-platform path separators safely, improving compatibility between Windows and Unix-like systems. This includes updates in config, remove_orphaned, share_limits, tag_nohardlinks, qbittorrent modules, and the addition of the utility function itself.
# Requirements Updated
- "GitPython==3.1.45"
- "retrying==1.4.1",
# New Features
- **Remove Orphaned**: Adds new `min_file_age_minutes` flag to prevent
files newer than a certain time from being deleted (Thanks to @H2OKing89
#859)
- Adds new standalone script `ban_peers.py` for banning selected peers
(Thanks to @tboy1337 #888)
# Improvements
- Adds timeout detectiono for stuck runs for web API rqeeusts
# Bug Fixes
- Fix bug in webUI deleting nohardlink section (Fixes#884)
**Full Changelog**:
https://github.com/StuffAnThings/qbit_manage/compare/v4.5.1...v4.5.2
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: cat-of-wisdom <217637421+cat-of-wisdom@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Quentin <qking.dev@gmail.com>
Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com>
Co-authored-by: tboy1337 <30571311+tboy1337@users.noreply.github.com>
Co-authored-by: tboy1337 <tboy1337.unchanged733@aleeas.com>
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
* 4.1.7
* chore(docs): Sync wiki to docs [skip-cd]
* Bump flake8 from 7.0.0 to 7.1.0 (#585)
Bumps [flake8](https://github.com/pycqa/flake8) from 7.0.0 to 7.1.0.
- [Commits](https://github.com/pycqa/flake8/compare/7.0.0...7.1.0)
---
updated-dependencies:
- dependency-name: flake8
dependency-type: direct:development
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump docker/build-push-action from 5 to 6 (#588)
* chore(docs): Sync wiki to docs [skip-cd]
* fix(unregistered): Ignore 520 (#592)
* fix: max vs min seeding time check (#596)
* fix: max vs min seeding time check
Allow max_seeding_time to be unlimited (-1) even if a min_seeding_time is set
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* fix pre-commit test
* fix: check tracker status in udp & wss as well (#586)
* fix: check tracker status in udp & wss as well
* bump VERSION
---------
Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com>
* [pre-commit.ci] pre-commit autoupdate (#584)
updates:
- [github.com/hhatto/autopep8: v2.2.0 → v2.3.1](https://github.com/hhatto/autopep8/compare/v2.2.0...v2.3.1)
- [github.com/asottile/pyupgrade: v3.15.2 → v3.16.0](https://github.com/asottile/pyupgrade/compare/v3.15.2...v3.16.0)
- [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](https://github.com/PyCQA/flake8/compare/7.0.0...7.1.0)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Fixes#595 to use BHD deleted reason list instead of API
* Fixes#591 [FR]: Logging header doesn't get logged for every run
* minor fixes in #591
* Adds deprecated message for bhd attribute in config
* Fix min_seeding_time tag removal when max_seeding_time is -1 (#598)
* Update share_limits.py to fix#590
---------
Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com>
* Adds logging to mover script
* Fixes [FR]: Remove orphaned without moving to orphaned_dir #590
* Fixes bug in printing schedule mode when run is True
* Fix bug in Use BHD list of reasons instead of API #595
* Add additional BHD deletion reason #595
* Fix bug in #595 when status contains optional message
* Update mover.py: add optional arg --status-filter to allow fine tune which torrents to pauseUpdate mover.py: add optional arg --status-filter to allow fine tune which torrents to pause (#599)
* Update mover.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update mover.py: making the default behavior to only move `completed` torrents
This will leave 1) unfinished files 2) actively seeding files in `downloading` torrents in cache. This helps to keep write-heavy operation on Cache, not on hard drive.
Change this to "all" if you want this to always move everything every time.
* minor fixes in help description
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: bobokun <12660469+bobokun@users.noreply.github.com>
* modify noHL threshold to address false positives
* Add additional BHD deletion reason #595
* Bump dependabot/fetch-metadata from 2.1.0 to 2.2.0 (#601)
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.1.0 to 2.2.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.1.0...v2.2.0)
---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* 4.1.7
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Actionbot <actions@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: bakerboy448 <55419169+bakerboy448@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Amos (lflare) <me@amosng.com>
Co-authored-by: ineednewpajamas <73252768+ineednewpajamas@users.noreply.github.com>
Co-authored-by: Tony <5747393+convexshiba@users.noreply.github.com>
* 4.1.3-develop1
* removes `ignoreTags_OnUpdate` setting as it was confusing for users
- Adds cache for tag updates
- Updates doc to include cat in tracker
* Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0 (#537)
* Bump dependabot/fetch-metadata from 2.0.0 to 2.1.0
Bumps [dependabot/fetch-metadata](https://github.com/dependabot/fetch-metadata) from 2.0.0 to 2.1.0.
- [Release notes](https://github.com/dependabot/fetch-metadata/releases)
- [Commits](https://github.com/dependabot/fetch-metadata/compare/v2.0.0...v2.1.0)
---
updated-dependencies:
- dependency-name: dependabot/fetch-metadata
dependency-type: direct:production
update-type: version-update:semver-minor
...
Signed-off-by: dependabot[bot] <support@github.com>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* minor bug fix in process torrent issues
* remove force_retag setting since it's no longer valid with the new tag-update
* move hotio webhook to start earlier
* adds better trace logs for share limits #533
* Adds #538
* [pre-commit.ci] pre-commit autoupdate (#539)
* [pre-commit.ci] pre-commit autoupdate
updates:
- [github.com/psf/black: 24.4.0 → 24.4.2](https://github.com/psf/black/compare/24.4.0...24.4.2)
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* add additional trace logs for noHL
* nohl config fixes
* Fixes#540
* adds cron scheduling support
* minor bug fix in rounding minutes
* bugfixes in cron scheduling
* don't spam the logs
* chore: Update qbit_manage.py to display next run time after first cron run
* remove spam in logs
* QOL improvement: Refactor time parsing logic for share limits
* bug fix in new parse data
* 4.1.3
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>