fix: use correct get_anime_service in NFO scan
_execute_nfo_scan() was importing get_anime_service from anime_service.py which is a factory requiring series_app argument. Changed to import from dependencies.py which handles series_app internally and provides proper dependency injection with caching.
This commit is contained in:
@@ -433,8 +433,8 @@ async def _execute_nfo_scan(progress_service=None) -> None:
|
|||||||
Args:
|
Args:
|
||||||
progress_service: Optional ProgressService for emitting updates
|
progress_service: Optional ProgressService for emitting updates
|
||||||
"""
|
"""
|
||||||
from src.server.services.anime_service import get_anime_service
|
|
||||||
from src.server.services.nfo_scan_service import NfoScanService
|
from src.server.services.nfo_scan_service import NfoScanService
|
||||||
|
from src.server.utils.dependencies import get_anime_service
|
||||||
|
|
||||||
logger.info("Starting NFO scan...")
|
logger.info("Starting NFO scan...")
|
||||||
|
|
||||||
|
|||||||
@@ -320,6 +320,8 @@ class TestPerformInitialSetup:
|
|||||||
patch('src.server.services.initialization_service._mark_initial_scan_completed',
|
patch('src.server.services.initialization_service._mark_initial_scan_completed',
|
||||||
new_callable=AsyncMock), \
|
new_callable=AsyncMock), \
|
||||||
patch('src.server.services.initialization_service._load_series_into_memory',
|
patch('src.server.services.initialization_service._load_series_into_memory',
|
||||||
|
new_callable=AsyncMock), \
|
||||||
|
patch('src.server.services.initialization_service.perform_nfo_scan_if_needed',
|
||||||
new_callable=AsyncMock):
|
new_callable=AsyncMock):
|
||||||
result = await perform_initial_setup()
|
result = await perform_initial_setup()
|
||||||
|
|
||||||
@@ -339,6 +341,8 @@ class TestPerformInitialSetup:
|
|||||||
patch('src.server.services.initialization_service._mark_initial_scan_completed',
|
patch('src.server.services.initialization_service._mark_initial_scan_completed',
|
||||||
new_callable=AsyncMock), \
|
new_callable=AsyncMock), \
|
||||||
patch('src.server.services.initialization_service._load_series_into_memory',
|
patch('src.server.services.initialization_service._load_series_into_memory',
|
||||||
|
new_callable=AsyncMock), \
|
||||||
|
patch('src.server.services.initialization_service.perform_nfo_scan_if_needed',
|
||||||
new_callable=AsyncMock):
|
new_callable=AsyncMock):
|
||||||
result = await perform_initial_setup(progress_service=mock_progress)
|
result = await perform_initial_setup(progress_service=mock_progress)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user