mirror of
https://github.com/Xevion/indexer-analyze.git
synced 2025-12-05 23:15:18 -06:00
reformat, remove sonarr event hook
This commit is contained in:
4
hooks.py
4
hooks.py
@@ -11,8 +11,4 @@ async def add_sonarr_api_key(request: httpx.Request) -> None:
|
|||||||
Event hook to inject the Sonarr API key into requests to the Sonarr domain and /api path.
|
Event hook to inject the Sonarr API key into requests to the Sonarr domain and /api path.
|
||||||
"""
|
"""
|
||||||
if SONARR_URL and request.url.host in SONARR_URL and "/api" in request.url.path:
|
if SONARR_URL and request.url.host in SONARR_URL and "/api" in request.url.path:
|
||||||
await logger.debug(
|
|
||||||
"applying sonarr api key",
|
|
||||||
sonarr_url=SONARR_URL,
|
|
||||||
)
|
|
||||||
request.headers["X-Api-Key"] = SONARR_API_KEY
|
request.headers["X-Api-Key"] = SONARR_API_KEY
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -4,8 +4,6 @@ from collections import defaultdict
|
|||||||
from typing import Dict
|
from typing import Dict
|
||||||
|
|
||||||
import structlog
|
import structlog
|
||||||
import httpx
|
|
||||||
import asyncio
|
|
||||||
|
|
||||||
from auth import authelia_login
|
from auth import authelia_login
|
||||||
from config import get_async_logger
|
from config import get_async_logger
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import httpx
|
import httpx
|
||||||
from config import SONARR_URL, SONARR_API_KEY, logger
|
|
||||||
|
|
||||||
|
from config import SONARR_API_KEY, SONARR_URL, logger
|
||||||
|
|
||||||
# Add a global semaphore for concurrency limiting
|
# Add a global semaphore for concurrency limiting
|
||||||
semaphore = None
|
semaphore = None
|
||||||
|
|||||||
Reference in New Issue
Block a user