diff --git a/VERSION b/VERSION index b8061b5..a14da29 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.15 +2.0.16 diff --git a/api/routes.py b/api/routes.py index 6f4a952..7f9921c 100644 --- a/api/routes.py +++ b/api/routes.py @@ -110,7 +110,7 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de series_lookup_url = f"{config.sonarr_url}/api/v3/series/lookup?term=imdbid:{imdb_id}" print(f"DEBUG: Sonarr lookup for rename: {series_lookup_url}") - response = requests.get(series_lookup_url, headers={"X-Api-Key": config.sonarr_api_key}, timeout=10) + response = requests.get(series_lookup_url, headers={"X-Api-Key": os.environ.get("SONARR_API_KEY", "")}, timeout=10) if response.status_code == 200: series_results = response.json() if series_results: @@ -123,7 +123,7 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de history_url = f"{config.sonarr_url}/api/v3/history?seriesId={series_id}&eventType=episodeFileRenamed&since={since_date}&pageSize=10" print(f"DEBUG: Checking recent rename history: {history_url}") - history_response = requests.get(history_url, headers={"X-Api-Key": config.sonarr_api_key}, timeout=10) + history_response = requests.get(history_url, headers={"X-Api-Key": os.environ.get("SONARR_API_KEY", "")}, timeout=10) if history_response.status_code == 200: history_data = history_response.json() recent_renames = history_data.get("records", [])