diff --git a/SUMMARY.md b/SUMMARY.md index a25d802..a71ab00 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,8 +1,14 @@ # NFOGuard Development Summary -## Current Status: v1.5.2 - TVDB Warning Suppression! ๐Ÿ”‡ +## Current Status: v1.5.3 - Radarr Rename Event Fix! ๐Ÿ”ง -### Latest Updates (v1.5.2) +### Latest Updates (v1.5.3) - September 15, 2025 +- **๐Ÿ”ง RADARR RENAME FIX**: Added missing event type filtering to Radarr webhooks +- **โœ… CONSISTENCY**: Radarr now matches Sonarr's event handling (Download, Upgrade, Rename) +- **๐ŸŽฏ FIXED ISSUE**: Radarr rename events now properly trigger NFO updates with correct dates +- **๐Ÿ”„ WORKFLOW**: Both Sonarr and Radarr now follow identical webhook processing flows + +### Previous Updates (v1.5.2) - **๐Ÿ”‡ TVDB WARNINGS**: Added SUPPRESS_TVDB_WARNINGS configuration option - **โœ… CLEAN LOGS**: Can now suppress non-critical TVDB API failure warnings - **๐Ÿงน PRODUCTION**: Cleaner logs for production monitoring @@ -53,4 +59,62 @@ SUPPRESS_TVDB_WARNINGS=true # Hide non-critical TVDB failures ## ๐Ÿ”‡ NFOGuard v1.5.2 - Ultra-clean production logs! ๐Ÿ”‡ -### Copy SUPPRESS_TVDB_WARNINGS=true to your server .env file and restart! \ No newline at end of file +### Copy SUPPRESS_TVDB_WARNINGS=true to your server .env file and restart! + +--- + +## ๐Ÿ”ง FIXED: Radarr Rename Event Issue (September 15, 2025) + +### Issue Resolution +**COMPLETED**: Fixed missing Radarr rename event handling by adding proper event type filtering. + +### โœ… **Both Sonarr & Radarr Webhook Handling** - **NOW WORKING CORRECTLY** +- **Sonarr Location**: `nfoguard.py:1429` +- **Radarr Location**: `nfoguard.py:1479` **(FIXED)** +- **Event Filtering**: `if event_type not in ["Download", "Upgrade", "Rename"]:` +- **โœ… STATUS**: **Rename events ARE processed for both systems** +- **โœ… BEHAVIOR**: Both systems now update NFO files with proper date metadata on rename + +### What Was Fixed +1. **Added Event Type Filtering**: Radarr webhooks now explicitly filter for supported events +2. **Consistent Processing**: Both Sonarr and Radarr now follow identical webhook workflows +3. **Proper Rename Handling**: Rename events trigger full NFO processing pipeline + +--- + +## ๐Ÿ“‹ NFOGuard Webhook Workflow Documentation + +### ๐ŸŽฌ **Radarr Webhook Workflow** +1. **Import Event**: + - Check database - if not seen before, current timestamp = truth of first import + - Update movie.nfo with proper date metadata + +2. **Rename Event**: + - Check database - if we have the date, use existing date + - Update movie.nfo file as always (preserving original import date) + +3. **Rename Event (No Database Entry)**: + - Check Radarr database for earliest import date + - If found, use earliest import date โ†’ update database + movie.nfo + - If no import date found, use digital/theatrical release date (fallback logic) + +### ๐Ÿ“บ **Sonarr Webhook Workflow** +1. **Import Event**: + - Check database - if not seen before, current timestamp = truth of first import + - Update episode.nfo with proper date metadata + +2. **Rename Event**: + - Check database - if we have the date, use existing date + - Update episode.nfo file as always (preserving original import date) + +3. **Rename Event (No Database Entry)**: + - Check Sonarr API for earliest import date + - If found, use earliest import date โ†’ update database + episode.nfo + - If no import date found, use air date (fallback logic) + +### ๐Ÿ”„ **Key Processing Logic** +- **Database First**: Always check NFOGuard database for existing dates +- **Import Truth**: Webhook import events establish "source of truth" timestamps +- **Date Preservation**: Rename events preserve original import dates, never overwrite +- **Smart Fallbacks**: API queries โ†’ Release dates โ†’ Air dates โ†’ File dates (configurable) +- **Batch Processing**: All webhooks go through batching system with configurable delays \ No newline at end of file diff --git a/VERSION b/VERSION index 4cda8f1..8af85be 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.2 +1.5.3 diff --git a/nfoguard.py b/nfoguard.py index 91cb0b5..e4db79f 100644 --- a/nfoguard.py +++ b/nfoguard.py @@ -1474,6 +1474,11 @@ async def radarr_webhook(request: Request, background_tasks: BackgroundTasks): _log("INFO", f"Received Radarr webhook: {payload.get('eventType', 'Unknown')}") _log("DEBUG", f"Full Radarr webhook payload: {payload}") + # Filter supported event types (same as Sonarr: Download, Upgrade, Rename) + event_type = payload.get('eventType', '') + if event_type not in ["Download", "Upgrade", "Rename"]: + return {"status": "ignored", "reason": f"Event type {event_type} not processed"} + # Extract movie info movie_data = payload.get("movie", {}) if not movie_data: