Commit Graph

327 Commits

Author SHA1 Message Date
sbcrumb edaa92ef9a dev (#6)
Local Docker Build (Main) / build (push) Successful in 33s
Local Docker Build (Main) / deploy (push) Successful in 0s
Reviewed-on: #6
2025-09-24 20:06:45 -04:00
sbcrumb c21a0df9c1 Merge pull request 'fix: nfo' (#5) from nfofix into dev
Local Docker Build (Dev) / build-dev (push) Successful in 28s
Local Docker Build (Main) / build (pull_request) Successful in 23s
Local Docker Build (Main) / deploy (pull_request) Has been skipped
Reviewed-on: #5
2025-09-24 19:36:18 -04:00
sbcrumb 27430a7ead fix: nfo
Local Docker Build (Dev) / build-dev (pull_request) Successful in 23s
2025-09-24 19:35:39 -04:00
sbcrumb 210af8ac4b tv-nfo (#4)
Local Docker Build (Dev) / build-dev (push) Successful in 23s
Reviewed-on: #4
Co-authored-by: SBCrumb <sbcrumb@kickthetree.com>
Co-committed-by: SBCrumb <sbcrumb@kickthetree.com>
2025-09-24 18:53:48 -04:00
sbcrumb ca2e77f4c7 remove .local
Local Docker Build (Dev) / build-dev (push) Successful in 17s
2025-09-24 15:14:40 -04:00
sbcrumb 70cc716cb8 remove .local
Local Docker Build (Main) / build (push) Successful in 24s
Local Docker Build (Main) / deploy (push) Successful in 0s
2025-09-24 15:14:18 -04:00
sbcrumb 18b6dad7ce Merge branch 'dev'
Local Docker Build (Main) / build (push) Successful in 23s
Local Docker Build (Main) / deploy (push) Successful in 0s
2025-09-24 15:11:24 -04:00
sbcrumb bd9ce8f48d feat: NFOGuard v1.8.0 - Comprehensive three-tier optimization system with international fallback
Local Docker Build (Main) / build (push) Successful in 19s
Local Docker Build (Main) / deploy (push) Successful in 0s
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.
2025-09-24 14:19:31 -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 bd7538abbd feat: Add dedicated failed movies debug log
Local Docker Build (Dev) / build-dev (push) Successful in 24s
Local Docker Build (Main) / build (pull_request) Successful in 20s
Local Docker Build (Main) / deploy (pull_request) Has been skipped
- Create logs/failed_movies.log for movies with no_valid_date_source
- Logs movie name, IMDb ID, failure reason, and timestamp
- Helps users identify problematic movies needing manual attention
- Useful for debugging API issues and monitoring system health
- Documented in SUMMARY.md action items for troubleshooting workflow
2025-09-24 14:10:02 -04:00
sbcrumb aa9f9d9194 feat: Prioritize English-speaking countries in release date fallback
Local Docker Build (Dev) / build-dev (push) Successful in 26s
- Add two-tier international fallback: English-speaking first, then any country
- English-speaking countries: GB, CA, AU, NZ, IE
- For The Fabric of Christmas (2023): will try AU, CA before BE
- Maintains cultural relevance while ensuring comprehensive coverage
- Clear logging shows which tier is used for transparency
2025-09-24 14:06:11 -04:00
sbcrumb fc3bd67138 feat: Add international release date fallback for movies without US dates
Local Docker Build (Dev) / build-dev (push) Successful in 28s
- Add fallback logic to use any available country when US release dates unavailable
- Maintains same release type priority (Digital, Physical, Theatrical)
- Should resolve The Fabric of Christmas (2023) no_valid_date_source issue
- Logs which country is used as fallback for transparency
- Available countries for this movie: AU, BE, CA
2025-09-24 14:05:10 -04:00
sbcrumb f49b1632fd fix: Add missing ElementTree import and use tolerant XML parser
Local Docker Build (Dev) / build-dev (push) Successful in 24s
- Add missing xml.etree.ElementTree import to nfoguard.py
- Fix _extract_dates_from_tmdb_nfo to use tolerant XML parser
- Resolves 'name ET is not defined' error in TMDB fallback processing
- For the One (2024) should now process successfully with premiered date
2025-09-24 13:58:00 -04:00
sbcrumb 830c1d9ae4 fix: Use tolerant XML parser for TMDB ID detection in NFO files
Local Docker Build (Dev) / build-dev (push) Successful in 20s
- Replace ET.parse() with _parse_nfo_with_tolerance() in parse_imdb_from_nfo
- Handles NFO files with URLs appended after </movie> tag
- Should resolve For the One (2024) TMDB ID detection issue
- NFO had TMDB ID 1339758 but trailing URLs prevented XML parsing
2025-09-24 13:53:52 -04:00
sbcrumb bfdf02ebd1 fix: Improve TMDB fallback detection and logging for movies without IMDb IDs
Local Docker Build (Dev) / build-dev (push) Successful in 21s
- Update find_movie_imdb_id to properly log TMDB vs IMDb ID detection
- Fix error message to indicate search for both IMDb AND TMDB IDs
- Add critical workflow reminder to SUMMARY.md for code-only development
- Should resolve For the One (2024) processing with TMDB ID 1339758
2025-09-24 13:49:54 -04:00
sbcrumb 994f430d45 feat: Implement comprehensive three-tier optimization system for movies and TV episodes
Local Docker Build (Dev) / build-dev (push) Successful in 24s
- Add NFO file extraction for TV episodes with dateadded detection
- Extend three-tier optimization (NFO cache, DB cache, full processing) to TV episodes
- Add TMDB ID fallback support for movies without IMDb IDs
- Implement Tier 1.5 processing for TMDB-only movies using premiered dates
- Update documentation with complete TV episode optimization details
- Add database rebuild capabilities for both movies and TV content
- Performance improvements eliminate 90%+ of processing time on warm systems
2025-09-24 13:37:01 -04:00
sbcrumb ea661bcd45 feat: Add TMDB ID detection for movies without IMDb IDs
Local Docker Build (Dev) / build-dev (push) Successful in 23s
Added fallback detection for movies that only have TMDB IDs in NFO files.
When no IMDb ID is found, the system now:

- Detects TMDB ID from <uniqueid type="tmdb"> elements
- Logs a helpful warning with the TMDB ID for manual lookup
- Provides clear guidance that manual IMDb lookup may be needed

This helps identify movies like "For the One (2024)" that have TMDB data
but are missing IMDb identifiers, allowing users to manually add IMDb IDs
to directory names or filenames when available.

Future enhancement: Could implement TMDB->IMDb API conversion.
2025-09-24 12:36:16 -04:00
sbcrumb d6d24e8840 feat: Add three-tier optimization for TV episodes
Local Docker Build (Dev) / build-dev (push) Successful in 24s
Extended the revolutionary three-tier performance system to TV episodes:

TIER 1 (Fastest): Episode NFO File Check
- Detects existing NFOGuard data in episode NFO files (dateadded + lockdata)
- Skips all database queries AND Sonarr API calls
- Perfect for database rebuilds from existing episode NFO files

TIER 2 (Fast): Episode Database Check
- Uses complete episode database entries when available
- Skips expensive Sonarr API calls for series/episode metadata
- Creates NFO from cached data only

TIER 3 (Normal): Full Episode Processing
- Only when neither NFO nor database have data
- Queries Sonarr APIs, processes dates, enhanced metadata

TV shows now benefit from same performance improvements as movies:
- Database rebuilds from existing NFO files (instant)
- Subsequent scans 90%+ faster for processed episodes
- Large TV libraries process efficiently with intelligent caching

This completes the performance optimization system across all media types.
2025-09-24 11:29:20 -04:00
sbcrumb 3889d3a31c feat: Add three-tier optimization for maximum performance
Local Docker Build (Dev) / build-dev (push) Successful in 19s
Implemented smart caching system that dramatically reduces processing time:

TIER 1 (Fastest): NFO File Check
- If NFO already has NFOGuard dateadded + lockdata, use it directly
- Skips both database queries AND API calls
- Perfect for movies already processed by NFOGuard

TIER 2 (Fast): Database Check
- If database has complete dateadded data, use it
- Skips expensive API calls to TMDB/OMDB/Radarr
- Creates NFO from cached data

TIER 3 (Slowest): Full Processing
- Only when neither NFO nor database have data
- Queries all APIs, processes dates, saves to database

This should dramatically improve full scan performance, especially
on subsequent runs where most movies already have NFOGuard data.

Expected speedup: 90%+ reduction in processing time for warm scans.
2025-09-24 11:21:38 -04:00
sbcrumb 172a364e6e debug: Add IMDb ID detection logging and database-first optimization
Local Docker Build (Dev) / build-dev (push) Successful in 18s
Added comprehensive debugging for IMDb ID detection to identify issues
with directories that don't have IMDb IDs in folder names but do have
them in filenames (like Adulthood (2025) [tt26657977]).

Also added database-first optimization that skips expensive API calls
when we already have complete data in the database. This should:
- Speed up full rescans significantly
- Reduce unnecessary API calls to TMDB/OMDB/Radarr
- Keep database size appropriate by not re-querying known movies

This should resolve both the small database size issue and improve
performance for movies that already have valid dateadded entries.
2025-09-24 11:16:56 -04:00
sbcrumb ed03f23272 fix: Move NFOGuard comment to bottom with other fields
Local Docker Build (Dev) / build-dev (push) Successful in 24s
Moved the NFOGuard source comment from the top of the XML file to
just before our field additions at the bottom. This creates a clear
separation showing where NFOGuard's modifications begin.

Expected structure:
[existing rich metadata]
<!-- NFOGuard - Source: tmdb:digital -->
<uniqueid type="imdb" default="true">tt123</uniqueid>
<premiered>2024-08-20</premiered>
<dateadded>2024-08-20T00:00:00+00:00</dateadded>
<lockdata>true</lockdata>
2025-09-24 10:08:10 -04:00
sbcrumb fc3c190c1b fix: Ensure NFOGuard fields are appended at bottom of NFO files
Local Docker Build (Dev) / build-dev (push) Successful in 24s
Changed from ET.SubElement() to ET.Element() + explicit append() to
guarantee that NFOGuard-managed fields appear at the very bottom of
NFO files after all existing content.

This is critical because:
- Emby plugin specifically looks for dateadded field
- All NFOGuard fields should be grouped together at the bottom
- Preserves existing rich metadata while clearly marking our additions

Added debug logging for dateadded field to confirm it's being written.
2025-09-24 10:06:29 -04:00
sbcrumb 17914ff8f4 debug: Add NFO creation debugging for Inside Out 2 issue
Local Docker Build (Dev) / build-dev (push) Successful in 22s
Added debug logging to understand why rich existing NFO metadata
isn't being preserved when NFOGuard updates files.

This will show:
- Parameters passed to create_movie_nfo
- Whether existing premiered dates are being preserved
- Why NFOGuard fields aren't being added to the bottom

This should help diagnose why Inside Out 2 NFO isn't getting
NFOGuard's dateadded and lockdata fields appended.
2025-09-24 10:02:52 -04:00
sbcrumb bf7ee784a6 debug: Add logging to diagnose Flow movie processing issue
Local Docker Build (Dev) / build-dev (push) Successful in 23s
Added debug logs to understand why Flow (2019) isn't calling external APIs
while Ambush (2023) works correctly. This will show:

- should_query calculation and reasoning
- _decide_movie_dates entry point and logic path
- Whether existing database data is being used incorrectly

This should help identify why digital release date lookup works for some
movies but not others with identical database states.
2025-09-24 09:11:28 -04:00
sbcrumb e995c27655 fix: Query external APIs when database entry has no dateadded
Local Docker Build (Dev) / build-dev (push) Successful in 18s
The system was skipping external API calls when a database entry existed
but had no useful data (dateadded: None). This caused movies to get minimal
NFO files even when digital release dates were available.

Added condition to should_query logic: also query APIs when we have an
existing database entry but no dateadded value.

This fixes the Flow (2019) issue where it should fetch digital release
dates from TMDB/OMDB but was returning "no_valid_date_source" instead.
2025-09-24 08:49:46 -04:00
sbcrumb 03a71527b4 feat: Add version-gitea tags to main branch builds
Local Docker Build (Dev) / build-dev (push) Successful in 11s
Updated main workflow to create version-gitea tagged images
(e.g. 1.7.0-gitea) alongside the standard latest tag.

This provides clear identification that the image came from
the Gitea build system and includes the version number for
easy tracking.

Main branch images will now be available as:
- sbcrumb/nfoguard:latest (standard)
- sbcrumb/nfoguard:1.7.0-gitea (versioned Gitea build)
2025-09-24 08:39:49 -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 5e36796e7e fix: Update CI workflows to use correct repository paths
Local Docker Build (Dev) / build-dev (push) Successful in 18s
Updated both main and dev workflows to use sbcrumb/nfoguard instead of
jskala/NFOguard for repository cloning and Docker registry paths.

This fixes the build failures where workflows were trying to clone from
the old repository location that no longer exists.

Changes:
- Updated git clone URLs in both ci.yml and ci-dev.yml
- Fixed Docker registry paths for image tagging and pushing
- Updated cache image manifest checking paths
2025-09-24 08:34:23 -04:00
sbcrumb c983e93a76 fix: Use release dates as dateadded fallback when import dates unavailable
Local Docker Build (Dev) / build-dev (push) Failing after 0s
When Radarr can't provide import/download dates, the system now properly
uses digital release dates, theatrical dates, or air dates as the dateadded
value for both NFO files and database storage.

This fixes the issue where movies would get minimal NFO content with
"no_valid_date_source" when valid release dates were available but not
being saved to the database for future use.

Key changes:
- Use release date as dateadded when import date is None but release date exists
- Ensure all found dates are saved to database for future manual scans
- Maintain proper source tracking for debugging
- Fix NFO files getting minimal content when valid dates exist
2025-09-24 08:31:12 -04:00
sbcrumb d854233470 docs: Document successful GitHub synchronization resolution
- Record repository sync status and resolution steps
- Explain GitHub force-push timestamp behavior
- Document current synchronized state between Gitea and GitHub
- Clarify expected 1-commit differential due to private file exclusion
2025-09-23 17:54:52 -04:00
sbcrumb 8329098590 docs: Update SUMMARY.md with enhanced workflow and privacy protection details
Local Docker Build (Main) / build (push) Successful in 14s
Local Docker Build (Main) / deploy (push) Successful in 0s
Local Docker Build (Dev) / build-dev (push) Successful in 18s
- Document emergency privacy breach resolution
- Add professional Git workflow documentation
- Detail protection features and command safeguards
- Include code examples of privacy protection measures
2025-09-23 17:50:20 -04:00
sbcrumb a99fb3e9c9 enhance: Add intelligent workflow guidance and error handling
- Command suggestions for typos and alternatives
- Workflow state analysis with next steps
- Enhanced error messages with examples
- Progress indicators throughout workflow
- Automated guidance for feature development
2025-09-23 17:40:07 -04:00
sbcrumb d85d9bf63a update: template
Local Docker Build (Main) / build (push) Successful in 23s
Local Docker Build (Main) / deploy (push) Successful in 1s
2025-09-23 17:24:57 -04:00
sbcrumb 4ba9611b70 Merge pull request 'Update README.md' (#1) from dev into main
Local Docker Build (Main) / build (push) Successful in 29s
Local Docker Build (Dev) / build-dev (push) Successful in 19s
Local Docker Build (Main) / deploy (push) Successful in 0s
Reviewed-on: #1
2025-09-23 17:21:42 -04:00
sbcrumb e90dcb2f6b Update README.md
Local Docker Build (Dev) / build-dev (push) Successful in 33s
Local Docker Build (Main) / build (pull_request) Successful in 23s
Local Docker Build (Main) / deploy (pull_request) Has been skipped
2025-09-23 17:20:40 -04:00
sbcrumb 053a29ba8f fix: Update workflow configuration for current deployment setup
Local Docker Build (Main) / build (push) Successful in 24s
Local Docker Build (Main) / deploy (push) Successful in 0s
Local Docker Build (Dev) / build-dev (push) Successful in 28s
- Align repository references with current infrastructure
- Update Docker registry namespace consistency
- Ensure proper CI/CD pipeline functionality
2025-09-23 16:27:31 -04:00
sbcrumb 7ad0dd8ca2 feat: NFOGuard v1.7.2 - Complete media management system
Local Docker Build (Dev) / build-dev (push) Failing after 0s
Local Docker Build (Main) / build (push) Failing after 0s
Local Docker Build (Main) / deploy (push) Has been skipped
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
2025-09-23 16:12:58 -04:00
jskala 3a31ba8866 Merge pull request 'plugin-update' (#21) from plugin-update into dev
Reviewed-on: jskala/NFOguard#21
2025-09-23 12:17:55 -04:00
sbcrumb 814156035e update: Version bump for emby-plugin 2025-09-23 12:17:55 -04:00
sbcrumb c24625274e docs: Add critical .local directory security reminder
- Emphasize .local/ must NEVER be committed to GitHub
- Document security breach procedures if .local/ exposed publicly
- Reinforce that .local/ contains sensitive development information
- Add warning about privacy violations and Claude attribution details
2025-09-23 12:17:55 -04:00
sbcrumb c2dc0b2beb fix: Clean up commit template
- Remove co-authorship lines from template
- Keep template clean for releases
2025-09-22 14:26:49 -04:00
sbcrumb 3e017a3d17 Merge branch 'main' into dev 2025-09-22 14:23:10 -04:00
sbcrumb 91e749ccdc restore: Add .local development documentation back to Gitea
- Restore .local/ directory with all development documentation
- Files include SUMMARY.md, commit.md, workflow.md, and setup templates
- These files stay local and in Gitea only (excluded from GitHub)
2025-09-22 14:20:22 -04:00
sbcrumb 4d1dc3b06f fix: Configure .local/ directory as Gitea-only (not GitHub)
- Add .local/ to .gitignore to exclude from GitHub releases
- .local/ contains private development documentation and notes
- Files remain available locally and in Gitea for development reference
2025-09-22 13:59:14 -04:00
sbcrumb 41ece0af86 Establish shared history with GitHub main 2025-09-22 12:35:59 -04:00
sbcrumb 1848ed61bf Merge branch 'dev' 2025-09-22 12:24:04 -04:00
sbcrumb c04fe8d083 debug optional 2025-09-22 12:18:40 -04:00
sbcrumb 3e5c80279f fix: nfo logic long vs shortname 2025-09-22 11:02:12 -04:00
sbcrumb de3896b8c3 fix: add debug for .nfo ussues 2025-09-22 10:54:22 -04:00
jskala b1484641d9 fix: update tv .nfo handling
updated TV .nfo handling
2025-09-22 10:52:20 -04:00