feat: Refactor API path handling in Audiobookshelf client for improved endpoint management

This commit is contained in:
JB
2025-10-30 15:54:10 -07:00
parent 65ec77180d
commit eb28b01c06
2 changed files with 10 additions and 5 deletions
+2 -2
View File
@@ -3044,7 +3044,7 @@ def test_audiobookshelf() -> ResponseReturnValue:
try:
with client._open_client() as http_client: # pylint: disable=protected-access
response = http_client.get("/api/libraries", params={"lite": "true"})
response = http_client.get(client._api_path("libraries"), params={"lite": "true"})
response.raise_for_status()
payload_json = response.json()
except Exception as exc: # pragma: no cover - network guard
@@ -3081,7 +3081,7 @@ def test_audiobookshelf() -> ResponseReturnValue:
if collection_id:
try:
with client._open_client() as http_client: # pylint: disable=protected-access
collection_resp = http_client.get(f"/api/collections/{collection_id}")
collection_resp = http_client.get(client._api_path(f"collections/{collection_id}"))
collection_resp.raise_for_status()
except Exception as exc: # pragma: no cover - network guard
status_code = getattr(getattr(exc, "response", None), "status_code", None)