Commit Graph

33 Commits

Author SHA1 Message Date
sbcrumb 0734b4d14d featuer: smart scan to skip ones with dates
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-18 15:20:57 -04:00
sbcrumb 55d5f891b5 improv: phase 1 of faster scan and tracking of scans
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-18 15:16:02 -04:00
sbcrumb e06df9c8b0 db: more
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-18 09:37:53 -04:00
sbcrumb 762031d3f3 db: update
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-18 09:07:45 -04:00
sbcrumb 87930efb79 fix: tier levels not working as well as an option to ignore the .nfo file and query
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-17 10:16:12 -04:00
sbcrumb 6d5635f56a sonarr: fuzzy date match debug
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-16 10:04:06 -04:00
sbcrumb fd2f8f2c51 fix: fuzzy match
Local Docker Build (Dev) / build-dev (push) Successful in 3s
2025-10-16 10:00:37 -04:00
sbcrumb 47eb74da06 debug: debug airdates in TV
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-16 09:50:04 -04:00
sbcrumb 8a3e01d966 fix: shows not seeing airdates
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-16 09:17:03 -04:00
sbcrumb c5177ba920 sonarr: fix airdates not being used.
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-16 08:51:54 -04:00
sbcrumb d17f924192 fix: nfo cache
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-15 21:13:51 -04:00
sbcrumb 857d423ae4 fix: airdates again
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-15 20:58:26 -04:00
sbcrumb 4ea202cca2 fix: airdate issues
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-15 18:51:16 -04:00
sbcrumb 79a311f8ec web: fix for unresponsive web interface
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-15 10:13:25 -04:00
sbcrumb 913aed1f60 fix: data issue not populating
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-15 08:21:27 -04:00
sbcrumb 0dfc296bf4 fix: db not filling in .nfo data
Local Docker Build (Dev) / build-dev (push) Successful in 4s
2025-10-15 07:56:56 -04:00
sbcrumb 5b9f5c44e1 Fix TV processor TIER 2 fallback logic for NFO files with aired but no dateadded
Local Docker Build (Dev) / build-dev (push) Successful in 4s
The issue was that TIER 2 (NFO cache) wasn't applying the aired date fallback
when NFO files contained aired dates but no dateadded values. This caused
episodes like "The Chosen" to show "no date added just air" because the
system would find lockdata in TIER 2 but reject it due to missing dateadded,
without applying the fallback logic.

Changes:
- Enhanced TIER 2 NFO processing to apply aired->dateadded fallback
- Added debug logging for NFO fallback cases
- Updated version to 2.0.23

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-10-11 13:12:36 -04:00
sbcrumb 14d551fc36 update 2
Local Docker Build (Dev) / build-dev (pull_request) Successful in 3s
2025-10-11 09:49:14 -04:00
sbcrumb fb3040c554 Implement optimal caching hierarchy for both movies and TV shows
Perfect the caching strategy as requested:
1. Database check first (fastest lookup)
2. NFO file extraction with database caching
3. API calls only when absolutely necessary

Movies: Fixed order from NFO->DB->API to DB->NFO->API
TV Shows: Added missing NFO extraction tier between database and API

Benefits:
- First scan: Extract existing NFOGuard data from NFOs and cache in DB
- Subsequent scans: ~99% database cache hits, minimal API calls
- NFO recovery: Rebuild database from existing NFO files
- Webhook processing: Cache webhook dates in database immediately

Expected performance: Manual scans now use 3-tier optimization
2025-10-10 16:18:34 -04:00
sbcrumb 035f2f6e02 Optimize TV processor performance with database-first episode lookup
Major performance improvement for manual scans:
- Check NFOGuard database before making Sonarr API calls
- Only query Sonarr history for episodes missing from database
- Filter Sonarr episode processing to only needed episodes
- Add detailed logging for cache hits vs API calls

Expected improvement: 172 API calls -> 0-10 API calls for typical scans
2025-10-10 15:30:06 -04:00
sbcrumb ed78a81a8e Fix TV webhook processing: Add missing process_webhook_episodes method
- Add process_webhook_episodes method to TVProcessor class for targeted episode processing
- Implement helper methods: _parse_episode_from_filename, _get_sonarr_series_metadata, _get_episode_metadata, _extract_title_from_filename, _get_webhook_episode_date
- Enables webhook-based episode processing with title extraction and metadata handling
- Resolves 'TVProcessor' object has no attribute 'process_webhook_episodes' error
- Version bump to 2.0.10
2025-10-09 18:04:19 -04:00
sbcrumb 5ade28c118 fix: Only fallback to airdate when Sonarr has no import date
Local Docker Build (Dev) / build-dev (pull_request) Successful in 23s
- Modified fallback logic to only use airdate as dateadded when source is NOT 'sonarr:history.import'
- This prevents using airdate fallback when Sonarr has valid import dates available
- Ensures Sonarr import dates are prioritized over airdate fallbacks
- Addresses issue where episodes with valid Sonarr import dates were still falling back to airdates
2025-10-05 10:42:35 -04:00
sbcrumb 191e6f5f3f fix: Use Sonarr import history for TV episode date detection
- Modified _get_sonarr_episodes to call get_episode_import_history() for each episode
- This retrieves actual import dates from Sonarr's history API instead of just episodeFile.dateAdded
- Added fallback to episodeFile.dateAdded if history lookup fails
- Updated source tracking to use 'sonarr:history.import' for better debugging
- Added debug logging to show which method found the import date
- Should resolve issue where episodes fall back to aired dates despite valid Sonarr imports
2025-10-05 10:29:13 -04:00
sbcrumb 0980ba0761 Fix TV processing issues: correct method names and add missing episode air date method
Local Docker Build (Dev) / build-dev (pull_request) Successful in 24s
- Fix SonarrClient method call from get_series_by_imdb to series_by_imdb
- Fix SonarrClient method call from get_episodes to episodes_for_series
- Add missing get_episode_air_date method to ExternalClientManager
- Method uses TMDB and OMDb APIs to fetch episode air dates
- Version bump to 2.0.7
2025-10-04 11:41:35 -04:00
sbcrumb 72614af928 Remove monolithic nfoguard.py and add comprehensive debug logging
- Remove 2467-line monolithic nfoguard.py file to prevent confusion
- Add debug prints to identify why NFO metadata isn't being added
- Track config.manage_nfo values and function calls
- Debug dateadded parameter passing through all tiers
- Update version to 2.0.2
- This will help identify if manage_nfo is disabled or function not called
2025-10-04 11:00:21 -04:00
sbcrumb 82eb29fd63 feat: implement comprehensive async I/O capabilities
Local Docker Build (Dev) / build-dev (pull_request) Successful in 20s
- Add utils/async_file_utils.py with aiofiles-based operations
- Create core/async_nfo_manager.py for concurrent NFO processing
- Add async methods to TVProcessor for concurrent episode handling
- Implement async_find_episodes_on_disk() for faster scanning
- Add async_batch_create_episode_nfos() for concurrent NFO creation
- Support async_process_multiple_series() for parallel processing
- Optimize I/O performance for large media libraries
- Enable controlled concurrency with semaphores and rate limiting

Performance improvements:
- Concurrent file operations reduce I/O wait times
- Batch processing minimizes individual file access overhead
- Configurable concurrency limits prevent system overload
- Async directory scanning for faster episode discovery
2025-09-27 13:17:54 -04:00
sbcrumb fa1e4e2ec7 improvements (#15)
Build & Push DEV to DockerHub / docker (push) Failing after 1m12s
Reviewed-on: #15
2025-09-27 13:00:08 -04:00
sbcrumb c19d0f6290 update
Local Docker Build (Dev) / build-dev (push) Successful in 28s
2025-09-26 14:56:01 -04:00
sbcrumb b9e3ae3a5e debug: Add extensive logging for episode detection
Local Docker Build (Dev) / build-dev (push) Successful in 29s
Added detailed debug logging to diagnose why High Potential shows "0 episodes" despite having video files:

- Log season directory detection and pattern matching
- Log video file scanning and episode filename parsing
- Log season number extraction and matching logic
- Log final episode count and processing decisions

This will help identify where the episode detection is failing in the pipeline.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 14:37:41 -04:00
sbcrumb 4d30ea840f fix: Add Sonarr direct lookup fallback for reliable series detection
Local Docker Build (Dev) / build-dev (push) Successful in 19s
The /series/lookup endpoint sometimes fails to find series that exist in Sonarr. Added fallback to series_by_imdb_direct() method which scans all series directly.

Changes:
- Try Sonarr lookup endpoint first (fast)
- Fall back to direct series scan if lookup fails (slower but more reliable)
- Apply same logic to both episode dates and metadata methods
- Version bump to 2.0.5-sonarr-direct-lookup

This should find High Potential, Breaking Bad, and other series that exist in Sonarr but weren't found via the lookup endpoint.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 14:14:40 -04:00
sbcrumb 27677e49f8 fix: External API fallback flow and conditional NFO creation
Local Docker Build (Dev) / build-dev (push) Successful in 23s
Fixed two critical issues:
1. External API fallback was never reached because early returns when series/episodes not found in Sonarr
2. tvshow.nfo and season.nfo were always created even if they already existed

Changes:
- Restructured Sonarr lookup to fall through to external APIs when series/episodes not found
- Made tvshow.nfo and season.nfo creation conditional (only if files don't exist)
- Added debug logging for skipped NFO creation
- Version bump to 2.0.4-fallback-fix

Now series like High Potential should properly fall back to TMDB/OMDb for episode airdates.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 14:12:18 -04:00
sbcrumb 2e6d8a35e7 feat: Add external API fallback for TV episode airdates
Local Docker Build (Dev) / build-dev (push) Successful in 19s
When Sonarr lookup fails to find a series or episode data, the system now falls back to external APIs (TMDB, OMDb) to get episode air dates. This ensures episodes still get proper dateadded values even when not found in Sonarr.

Changes:
- Add ExternalClientManager integration to TVSeriesProcessor
- Implement _get_episode_airdate_from_external_apis method
- Support TMDB TV episode lookups with IMDb->TMDB ID conversion
- Support OMDb episode season lookups with date parsing
- Version bump to 2.0.3-external-fallback

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-26 13:56:57 -04:00
sbcrumb b431107abd feat: Complete clean TV NFO processing implementation v2.0.0
Local Docker Build (Dev) / build-dev (push) Successful in 17s
- New EpisodeNFOManager class with video filename matching
- NFO files now match video filenames instead of S01E01.nfo format
- Clean TVSeriesProcessor with proper Sonarr API integration
- Proper date lookup: database -> Sonarr import history -> airdate fallback
- Updated manual scan endpoint to use new clean processor
- Removed all migration logic and nfo_migration_required sources

This is a complete rewrite of TV episode processing with focus on:
1. NFO filenames matching video files
2. Proper dateadded field population from Sonarr
3. Clean separation of concerns
4. Robust fallback logic
2025-09-26 13:39:41 -04:00