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:
@@ -1554,19 +1554,17 @@ def get_anime_service(series_app: SeriesApp) -> AnimeService:
|
||||
return AnimeService(series_app)
|
||||
|
||||
|
||||
async def sync_series_from_data_files(
|
||||
async def sync_legacy_series_to_db(
|
||||
anime_directory: str,
|
||||
log_instance=None # pylint: disable=unused-argument
|
||||
) -> int:
|
||||
"""
|
||||
Sync series from data files to the database.
|
||||
One-time legacy sync: import any series from 'data' files
|
||||
not already in the database.
|
||||
|
||||
Scans the anime directory for data files and adds any new series
|
||||
to the database. Existing series are skipped (no duplicates).
|
||||
|
||||
This function is typically called during application startup to ensure
|
||||
series metadata stored in filesystem data files is available in the
|
||||
database.
|
||||
Deprecated: Series are now loaded directly from the database.
|
||||
This function remains for backwards compatibility with legacy
|
||||
file-based data during migration.
|
||||
|
||||
Args:
|
||||
anime_directory: Path to the anime directory with data files
|
||||
@@ -1578,6 +1576,11 @@ async def sync_series_from_data_files(
|
||||
"""
|
||||
# Always use structlog for structured logging with keyword arguments
|
||||
log = structlog.get_logger(__name__)
|
||||
|
||||
log.warning(
|
||||
"sync_legacy_series_to_db is deprecated. "
|
||||
"Series are now loaded directly from database."
|
||||
)
|
||||
|
||||
try:
|
||||
from src.server.database.connection import get_db_session
|
||||
|
||||
Reference in New Issue
Block a user