feat: Add NFO metadata infrastructure (Task 3 - partial)
- Created TMDB API client with async requests, caching, and retry logic - Implemented NFO XML generator for Kodi/XBMC format - Created image downloader for poster/logo/fanart with validation - Added NFO service to orchestrate metadata creation - Added NFO-related configuration settings - Updated requirements.txt with aiohttp, lxml, pillow - Created unit tests (need refinement due to implementation mismatch) Components created: - src/core/services/tmdb_client.py (270 lines) - src/core/services/nfo_service.py (390 lines) - src/core/utils/nfo_generator.py (180 lines) - src/core/utils/image_downloader.py (296 lines) - tests/unit/test_tmdb_client.py - tests/unit/test_nfo_generator.py - tests/unit/test_image_downloader.py Note: Tests need to be updated to match actual implementation APIs. Dependencies installed: aiohttp, lxml, pillow
This commit is contained in:
@@ -72,6 +72,43 @@ class Settings(BaseSettings):
|
||||
default=3,
|
||||
validation_alias="RETRY_ATTEMPTS"
|
||||
)
|
||||
|
||||
# NFO / TMDB Settings
|
||||
tmdb_api_key: Optional[str] = Field(
|
||||
default=None,
|
||||
validation_alias="TMDB_API_KEY",
|
||||
description="TMDB API key for scraping TV show metadata"
|
||||
)
|
||||
nfo_auto_create: bool = Field(
|
||||
default=False,
|
||||
validation_alias="NFO_AUTO_CREATE",
|
||||
description="Automatically create NFO files when scanning series"
|
||||
)
|
||||
nfo_update_on_scan: bool = Field(
|
||||
default=False,
|
||||
validation_alias="NFO_UPDATE_ON_SCAN",
|
||||
description="Update existing NFO files when scanning series"
|
||||
)
|
||||
nfo_download_poster: bool = Field(
|
||||
default=True,
|
||||
validation_alias="NFO_DOWNLOAD_POSTER",
|
||||
description="Download poster.jpg when creating NFO"
|
||||
)
|
||||
nfo_download_logo: bool = Field(
|
||||
default=True,
|
||||
validation_alias="NFO_DOWNLOAD_LOGO",
|
||||
description="Download logo.png when creating NFO"
|
||||
)
|
||||
nfo_download_fanart: bool = Field(
|
||||
default=True,
|
||||
validation_alias="NFO_DOWNLOAD_FANART",
|
||||
description="Download fanart.jpg when creating NFO"
|
||||
)
|
||||
nfo_image_size: str = Field(
|
||||
default="original",
|
||||
validation_alias="NFO_IMAGE_SIZE",
|
||||
description="Image size to download (original, w500, etc.)"
|
||||
)
|
||||
|
||||
@property
|
||||
def allowed_origins(self) -> list[str]:
|
||||
|
||||
Reference in New Issue
Block a user