Adds custom managers to allow Renovate to detect and propose updates for the Python version used in the build workflow and the `SABCTOOLS_VERSION_REQUIRED` constant. Removes `sabctools` from the ignore list to enable these updates.
Refactors collection initializations and comprehensions to use more concise and idiomatic Python syntax, such as set literals (`{...}`) instead of `set([...])`, empty dictionary literals (`{}`) instead of `dict()`, and `dict.fromkeys` for `str.maketrans`.
Also removes unnecessary list creation within `any()` calls.
Adds an explicit check to prevent unnecessary rename operations when the target path is the same as the original file's path. This provides clearer debug logging and avoids redundant filesystem calls.
Closes#3449, #3442
Explicitly defines the structure and types for the `nzo_info` dictionary.
Also introduces `BadArticleType` as a `Literal` type and cleans up
`__init__.py` by removing internal saver classes from the public API.
* Sanitise host_whitelist and login/request IP addresses
* Keep json keys
* Remove all IPv4 and IPv6 from logs
* Less crazy remote label replacements
* Remove unused import
* Sanitise public ipv4/ipv6 and test
* Add loopback/link-local test cases
* Switch is_local_addr to is_lan_addr because the former allows user configuration of trusted addresses
* Remove prefix group, ip regex should be good enough
directory_is_writable_with_file() removed its fixed-name temp file in a
non-atomic exists/remove/open/remove sequence wrapped in a blanket
"except Exception: return False". If the test file was removed between the
write and the final os.remove (e.g. by a concurrent writability check), the
FileNotFoundError was swallowed and reported as "is not writable at all.
This blocks downloads." -- a false negative on a fully writable folder.
Make the result depend only on creating and writing the file; treat cleanup
as best-effort. Genuine write failures still return False, and the unicode
and special-character capability checks are unchanged.
Adds regression tests for the cleanup race and for a genuine write failure.
Addresses a runtime error encountered when using native union syntax (PEP 604) with `threading.Lock` and `RLock` in type hints. As factory functions, they cannot be directly used with `|` without `from __future__ import annotations`.
Tempora 5.9.0 introduced an incompatibility with jaraco.classes that caused issues. Downgrade to the previous stable version and prevent Renovate from automatically updating it again.
Closes#3441
Migrate to `A | B` syntax for unions (PEP 604) and introduce `typing.TypeAlias` for complex types, leveraging features available in Python 3.10+. This also updates `socket.timeout` to `TimeoutError` and adds `UP045` to Ruff ignores.
* Fix RuntimeError from dict mutation in stop_idle_jobs (#3431)
Collecting exhausted articles into a snapshot list while holding
nzf.lock, then calling register_article outside the iteration.
This prevents RuntimeError when register_article -> nzf.remove_article
pops from nzf.articles (a dict) while stop_idle_jobs is iterating it.
The original code in fd3ece31c used `nzf.articles[:]` which was safe
when articles was a list. When 44d94226e changed articles to a dict
the protective copy was dropped, leaving bare dict iteration that
mutates mid-loop.
The collect-then-act pattern matches nzf_remove_list in nzb/object.py
and the empty-nzo list already used in stop_idle_jobs itself. It also
correctly calls register_article outside nzf.lock, consistent with its
own "not locked for performance" contract.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Apply Black formatting to nzbqueue.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Soften comment per maintainer feedback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Refines margins, paddings, and element positioning across various components to improve visual harmony and alignment with the modernized interface design.
This modernizes the theming architecture by defining core colors as CSS variables,
allowing themes like 'Night' to override them concisely. This approach improves
maintainability and removes dynamic styling previously handled by JavaScript.
* Match to previous RSS behaviour
* Cleanup logic due to normalisation
* Tests comparing 4.5.5 outcome
* Remove comment - fixed since 4.5.5
* Consistent types for prio, rule, season, and episode
* Rename matching_rule_index
* Fix type warnings
The Python plugin attempts to `pip install -U .` when `pyproject.toml`
is present. As SABnzbd is an application source tree and not a
pip-installable package, this temporarily hides `pyproject.toml`
during the build step to prevent an incorrect installation attempt.
The `os.access()` function can produce false negatives for directory writability, particularly in environments like NFS with UID mapping or root-squashing.
This change replaces the `os.access()` call with a direct I/O test (creating and deleting a temporary file) to ensure accurate and reliable verification of directory permissions.
Apply the table-header-progress-smaller class (25% width) to both queue and
history when compact layout is enabled, matching the behavior when extra columns
are shown. This provides more horizontal space for longer NZB titles.
Fixes#3414
Configures `concurrency` for the build, snap, and integration testing workflows. This prevents multiple concurrent runs of the same workflow on the same branch and automatically cancels older, in-progress runs when a new one is triggered.