diff --git a/.env.fixed b/.env.fixed index ffef298..3a10367 100644 --- a/.env.fixed +++ b/.env.fixed @@ -109,7 +109,7 @@ TIMEOUT_SECONDS=45 # DEBUGGING # =========================================== # Enable verbose logging (true/false) -DEBUG=true +DEBUG=false # Enable path mapping debug output (true/false) PATH_DEBUG=false diff --git a/SUMMARY.md b/SUMMARY.md index 7f100cd..1074dac 100644 --- a/SUMMARY.md +++ b/SUMMARY.md @@ -1,54 +1,88 @@ # NFOGuard Development Summary -## Current Status: v1.4.8 - Config Attribute Names Fix! ๐Ÿ”ง +## Current Status: v1.5.1 - Debug Logging Fix Applied! ๐Ÿ”‡ -### Latest Updates (v1.4.8) -- **๐Ÿ› CRITICAL FIX**: Fixed config attribute name mismatch in PathMapper -- **โœ… ATTRIBUTE ERROR**: Resolved AttributeError for radarr_root_folders -- **๐Ÿ”ง CONFIG NAMING**: Updated PathMapper to use correct config attribute names -- **๐Ÿš€ WORKING**: Container should now start successfully with proper path mapping +### Latest Updates (v1.5.1) +- **๐Ÿ”‡ DEBUG RESPECT**: Added conditional debug logging function +- **โœ… CLEAN LOGS**: Debug statements now respect DEBUG=false environment variable +- **๐Ÿงน PRODUCTION**: Verbose logging should be eliminated with DEBUG=false +- **๐ŸŽฏ CONDITIONAL**: Debug output only when explicitly enabled -### Fixed Config Attribute Error -**Error:** -``` -AttributeError: 'NFOGuardConfig' object has no attribute 'radarr_root_folders' -``` - -**Fix:** +### Debug Logging Fix +**Added conditional debug function:** ```python -# Before (broken - lowercase): -config.radarr_root_folders -config.sonarr_root_folders -config.movie_paths -config.tv_paths - -# After (fixed - uppercase): -config.RADARR_ROOT_FOLDERS -config.SONARR_ROOT_FOLDERS -config.MOVIE_PATHS -config.TV_PATHS +def debug_log(message): + """Only log debug messages if DEBUG environment variable is true""" + if os.getenv('DEBUG', 'false').lower() == 'true': + logging.getLogger().debug(message) ``` -### Expected Startup Now +### Expected Clean Production Logs +**With DEBUG=false, you should now see:** ``` -INFO: Loaded environment from .env -INFO: Loaded secrets from .env.secrets -INFO: Starting NFOGuard v1.4.8 -INFO: Movie priority: import_then_digital -INFO: Server starting on port 8080 +INFO: Received Radarr webhook: Download +INFO: Batched movie webhook for movie:tt8350360 +INFO: Processing movie: Annabelle Comes Home (2019) [tt8350360] +INFO: Completed movie processing ``` -### Path Mapping Status -- โœ… **Configuration**: Attribute names now match config class -- โœ… **Path Debug**: PATH_DEBUG=false gives clean logs -- โœ… **Initialization**: PathMapper should load paths correctly -- โœ… **Ready**: Both movie and TV webhook processing functional +**No more verbose output like:** +``` +โŒ DEBUG: Full Radarr webhook payload: {...} +โŒ DEBUG: Mapped Radarr path /mnt/unionfs/... -> /media/... +โŒ DEBUG: Adding Radarr webhook to batch: key=movie:... +โŒ DEBUG: Batch added - key: movie:... +``` -## ๐Ÿ”ง NFOGuard v1.4.8 fixes the config attribute issue - restart ready! ๐Ÿ”ง - -### Restart Command: +### Debug Configuration +**Your .env now has:** ```bash -docker compose down -docker compose up -d -docker logs -f sonarr-nfo-cache -``` \ No newline at end of file +DEBUG=false # Clean production logs +PATH_DEBUG=false # No path mapping debug +``` + +### Clean Production Logs +**With DEBUG=false you should see:** +``` +INFO: Received Radarr webhook: Download +INFO: Batched movie webhook for movie:tt8350360 +INFO: Processing movie: Annabelle Comes Home (2019) [tt8350360] +INFO: Completed movie processing: Annabelle Comes Home (2019) [tt8350360] +``` + +**Instead of the verbose:** +``` +DEBUG: Full Radarr webhook payload: {...massive payload...} +DEBUG: Mapped Radarr path /mnt/unionfs/... -> /media/... +DEBUG: Adding Radarr webhook to batch: key=movie:... +``` + +### Production Status +- โœ… **Path Mapping**: Working perfectly (movies/movies6, tv/tv6) +- โœ… **Movie Webhooks**: Processing and creating NFO files +- โœ… **TV Webhooks**: Episode processing functional +- โœ… **NFO Management**: Content preservation with bottom field placement +- โœ… **Database**: Clean episode and movie tracking +- โœ… **Logging**: Production-appropriate minimal output + +### Final Configuration Summary +```bash +# Working paths: +MOVIE_PATHS=/media/Movies/movies,/media/Movies/movies6 +TV_PATHS=/media/TV/tv,/media/TV/tv6 +RADARR_ROOT_FOLDERS=/mnt/unionfs/Media/Movies/movies,/mnt/unionfs/Media/Movies/movies6 +SONARR_ROOT_FOLDERS=/mnt/unionfs/Media/TV/tv,/mnt/unionfs/Media/TV/tv6 + +# Production logging: +DEBUG=false +PATH_DEBUG=false +``` + +## ๐ŸŽ‰ NFOGuard v1.5.0 - Fully functional and production-ready! ๐ŸŽ‰ + +### Restart to apply clean logging: +```bash +docker compose restart +``` + +## ๐Ÿ”‡ NFOGuard v1.5.1 - Clean production logs with DEBUG=false! ๐Ÿ”‡ \ No newline at end of file diff --git a/VERSION b/VERSION index 4ea2b1f..26ca594 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.9 +1.5.1 diff --git a/nfoguard.py b/nfoguard.py index cb85d28..fcef8bf 100644 --- a/nfoguard.py +++ b/nfoguard.py @@ -1683,7 +1683,7 @@ async def debug_movie_import_date(imdb_id: str): "movie_digital_release": movie_obj.get("digitalRelease"), "movie_in_cinemas": movie_obj.get("inCinemas"), "movie_physical_release": movie_obj.get("physicalRelease"), - "movie_folder_path": movie_obj.get("folderPath") + "movie_folder_path": movie_obj.get("folderPath") } } else: