Applied idiomatic Python improvements and micro-optimizations across registries and API layer.
CI / Formatting (push) Successful in 5s
CI / Linting (push) Successful in 5s
CI / Tests (Python 3.12) (push) Successful in 20s
CI / Tests (Python 3.13) (push) Successful in 19s
CI / Tests (Python 3.14) (push) Successful in 16s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s

This commit is contained in:
2026-03-26 12:46:50 -04:00
parent 3cf93da28d
commit 0ddffe5e09
18 changed files with 192 additions and 172 deletions
+5 -5
View File
@@ -84,7 +84,7 @@ class OwncastClient:
"Authorization": f"Bearer {access_token}"
}
self._auth: aiohttp.BasicAuth | None = None
self._logger.debug(f"Owncast API client initialized for: {self._base_url}")
self._logger.debug("Owncast API client initialized for: %s", self._base_url)
@property
def base_url(self) -> str:
@@ -207,7 +207,7 @@ class OwncastClient:
:raises OwncastError: If the request fails.
"""
url = f"{self._base_url}{endpoint}"
self._logger.debug(f"POST {endpoint}")
self._logger.debug("POST %s", endpoint)
try:
async with self._http.session.post(
url,
@@ -223,7 +223,7 @@ class OwncastClient:
f"Error {response.status} on POST {endpoint}: {message}"
)
raise OwncastError(response.status, message)
self._logger.debug(f"POST {endpoint} -> {response.status}")
self._logger.debug("POST %s -> %d", endpoint, response.status)
if response.content_type == "application/json":
try:
result = await response.json()
@@ -266,7 +266,7 @@ class OwncastClient:
:raises OwncastError: If the request fails.
"""
url = f"{self._base_url}{endpoint}"
self._logger.debug(f"GET {endpoint}")
self._logger.debug("GET %s", endpoint)
try:
async with self._http.session.get(
url,
@@ -282,7 +282,7 @@ class OwncastClient:
f"Error {response.status} on GET {endpoint}: {message}"
)
raise OwncastError(response.status, message)
self._logger.debug(f"GET {endpoint} -> {response.status}")
self._logger.debug("GET %s -> %d", endpoint, response.status)
try:
result = await response.json()
except (ValueError, ContentTypeError):