fix: ensure series loaded from DB before NFO scan

- Call _load_series_into_memory() before NFO scan phases to sync DB
  to SeriesApp memory, fixing missing NFO for recently resolved folders
- Add TMDB lookup for series without cached tmdb_id during NFO creation
- Add get_tmdb_client() factory and get_tmdb_image_base_url() helpers
- Fix: use get_tv_show_details instead of deprecated get_series_details
- Fix tests: mock _load_series_into_memory in NFO scan tests
This commit is contained in:
2026-06-10 18:48:45 +02:00
parent e76cd3a708
commit d6082b5cf6
4 changed files with 102 additions and 1 deletions

View File

@@ -532,6 +532,8 @@ class TestPerformNFOScan:
new_callable=AsyncMock, return_value=False), \
patch('src.server.services.initialization_service._is_nfo_scan_configured',
new_callable=AsyncMock, return_value=True), \
patch('src.server.services.initialization_service._load_series_into_memory',
new_callable=AsyncMock), \
patch('src.server.services.initialization_service._execute_nfo_scan',
new_callable=AsyncMock), \
patch('src.server.services.initialization_service._mark_nfo_scan_completed',
@@ -549,6 +551,8 @@ class TestPerformNFOScan:
new_callable=AsyncMock, return_value=False), \
patch('src.server.services.initialization_service._is_nfo_scan_configured',
new_callable=AsyncMock, return_value=True), \
patch('src.server.services.initialization_service._load_series_into_memory',
new_callable=AsyncMock), \
patch('src.server.services.initialization_service._execute_nfo_scan',
new_callable=AsyncMock), \
patch('src.server.services.initialization_service._mark_nfo_scan_completed',