Implement optimal caching hierarchy for both movies and TV shows #43

Merged
sbcrumb merged 1 commits from sonarrissues into dev 2025-10-10 16:18:34 -04:00

1 Commits

Author SHA1 Message Date
sbcrumb 7e56ac1601 Implement optimal caching hierarchy for both movies and TV shows
Local Docker Build (Dev) / build-dev (pull_request) Successful in 4s
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 15:47:53 -04:00