fix(qbittorrent): stop mislabeling gateway/URL errors as auth failures
The credential tester always reported "Authentication failed — qBittorrent rejected the credentials" for the qBittorrent service, even when credentials were correct. test_connection classified any RuntimeError whose message contained "login failed" as an auth failure — and the gateway-timeout error (502/503/504 from the reverse proxy) and the wrong-URL diagnostic both started with "qBittorrent login failed:", so a proxy timeout was reported as a credentials rejection. That sent users down the wrong path (re-entering correct passwords to fix a 504). - QbittorrentClient._login: gateway and URL/routing errors no longer contain "login failed"; only a genuine "Fails." body carries the "invalid username or password" signal. - integrations/qbittorrent.test_connection: key the auth message off "invalid username or password" specifically; all other login errors flow through translate_connection_error so the real reason (proxy timeout, wrong URL, empty body) is surfaced. After this, a failing test reports the actual cause (e.g. "qBittorrent is unreachable: reverse proxy returned HTTP 504 ...") instead of accusing the credentials. New regression test asserts a gateway error is NOT reported as "Authentication failed". 386/386 backend tests pass; ruff clean.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
dir: backend/src/media_library_viewer_api/integrations
|
||||
|
||||
## role
|
||||
Defines external service integrations (e.g., Jellyfin, Prometheus, Alertmanager) with configuration models, widget schemas, and data-fetching logic for the media library viewer API.
|
||||
Provides a plugin-based integration layer connecting the media library viewer API to various external services (Alertmanager, Authentik, Jellyfin, Prometheus, qBittorrent, etc.) via a centralized registry.
|
||||
## parent
|
||||
index: backend/src/media_library_viewer_api/.pi-map.index.md
|
||||
map: backend/src/media_library_viewer_api/.pi-map.md
|
||||
|
||||
Reference in New Issue
Block a user