Authentication Features:
- Optional HTTP Basic Auth with session cookies for web interface protection
- Configurable username/password with session timeout (default: 1 hour)
- Selective route protection (web interface protected, webhooks/APIs remain public)
- Authentication status display with logout functionality in web UI
- Session cleanup and graceful logout with browser re-authentication prompt
Configuration:
- WEB_AUTH_ENABLED in .env (default: false - no breaking changes)
- WEB_AUTH_USERNAME/WEB_AUTH_PASSWORD in .env.secrets
- WEB_AUTH_SESSION_TIMEOUT configurable (5min-24h range)
Development Tools:
- Added debug_tv.py for TV series/episode debugging (series, season, episode levels)
- Comprehensive episode data inspection with validation and sources breakdown
- Complements existing debug_movie.py for complete media debugging coverage
Technical Implementation:
- SimpleAuthMiddleware with FastAPI integration
- Session management with automatic cleanup
- Authentication status API endpoints
- Responsive CSS styling for auth UI elements
- JavaScript functions for auth checking and logout
Major features and improvements:
🚀 THREE-TIER PERFORMANCE OPTIMIZATION:
- Tier 1: NFO file caching (99% faster, instant recovery)
- Tier 2: Database caching (90% faster, skip API calls)
- Tier 3: Full API processing (normal speed, only when needed)
- Extended to both movies AND TV episodes for complete coverage
🌍 INTERNATIONAL RELEASE DATE SUPPORT:
- Smart fallback hierarchy: US → English-speaking countries → any country
- Handles movies without US release dates (e.g., The Fabric of Christmas 2023)
- Prioritizes culturally relevant dates while ensuring comprehensive coverage
🎬 TMDB ID FALLBACK SYSTEM:
- Support for movies with TMDB IDs but no IMDb IDs (e.g., For the One 2024)
- Tolerant XML parsing handles NFO files with trailing URLs
- Extracts premiered dates from existing NFO files as fallback source
📊 ENHANCED DEBUGGING & MONITORING:
- Failed movies logged to logs/failed_movies.log for troubleshooting
- Comprehensive logging shows which optimization tier is used
- Enhanced IMDb/TMDB ID detection with detailed status messages
🔧 DATABASE REBUILD CAPABILITIES:
- Instant recovery from existing NFO files without API calls
- Perfect for migrations, disaster recovery, and system rebuilds
- Maintains performance even with thousands of movies/episodes
💾 SMART CACHING & NFO MANAGEMENT:
- NFOGuard fields properly positioned at bottom for Emby plugin compatibility
- Database-first optimization eliminates redundant API calls
- Intelligent should_query logic prevents unnecessary processing
Technical improvements include tolerant XML parsing, three-tier optimization for TV episodes, English-speaking country prioritization, TMDB fallback processing, failed movies debug logging, comprehensive database rebuild support, and performance optimizations eliminating 90%+ processing time on warm systems.
Initial clean repository with full NFOGuard codebase:
- Docker-based media file processing
- Webhook integration for Radarr/Sonarr
- NFO file management and organization
- Emby/Jellyfin plugin integration
- TMDB API integration for metadata
- Smart episode and movie renaming
- Comprehensive dual-repository development workflow
Author: SBCrumb