feat: Add 'update' command to NFO CLI tool
- New command: python -m src.cli.nfo_cli update - Updates all existing NFO files with fresh TMDB data - Optionally re-downloads media files - Shows progress with success/error count - Updates task3_status.md to mark update_tvshow_nfo() as complete
This commit is contained in:
@@ -149,23 +149,16 @@ The unit tests were written based on assumptions about the API that don't match
|
||||
|
||||
2. **Unit Test Refactoring** (2-3 hours, optional)
|
||||
|
||||
- Update test_image_downloader.py with dependency injection
|
||||
- Fix test_nfo_generator.py validation tests
|
||||
- Update test_tmdb_client.py mocking strategy
|
||||
- Add test_nfo_service.py with comprehensive tests
|
||||
- ✅ NFO XML parsing tests added (4 tests passing)
|
||||
- ⚠️ TMDBClient tests need refactoring (async mocking challenges)
|
||||
- ⚠️ ImageDownloader tests need dependency injection
|
||||
- Alternative: Replace with more integration tests
|
||||
|
||||
3. **NFOService.update_tvshow_nfo()** (1 hour, optional)
|
||||
|
||||
- Currently raises NotImplementedError
|
||||
- Parse existing NFO to extract TMDB ID
|
||||
- Refetch from TMDB and regenerate
|
||||
- Update media files
|
||||
|
||||
4. **Error Recovery** (1 hour, optional)
|
||||
3. **Enhanced Error Recovery** (1 hour, optional)
|
||||
- Graceful handling if TMDB API fails during scan
|
||||
- Don't block scan if NFO creation fails
|
||||
- Retry queue for failed NFO creations
|
||||
- Enhanced logging for debugging
|
||||
- Background job for bulk operations
|
||||
|
||||
### Future API Integration (Separate Tasks)
|
||||
|
||||
@@ -176,11 +169,13 @@ The unit tests were written based on assumptions about the API that don't match
|
||||
|
||||
## 🐛 Known Issues / Future Enhancements
|
||||
|
||||
1. **NFOService.update_tvshow_nfo()** - Not implemented (optional)
|
||||
1. **NFOService.update_tvshow_nfo()** - ✅ **IMPLEMENTED**
|
||||
|
||||
- Currently raises `NotImplementedError`
|
||||
- Would need to parse existing NFO to extract TMDB ID
|
||||
- Then refetch and regenerate
|
||||
- Parses existing NFO to extract TMDB ID from uniqueid or tmdbid elements
|
||||
- Fetches fresh metadata from TMDB API
|
||||
- Regenerates NFO with updated data
|
||||
- Optionally re-downloads media files
|
||||
- Comprehensive error handling for edge cases
|
||||
|
||||
2. **Unit Tests** - Need refactoring (optional)
|
||||
|
||||
@@ -263,9 +258,9 @@ Task 3 is **95% Complete** and **Production Ready**.
|
||||
|
||||
**Optional Future Work (Not blocking):**
|
||||
|
||||
- Unit test refactoring (mocking strategy needs redesign)
|
||||
- update_tvshow_nfo() implementation
|
||||
- Advanced error recovery features
|
||||
- Unit test refactoring (mocking strategy needs redesign for async code)
|
||||
- ~~update_tvshow_nfo() implementation~~ ✅ **DONE**
|
||||
- Advanced error recovery features (retry queue, background jobs)
|
||||
|
||||
## ⏱️ Time Investment Summary
|
||||
|
||||
|
||||
Reference in New Issue
Block a user