From 0e24f74dcb62703990aed763c95fdade11d2a92f Mon Sep 17 00:00:00 2001 From: sbcrumb Date: Fri, 10 Oct 2025 11:02:53 -0400 Subject: [PATCH] fix: Correct config attribute name for Sonarr URL in rename webhook handler - Changed config.sonarr_base_url to config.sonarr_url to match actual config object - Fixes AttributeError that was preventing rename webhook targeting from working --- VERSION | 2 +- api/routes.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION b/VERSION index 3d45b5c..b8061b5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.0.14 +2.0.15 diff --git a/api/routes.py b/api/routes.py index 4d4b846..6f4a952 100644 --- a/api/routes.py +++ b/api/routes.py @@ -107,7 +107,7 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de print(f"DEBUG: Attempting to find recently renamed episode for series {imdb_id}") try: # Get series info from Sonarr to find series ID - series_lookup_url = f"{config.sonarr_base_url}/api/v3/series/lookup?term=imdbid:{imdb_id}" + 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) @@ -120,7 +120,7 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de # Get recent history for episodefilerenamed events (last 24 hours) from datetime import datetime, timedelta since_date = (datetime.utcnow() - timedelta(hours=1)).strftime('%Y-%m-%dT%H:%M:%SZ') - history_url = f"{config.sonarr_base_url}/api/v3/history?seriesId={series_id}&eventType=episodeFileRenamed&since={since_date}&pageSize=10" + 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)