fix: Correct config attribute name for Sonarr URL in rename webhook handler
Local Docker Build (Dev) / build-dev (pull_request) Successful in 4s

- Changed config.sonarr_base_url to config.sonarr_url to match actual config object
- Fixes AttributeError that was preventing rename webhook targeting from working
This commit is contained in:
2025-10-10 11:02:53 -04:00
parent 6e70497be2
commit 0e24f74dcb
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
2.0.14
2.0.15
+2 -2
View File
@@ -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)