Commit Graph

586 Commits

Author SHA1 Message Date
sbcrumb 1bf2725a5b iupdate 2025-09-13 19:15:22 -04:00
sbcrumb e3038ee279 updates to summarty 2025-09-12 15:59:42 -04:00
sbcrumb c6e4e071e4 cleanup 2025-09-12 15:46:02 -04:00
sbcrumb 558a786bdb chore:file cleanup 2025-09-12 15:41:56 -04:00
sbcrumb 4ef28c3021 updates 2025-09-12 13:54:29 -04:00
sbcrumb 77295cc400 various NFOguard versions 2025-09-12 10:30:12 -04:00
sbcrumb 08cddf7799 dll integration 2025-09-12 09:04:23 -04:00
sbcrumb dcbb25ca9e Fix Emby TV episode date handling by using <aired> field for import dates
- Issue: Emby displays DateCreated field which gets updated on metadata refresh
- Root cause: Emby ignores <dateadded> but reads <aired> for TV episodes
- Solution: Write import date to <aired> field instead of actual air date
- Emby will now display import date (Feb 19) instead of scan date (Sep 11)
- Maintains backward compatibility with fallback to actual air date
2025-09-11 16:45:36 -04:00
sbcrumb 8674b60c85 Fix CI pipeline docker history command failure
🔧 Pipeline Fix:
• Added error handling for docker history command that was failing
• Exit status 141 (SIGPIPE) from head command causing pipeline failure
• Build was actually successful, just diagnostic command failing

 Changes:
• Wrapped docker history in proper error handling
• Pipeline will continue even if history display fails
• Build success is preserved regardless of diagnostic command issues

🎯 Root Cause:
• Permission issue with Docker config file loading
• SIGPIPE when head command terminates docker history output
• Non-critical diagnostic causing critical failure
2025-09-11 11:37:55 -04:00
sbcrumb 86d2cee1f9 Complete TV webhook processing modes documentation update
📚 Comprehensive Documentation Update:
• Added TV webhook processing modes section to README.md
• Updated CHANGELOG.md with configurable processing feature details
• Enhanced SETUP.md with TV_WEBHOOK_PROCESSING_MODE configuration
• Added Step 7 testing procedures to TESTING.md for both modes

🔧 Configuration Documentation:
• Targeted Mode (default): Only process episodes mentioned in webhook
• Series Mode: Process entire series directory (legacy behavior)
• Smart fallback logic when episode data unavailable
• Clear examples and use case recommendations

📋 Testing Instructions:
• Step-by-step mode switching procedures
• Expected log output examples for each mode
• Environment variable configuration examples
• Docker restart procedures for testing

 User Benefits Documented:
• Efficiency comparison: targeted vs series processing
• File operation reduction for targeted mode
• Media server notification minimization
• Backward compatibility with existing setups
2025-09-11 11:26:39 -04:00
sbcrumb ac2753509d Add configurable TV webhook processing modes (targeted vs series)
⚙️ New Configuration Option:
• Added TV_WEBHOOK_PROCESSING_MODE environment variable
• targeted = Only process episodes mentioned in webhook (efficient, default)
• series = Process entire series directory (comprehensive, previous behavior)

🎯 Targeted Episode Processing:
• New process_webhook_episodes() method for precise processing
• Only updates NFOs for downloaded episodes (e.g., just S41E07)
• Reduces unnecessary file operations and Emby notifications
• Falls back to series processing if no episode data in webhook

🔧 Implementation Details:
• Modified Sonarr webhook handler to pass episode data
• Enhanced batch processor with mode detection
• Maintains backward compatibility with existing behavior
• Added comprehensive logging for processing mode selection

 Benefits:
• Efficient: 1 download = 1 episode processed (not entire series)
• Configurable: Users can choose preferred behavior via .env
• Compatible: Works with existing autoscan/Emby refresh systems
• Smart: Falls back gracefully when episode data unavailable
2025-09-11 11:22:36 -04:00
sbcrumb 01cd31505a Complete v0.6.0 documentation update and review
📚 Documentation Updates:
• Updated CHANGELOG.md with comprehensive v0.6.0 feature list
• Enhanced README.md with new TV processing endpoints and examples
• Updated SETUP.md with required Sonarr API key configuration
• Enhanced TESTING.md with v0.6.0 TV testing procedures
• Updated .env templates with proper Sonarr requirements

🔧 Configuration Updates:
• Mark SONARR_API_KEY as REQUIRED for v0.6.0+ Enhanced TV NFOs
• Updated version examples from 0.5.1 to 0.6.0
• Added JSON response examples for new TV endpoints
• Clarified URL-safe vs URL-encoded endpoint options

📋 Complete File Review:
• Verified all Python imports are consistent across modules
• Confirmed all typing imports (Dict, Any, List, Optional) are present
• Validated configuration templates match actual requirements
• Added comprehensive testing procedures for TV enhancements

 Ready for Production:
• All endpoints documented with examples
• Configuration requirements clearly specified
• Testing procedures comprehensive for troubleshooting
• Backward compatibility maintained throughout
2025-09-11 10:10:05 -04:00
sbcrumb 52fa0b6060 Add missing get_episode_date method and bump version to v0.6.0
🐛 Database Fix:
• Add missing get_episode_date() method to NFOGuardDatabase
• Fixes: 'NFOGuardDatabase' object has no attribute 'get_episode_date'

🔄 Version Update:
• Bump VERSION from 0.2.22 to 0.6.0
• Major feature release with comprehensive TV enhancements

 Now Works:
• Single season processing via /tv/scan-season
• Single episode processing via /tv/scan-episode
• Enhanced NFO generation with Sonarr API metadata
• Database queries for existing episode dates
2025-09-11 09:59:15 -04:00
sbcrumb 03bdf2bf9f Fix TV endpoints to use proper JSON request models
🐛 API Fix:
• Add TVSeasonRequest and TVEpisodeRequest Pydantic models
• Update /tv/scan-season and /tv/scan-episode to accept JSON body
• Fix query parameter validation errors

 Now Works:
• curl -X POST "/tv/scan-season" -H "Content-Type: application/json" -d '{...}'
• curl -X POST "/tv/scan-episode" -H "Content-Type: application/json" -d '{...}'
2025-09-11 09:52:26 -04:00
sbcrumb aff6179ddb Fix missing typing imports in NFOManager
🐛 Fix:
• Add missing Dict, Any imports from typing module
• Resolves NameError: name 'Dict' is not defined
2025-09-11 09:46:23 -04:00
sbcrumb c705fb4d6d Add comprehensive TV show enhancements and URL-safe endpoints
 Features Added:
• Single season/episode processing capability via new endpoints
• Enhanced NFO generation with full Sonarr API metadata (titles, plots, ratings)
• NFOGuard timestamp tracking in all NFO source comments
• URL-safe /tv/scan-season and /tv/scan-episode endpoints

🔧 Technical Improvements:
• Fixed URL encoding issues for paths with spaces and special characters
• Enhanced TVProcessor with process_season() and process_episode_file() methods
• Rich metadata extraction from Sonarr API (episode titles, plots, runtime, ratings)
• XML escaping for special characters in metadata
• Comprehensive episode parsing (SxxExx and numeric formats)

📚 Documentation:
• Updated README with new TV processing endpoints
• Added enhanced NFO generation examples showing before/after
• Documented URL-safe alternatives to manual scan paths

🎯 User Benefits:
• Can now process single seasons: Chicago Fire Season 13
• Can now process single episodes: S13E21 files
• Enhanced NFO files with full episode metadata for better Emby/Plex experience
• Timestamps show when NFOGuard processed each file
2025-09-11 09:39:42 -04:00
sbcrumb c7c783570c Add configurable TMDB release type priority system
- Added TMDB_TYPE_PRIORITY environment variable for user-configurable release type preferences
- Default priority: 4,5,3,2,6,1 (Digital → Physical → Theatrical → Limited → TV → Premiere)
- Replaces random first-available selection with intelligent priority-based selection
- Enhanced logging shows selected type and full priority order
- Users can customize priority based on their preferences (e.g. theatrical first)

Version bumped to 0.2.22
2025-09-10 10:17:07 -04:00
sbcrumb 192f59e80c Document comprehensive date selection priority system in README
- Added detailed explanation of 4-tier fallback hierarchy
- Documents all TMDB release types (1-6) with clear descriptions
- Explains rename-first detection and Radarr NFO fallback logic
- Shows difference between import_then_digital vs digital_then_import priorities
- Version bumped to 0.2.21
2025-09-10 10:07:23 -04:00
sbcrumb 5df4db5878 Comprehensive fallback enhancement: Accept any TMDB type + Radarr NFO premiered dates
- TMDB now accepts ANY release type (1-6+) for maximum coverage
- Added Radarr NFO <premiered> date extraction as additional fallback
- For rename-first movies: Import → Any TMDB → Radarr NFO → File dates
- Much more aggressive about using ANY reasonable date over bad file dates
- Covers edge cases where TMDB has unusual release types

Version bumped to 0.2.20
2025-09-10 10:01:20 -04:00
sbcrumb c778cc18eb Add TMDB Type 2 (Limited theatrical) support for modern movies
- Enhanced digital release detection to accept Type 2 (Limited theatrical) dates
- Fixes "To Catch a Killer (2023)" and similar movies that only have festival/limited releases
- Better coverage for modern movies that premiere at film festivals before wide release
- Type 2 dates are better than bad file modification dates for rename-first scenarios

Version bumped to 0.2.19
2025-09-10 09:58:19 -04:00
sbcrumb 6bd7297c37 Add TMDB Type 6 (TV premiere) support for older movies and TV specials
- Enhanced digital release detection to also accept Type 6 (TV premiere) dates
- Fixes issue with 1966 "How the Grinch Stole Christmas!" and similar TV specials
- Detailed debugging revealed Type 6 was available but not being used
- Now properly handles older content that premiered on TV rather than theaters

Version bumped to 0.2.18
2025-09-10 09:29:07 -04:00
sbcrumb 23a71e066d Fix TMDB country configuration and add comprehensive API debugging
- Fixed ExternalClientManager to properly use TMDB_COUNTRY environment variable
- Added detailed TMDB API call logging to debug why external clients return None
- Will show available countries, release types, and specific API responses
- Should resolve the "no_valid_date_source" issue for rename-first movies

Version bumped to 0.2.17
2025-09-10 09:22:17 -04:00
sbcrumb c857a61d0b Bump version to 0.2.16 for TMDB debugging release
- Updated version for enhanced TMDB API debugging
- Container rebuild needed to see new diagnostic logs
- Will help identify TMDB API key and external client issues
2025-09-10 09:15:37 -04:00
sbcrumb 47a2286953 Add detailed logging to debug TMDB API fallback issues
- Enhanced _get_digital_release_date with comprehensive logging
- Added external clients configuration check in debug endpoint
- Will show if TMDB API key is configured and external clients initialized
- Added error handling for external client calls
2025-09-10 09:13:12 -04:00
sbcrumb f586185a4f Fix debug endpoint to use global movie_processor instance
- Corrected debug endpoint to use global movie_processor variable
- Was incorrectly trying to access batcher.movie_processor (doesn't exist)
- Now properly tests full TMDB fallback pipeline for rename-first movies
2025-09-10 09:08:09 -04:00
sbcrumb fc983ed472 Fix private repo authentication and enhance debug endpoint
- Add authentication to git clone commands in CI workflows for private repo support
- Enhanced debug endpoint to test FULL movie processing pipeline (not just database)
- Debug now shows both database result AND final TMDB fallback decision
- Will reveal if TMDB API calls are working correctly for rename-first scenarios
2025-09-10 09:04:26 -04:00
sbcrumb bf7fb27fdb Fix dev workflow hanging and implement runtime branch detection
- Fix duplicate Dockerfile sections that were causing build hangs
- Replace complex build args with simple runtime git branch detection
- Revert CI workflows to working state (remove build args and debug code)
- Add automatic version tagging: dev branch shows "0.2.15-dev"
- Enhanced movie fallback logic for rename-first scenarios
- Improved logging to trace movie date decision process
2025-09-10 08:54:47 -04:00
sbcrumb 6f356b1942 versions 2025-09-10 08:29:04 -04:00
sbcrumb 4e786d775b Add configurable TV season directory naming
Features:
- TV_SEASON_DIR_FORMAT: Configurable season folder creation (Season {season:02d})
- TV_SEASON_DIR_PATTERN: Configurable season folder detection (season )
- Support for different naming conventions (Season 01, S01, Season01, etc.)
- Updated .env.template with TV configuration examples

Fixes hardcoded 'Season ' patterns for better flexibility
2025-09-09 20:25:03 -04:00
sbcrumb 4f12d77d98 Fix CI pipe error in docker history command
- Add fallback to prevent exit 141 from broken pipe
- Build succeeded, just a minor display issue
2025-09-09 20:15:12 -04:00
sbcrumb 6ce4db099a Create dev branch with dedicated CI workflow
- Add ci-dev.yml for dev branch builds
- Builds to nfoguard:dev tags (separate from main)
- Independent cache: dev-buildcache
- Separate deployment flow
- Updated main CI to ignore dev branch

Usage: docker pull 192.168.253.221:3000/jskala/nfoguard:dev
2025-09-09 20:14:06 -04:00
sbcrumb 49e2ec6c88 Fix EventType detection: movieFileRenamed is 8, not 7
Found via database inspection:
- The Matrix first event: EventType 8 (movieFileRenamed)
- Followed by EventType 3 (downloadFolderImported) upgrade
- Was checking for EventType 7, should be EventType 8

This should now correctly detect rename-first scenarios
and prefer digital release dates over upgrade dates.
2025-09-09 18:28:40 -04:00
sbcrumb 6f04031e33 Add debug logging to diagnose Matrix history issue
- Show first 3 events in movie history
- Log event types to identify if first event is rename (Type 7)
- Debug why Matrix (tt0133093) not detecting rename-first pattern
2025-09-09 18:02:33 -04:00
sbcrumb f1814abdcd cahce 2 2025-09-09 17:25:39 -04:00
sbcrumb af94337ad0 build cache 2025-09-09 17:24:33 -04:00
sbcrumb 2198d796b9 fix order 2025-09-09 17:20:33 -04:00
sbcrumb afe93b4a8a imdb updates 2025-09-09 17:13:14 -04:00
sbcrumb 8be7452f0e iupdate 2025-09-09 17:04:59 -04:00
sbcrumb 53f3f7f2f0 Clean up temporary troubleshooting files 2025-09-09 16:56:14 -04:00
sbcrumb 740aa9036b all local 2025-09-09 16:45:02 -04:00
sbcrumb 41ef3d80c8 smaller image 2025-09-09 16:43:47 -04:00
sbcrumb c1e1a0529e updates AGAIN 2025-09-09 16:40:57 -04:00
sbcrumb d59df0f2c9 local 2025-09-09 16:39:33 -04:00
sbcrumb ba7d6c3620 up 2025-09-09 16:37:49 -04:00
sbcrumb db7d63fe15 fix docker 2025-09-09 16:36:06 -04:00
sbcrumb 51e63ae71b remove https 2025-09-09 16:34:41 -04:00
sbcrumb 27cb38c3bb git updates 2025-09-09 16:26:07 -04:00
sbcrumb f29d060d59 docker reg update 2025-09-09 16:19:53 -04:00
sbcrumb 8aeef814b0 push 2025-09-09 16:12:24 -04:00
sbcrumb 9d3d798055 update again sudo 2025-09-09 16:09:11 -04:00