Phase 8: Documentation and deprecation warnings for identifier standardization
- Enhanced infrastructure.md with identifier convention table, format requirements, migration notes - Updated docs/README.md with series identifier convention section - Updated docs/api_reference.md with key-based API examples and notes - Added deprecation warnings to SerieList.get_by_folder() - Added deprecation warnings to anime.py folder fallback lookup - Added deprecation warnings to validate_series_key_or_folder() - All warnings include v3.0.0 removal timeline - All 1006 tests pass
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import logging
|
||||
import warnings
|
||||
from typing import Any, List, Optional
|
||||
|
||||
from fastapi import APIRouter, Depends, HTTPException, status
|
||||
@@ -11,6 +13,8 @@ from src.server.utils.dependencies import (
|
||||
require_auth,
|
||||
)
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
router = APIRouter(prefix="/api/anime", tags=["anime"])
|
||||
|
||||
|
||||
@@ -715,6 +719,21 @@ async def get_anime(
|
||||
for serie in series:
|
||||
if getattr(serie, "folder", None) == anime_id:
|
||||
found = serie
|
||||
# Log deprecation warning for folder-based lookup
|
||||
key = getattr(serie, "key", "unknown")
|
||||
logger.warning(
|
||||
"Folder-based lookup for '%s' is deprecated. "
|
||||
"Use series key '%s' instead. Folder-based lookups "
|
||||
"will be removed in v3.0.0.",
|
||||
anime_id,
|
||||
key
|
||||
)
|
||||
warnings.warn(
|
||||
f"Folder-based lookup for '{anime_id}' is deprecated. "
|
||||
f"Use series key '{key}' instead.",
|
||||
DeprecationWarning,
|
||||
stacklevel=2
|
||||
)
|
||||
break
|
||||
|
||||
if not found:
|
||||
|
||||
Reference in New Issue
Block a user