rename #33

Merged
sbcrumb merged 2 commits from rename into dev 2025-10-10 10:31:12 -04:00
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1 +1 @@
2.0.12 2.0.13
+7
View File
@@ -78,11 +78,16 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de
# For all webhook events, if no episodes in webhook.episodes, try to extract from episodeFile # For all webhook events, if no episodes in webhook.episodes, try to extract from episodeFile
# This ensures targeted processing for single episode operations (Download, Rename, Upgrade) # This ensures targeted processing for single episode operations (Download, Rename, Upgrade)
print(f"DEBUG: webhook.episodeFile present: {webhook.episodeFile is not None}")
if webhook.episodeFile:
print(f"DEBUG: episodeFile content: {webhook.episodeFile}")
if not episodes_data and webhook.episodeFile: if not episodes_data and webhook.episodeFile:
episode_file = webhook.episodeFile episode_file = webhook.episodeFile
# Extract season and episode from episodeFile if available # Extract season and episode from episodeFile if available
season_num = episode_file.get("seasonNumber") season_num = episode_file.get("seasonNumber")
episode_num = episode_file.get("episodeNumber") episode_num = episode_file.get("episodeNumber")
print(f"DEBUG: episodeFile seasonNumber: {season_num}, episodeNumber: {episode_num}")
if season_num and episode_num: if season_num and episode_num:
# Create episode data structure that matches what process_webhook_episodes expects # Create episode data structure that matches what process_webhook_episodes expects
episodes_data = [{ episodes_data = [{
@@ -92,6 +97,8 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de
"title": episode_file.get("title") "title": episode_file.get("title")
}] }]
print(f"INFO: Extracted episode info from episodeFile for {webhook.eventType}: S{season_num:02d}E{episode_num:02d}") print(f"INFO: Extracted episode info from episodeFile for {webhook.eventType}: S{season_num:02d}E{episode_num:02d}")
else:
print(f"DEBUG: Missing season/episode numbers in episodeFile for {webhook.eventType}")
# Force targeted mode for single-episode webhooks to prevent full series processing # Force targeted mode for single-episode webhooks to prevent full series processing
processing_mode = config.tv_webhook_processing_mode processing_mode = config.tv_webhook_processing_mode