Commit Graph

223 Commits

Author SHA1 Message Date
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 acf741e6bb Add missing psutil dependency to complete requirements
Local Docker Build (Dev) / build-dev (pull_request) Successful in 34s
- Add psutil==5.9.6 for monitoring metrics functionality
- Container confirmed: manage_nfo=True (NFO creation enabled)
- All external dependencies now included in requirements.txt
- Version bump to 2.0.6 for complete dependency resolution
2025-10-04 11:12:23 -04:00
sbcrumb 17aec56952 Add missing aiohttp dependency to requirements.txt
Local Docker Build (Dev) / build-dev (pull_request) Successful in 24s
- Add aiohttp==3.8.6 to fix ModuleNotFoundError in runtime_validator
- Container now shows config: manage_nfo=True (confirms NFO creation enabled)
- Version bump to 2.0.5
2025-10-04 11:08:58 -04:00
sbcrumb d0e4182d38 Fix missing Tuple import in async_nfo_manager.py
Local Docker Build (Dev) / build-dev (pull_request) Successful in 24s
- Add Tuple to typing imports to resolve NameError
- Fixes container startup failure after modular refactoring
- Version bump to 2.0.4
2025-10-04 11:06:07 -04:00
sbcrumb 08ff77760b Resolve VERSION conflict: keep 2.0.3 for Docker fixes
Local Docker Build (Dev) / build-dev (pull_request) Successful in 23s
2025-10-04 11:04:27 -04:00
sbcrumb 4c2ebae4dc Fix Docker entrypoint to use modular main.py instead of monolithic nfoguard.py
Local Docker Build (Dev) / build-dev (pull_request) Successful in 24s
- Update Dockerfile to exec main.py instead of deleted nfoguard.py
- Fixes container startup failure after monolithic code removal
- Version bump to 2.0.3 for Docker compatibility fix
2025-10-04 11:01:56 -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 863019f42a Remove monolithic nfoguard.py and add comprehensive debug logging
Local Docker Build (Dev) / build-dev (pull_request) Successful in 24s
- 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
- This will help identify if manage_nfo is disabled or function not called

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-10-04 10:57:50 -04:00
sbcrumb 9f86b02665 fix: fixing webhook processing
Local Docker Build (Dev) / build-dev (pull_request) Successful in 19s
2025-10-02 16:31:07 -04:00
sbcrumb 09612aeb4e version: Update to 2.0.0 for major architecture and code quality improvements
Local Docker Build (Dev) / build-dev (push) Successful in 17s
- Bump version to 2.0.0 to reflect major changes
- Represents completion of modular architecture transformation
- Includes comprehensive code quality improvements (Phase 3)
- All new utility modules and error handling systems
- Breaking changes: modular structure, new import paths
2025-09-27 13:09:46 -04:00
sbcrumb ce1a599fd9 stop tvshow.nfo and show.nfo
Local Docker Build (Dev) / build-dev (push) Successful in 28s
Local Docker Build (Main) / build (pull_request) Successful in 24s
Local Docker Build (Main) / deploy (pull_request) Has been skipped
2025-09-26 17:07:12 -04:00
sbcrumb 3826895275 title search
Local Docker Build (Dev) / build-dev (push) Successful in 28s
2025-09-26 16:59:12 -04:00
sbcrumb d2ad048f61 tv update again
Local Docker Build (Dev) / build-dev (push) Successful in 28s
2025-09-26 16:49:57 -04:00
sbcrumb 3d7460ad76 verixon update
Local Docker Build (Dev) / build-dev (push) Successful in 33s
2025-09-26 16:25:08 -04:00
sbcrumb 806370bd5f airdate fallback
Local Docker Build (Dev) / build-dev (push) Successful in 29s
2025-09-26 15:56:40 -04:00
sbcrumb 2c4dd274ff retry for the AI
Local Docker Build (Dev) / build-dev (push) Successful in 16s
2025-09-26 15:19:37 -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 12767d7350 fix: Remove invalid webhook_secret parameter from SonarrClient
Local Docker Build (Dev) / build-dev (push) Successful in 23s
SonarrClient constructor only accepts base_url and api_key parameters.
Version bump to 2.0.2-clean
2025-09-26 13:47:11 -04:00
sbcrumb 4411804725 fix: Sonarr client initialization error
Local Docker Build (Dev) / build-dev (push) Successful in 24s
Fix AttributeError for missing sonarr_url config attributes.
Use environment variables directly like the original code.
Version bump to 2.0.1-clean
2025-09-26 13:45:16 -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
sbcrumb 9b0da8b6ed fix: Remove nfo_migration_required source and ensure proper date lookup
Local Docker Build (Dev) / build-dev (push) Successful in 49s
- Remove bogus 'nfo_migration_required' source that bypassed proper date lookup
- Ensure episodes with existing NFOs still get processed through Sonarr API
- Episodes should get proper dateadded from Sonarr import history or airdate fallback
- Version bump to 1.9.3-longnames
2025-09-26 10:11:52 -04:00
sbcrumb 9bc8955ad4 fix: Preserve and convert NFO filenames to match video files
Local Docker Build (Dev) / build-dev (push) Successful in 23s
- Preserve existing long-named NFO files instead of migrating to short names
- Convert existing short NFO names (S01E01.nfo) to match video filenames
- Create new NFOs with long names based on matching video files
- Only fallback to short names if no matching video file exists
2025-09-26 09:56:23 -04:00
sbcrumb f515d70241 version: Update version to 1.9.1 o push to github
Local Docker Build (Dev) / build-dev (push) Successful in 24s
Local Docker Build (Main) / build (pull_request) Successful in 1m1s
Local Docker Build (Main) / deploy (pull_request) Has been skipped
2025-09-25 14:38:17 -04:00
sbcrumb 2b6fd27913 Fix movie webhook comprehensive IMDb detection and batch processing
Local Docker Build (Dev) / build-dev (push) Successful in 28s
Local Docker Build (Main) / build (pull_request) Successful in 24s
Local Docker Build (Main) / deploy (pull_request) Has been skipped
- Fix movie webhook to use comprehensive IMDb detection (dir, filename, movie.nfo) instead of simple string search
- Fix batch processing NameError: use path_obj instead of undefined path variable
- Version bump to 1.8.3

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 13:31:27 -04:00
sbcrumb b4fe0cb7fe bump: Version 1.8.2 with title extraction functionality
Local Docker Build (Dev) / build-dev (push) Successful in 28s
2025-09-25 09:26:09 -04:00
sbcrumb c9567ce70b update: update version number 2025-09-25 09:15:07 -04:00
sbcrumb 0bd7c3f883 bump: Update VERSION to 1.8.0 for major release
Local Docker Build (Dev) / build-dev (push) Successful in 28s
Comprehensive three-tier optimization system with international fallback support
2025-09-24 14:18:21 -04:00
sbcrumb 99ffc08c9b feat: Add version-specific dev tags for easier identification
Local Docker Build (Dev) / build-dev (push) Successful in 24s
- Bump version to 1.7.0 for NFO release date fix
- Add version-dev-gitea tag format (e.g. 1.7.0-dev-gitea)
- Push version tag to Gitea registry alongside dev tag
- Update build output to show clear pull command

This makes it easy to identify which dev build you're running
and ensures you get the latest Gitea dev build with the NFO fixes.
2025-09-24 08:38:22 -04:00
sbcrumb c04fe8d083 debug optional 2025-09-22 12:18:40 -04:00
sbcrumb de3896b8c3 fix: add debug for .nfo ussues 2025-09-22 10:54:22 -04:00
sbcrumb fa3f41e6fd update Dev 2025-09-21 09:32:27 -04:00
sbcrumb b881c7944c initial updates to mirror github files 2025-09-21 09:30:12 -04:00
sbcrumb c6d5d2e6dc updates 2025-09-21 09:28:06 -04:00
sbcrumb 22483717c4 initial update 2025-09-21 09:25:36 -04:00
sbcrumb 4eeb30a922 chore: update version number 2025-09-19 08:18:04 -04:00
sbcrumb 539b09fc5b update to TVDB 2025-09-17 15:32:34 -04:00
sbcrumb 532ea02a5b update to docker 2025-09-17 15:23:29 -04:00
sbcrumb d64228cc82 Add NFO-based identification and smart episode renaming v1.6.0
- Add dual identification system: directory names + NFO file parsing
- Support <uniqueid type="imdb">, <imdbid>, <imdb> XML tags
- Implement smart episode NFO renaming to S##E##.nfo format
- Detect existing Sonarr/other NFO files and preserve metadata
- Add comprehensive Project.md for context recovery
- Update documentation with new capabilities
2025-09-16 21:14:09 -04:00
sbcrumb 220ca3ab5f Fix VERSION conflict and add v1.5.5 release notes 2025-09-16 16:08:37 -04:00
sbcrumb 768eb01563 update version number 2025-09-16 16:04:15 -04:00
sbcrumb 5e2a3b1aba Fix Docker build with PostgreSQL dependencies 2025-09-16 15:59:13 -04:00
sbcrumb 339d023b85 update to python 3.13 2025-09-16 15:38:51 -04:00
sbcrumb 1353b53cc8 CRITICAL: Fix database upsert bug preventing manual scan date persistence
**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
2025-09-15 12:18:53 -04:00
sbcrumb ed4a9c0a19 Fix Radarr rename event handling - add missing event type filtering
- Add event type filtering to Radarr webhook handler (Download, Upgrade, Rename)
- Ensures consistency with Sonarr webhook processing
- Fixes issue where Radarr rename events weren't properly updating NFO files
- Bump version to v1.5.3
- Update SUMMARY.md with complete webhook workflow documentation
2025-09-15 09:35:41 -04:00