rename #33

Merged
sbcrumb merged 2 commits from rename into dev 2025-10-10 10:31:12 -04:00
Showing only changes of commit 6e15d79b8f - Show all commits
+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
# 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:
episode_file = webhook.episodeFile
# Extract season and episode from episodeFile if available
season_num = episode_file.get("seasonNumber")
episode_num = episode_file.get("episodeNumber")
print(f"DEBUG: episodeFile seasonNumber: {season_num}, episodeNumber: {episode_num}")
if season_num and episode_num:
# Create episode data structure that matches what process_webhook_episodes expects
episodes_data = [{
@@ -92,6 +97,8 @@ async def sonarr_webhook(request: Request, background_tasks: BackgroundTasks, de
"title": episode_file.get("title")
}]
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
processing_mode = config.tv_webhook_processing_mode