Rename sync_series_from_data_files to sync_legacy_series_to_db

- Rename function to reflect its legacy status
- Add deprecation warning log on execution
- Update all callers (initialization_service, api/config, fastapi_app)
- Update tests to use new name
- Add deprecation notice to DEVELOPMENT.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-05-26 18:45:22 +02:00
parent 53d6da5dac
commit ceb6a2aeb4
8 changed files with 39 additions and 37 deletions

View File

@@ -16,7 +16,7 @@ import pytest
from src.server.services.anime_service import (
AnimeService,
AnimeServiceError,
sync_series_from_data_files,
sync_legacy_series_to_db,
)
from src.server.services.progress_service import ProgressService
@@ -1303,7 +1303,7 @@ class TestGetNFOStatisticsSelfManaged:
class TestSyncSeriesFromDataFiles:
"""Test module-level sync_series_from_data_files function."""
"""Test module-level sync_legacy_series_to_db function."""
@pytest.mark.asyncio
async def test_sync_adds_new_series(self, tmp_path):
@@ -1343,7 +1343,7 @@ class TestSyncSeriesFromDataFiles:
]
MockApp.return_value = mock_app_instance
count = await sync_series_from_data_files(str(tmp_path))
count = await sync_legacy_series_to_db(str(tmp_path))
assert count == 1
mock_create.assert_called_once()
@@ -1382,7 +1382,7 @@ class TestSyncSeriesFromDataFiles:
]
MockApp.return_value = mock_app_instance
count = await sync_series_from_data_files(str(tmp_path))
count = await sync_legacy_series_to_db(str(tmp_path))
assert count == 0
mock_create.assert_not_called()
@@ -1397,7 +1397,7 @@ class TestSyncSeriesFromDataFiles:
mock_app_instance.get_all_series_from_data_files.return_value = []
MockApp.return_value = mock_app_instance
count = await sync_series_from_data_files(str(tmp_path))
count = await sync_legacy_series_to_db(str(tmp_path))
assert count == 0
@@ -1436,7 +1436,7 @@ class TestSyncSeriesFromDataFiles:
]
MockApp.return_value = mock_app_instance
count = await sync_series_from_data_files(str(tmp_path))
count = await sync_legacy_series_to_db(str(tmp_path))
assert count == 1
# The name should have been set to folder