Commit Message:
fix: NFO processing overhaul - comprehensive metadata management
MAJOR IMPROVEMENTS:
• Enhanced movie detection for directories without IMDb IDs in folder names
• Fixed NFO processing to execute before date validation (preserves existing metadata)
• Added smart episode NFO migration to standardized S##E## format
• Resolved database save issues with proper upsert operations for dateadded values
• Implemented comprehensive IMDb ID detection from filenames and NFO content
TECHNICAL CHANGES:
• nfoguard.py:1008-1025 - Fixed early exit logic to process NFOs regardless of date availability
• core/nfo_manager.py - Added find_existing_episode_nfo() and enhanced episode processing
• core/database.py - Fixed upsert operations to properly save dateadded values
• Enhanced find_movie_imdb_id() to detect IMDb IDs from multiple sources
CORE FIXES:
• Movie NFO processing now happens before date validation checks
• Episode NFOs with long names automatically migrated to S##E## format
• Database operations properly handle both new entries and updates
• Movies without IMDb in directory names now detected via filenames/NFO content
• All existing metadata preserved during NFO standardization
RESULTS:
✅ Existing movie.nfo files receive full NFOGuard processing
✅ Episode NFOs standardized to proper S##E## naming convention
✅ Database persistence works correctly for all date scenarios
✅ Enhanced movie detection covers edge cases
✅ Maintained backward compatibility with existing configurations
* fix: NFO processing overhaul - looking GOOD!
Listen up, buddy! Your boy Cat just made this NFO processing
smoother than my pompadour on a good hair day!
WHAT'S THE DEAL?
• Movie NFOs were getting DISSED when dates went missing
• Episode NFOs with long names were cluttering up the joint
• Nobody wants a messy media library - that's just WRONG!
WHAT I FIXED (because I'm THAT good):
• Movies: NFO processing now happens FIRST, baby! No more
skipping when dates are wonky - we standardize EVERYTHING!
• TV Shows: Long episode NFO names? GONE! We migrate that
metadata to proper S##E## format and trash the old junk
• Dates get moved to the bottom where they belong (it's all
about the STYLE!)
• NFOGuard signatures added to everything (gotta sign your work!)
FILES TOUCHED:
• nfoguard.py:1008-1025 - Fixed that early exit nonsense
• core/nfo_manager.py - Added find_existing_episode_nfo() function
• core/nfo_manager.py - Enhanced create_episode_nfo() with migration
RESULTS:
✨ Existing movie.nfo files get the full treatment
✨ Long episode NFO names become sleek S##E## format
✨ All metadata preserved (we're not ANIMALS!)
✨ Dates organized properly at the bottom
✨ NFOGuard branding on everything
This code is now looking SO good, it should be in GQ!
What's not to like about perfection?
* testing: Testing database date adds for old files
* database debuging
* fixing database calls as well as ID for imdb
* fix: dirs with no imdb in title
movies with no imdb getting skipped
* update: fix core parsing
This file contains a sample Docker Compose configuration for NFOGuard, including service definitions, environment variables, volume mappings, health checks, and setup instructions.
**Root Cause**: upsert_movie_dates() was UPDATE-only, not proper upsert
- Manual scans failed to save dateadded to database (NULL values)
- Webhooks found database entries but with NULL dateadded
- Fell back to current timestamp instead of using proper import dates
**Database Fix**:
- Changed core/database.py upsert_movie_dates() from UPDATE to INSERT OR REPLACE
- Now properly saves dateadded during manual scans
- Preserves existing path with COALESCE fallback
**Webhook Enhancement**:
- Added comprehensive debug logging for database lookups
- Enhanced webhook date decision logic with proper fallback chain
- Only uses current timestamp as absolute last resort
**Impact**:
- Movies: Manual scans now persist dates, webhooks find existing entries ✅
- TV Shows: Not affected - already using proper INSERT OR REPLACE ✅
- Version: 1.5.5