feat: add NfoRepairService for missing NFO tag detection

This commit is contained in:
2026-02-22 11:09:48 +01:00
parent e1abf90c81
commit 3e5ad8a4a6
4 changed files with 326 additions and 0 deletions

View File

@@ -207,6 +207,8 @@ src/core/
| +-- nfo_models.py # Pydantic models for tvshow.nfo (TVShowNFO, ActorInfo…)
+-- services/ # Domain services
| +-- nfo_service.py # NFO lifecycle: create / update tvshow.nfo
| +-- nfo_repair_service.py # Detect & repair incomplete tvshow.nfo files
| | # (parse_nfo_tags, find_missing_tags, NfoRepairService)
| +-- tmdb_client.py # Async TMDB API client
+-- utils/ # Utility helpers (no side-effects)
| +-- nfo_generator.py # TVShowNFO → XML serialiser

View File

@@ -51,6 +51,10 @@ This changelog follows [Keep a Changelog](https://keepachangelog.com/) principle
500 lines and isolate pure mapping logic.
- **US MPAA rating**: `_extract_rating_by_country(ratings, "US")` now maps the
US TMDB content rating to the `<mpaa>` NFO tag.
- **`NfoRepairService` (`src/core/services/nfo_repair_service.py`)**: New service
that detects incomplete `tvshow.nfo` files and triggers TMDB re-fetch.
Provides `parse_nfo_tags()`, `find_missing_tags()`, `nfo_needs_repair()`, and
`NfoRepairService.repair_series()`. 13 required tags are checked.
### Changed