Compare commits
3
Commits
f98fa9626c
...
74c30d647e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74c30d647e | ||
|
|
5cc7281f06 | ||
|
|
6e15d79b8f |
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user