This commit is contained in:
jxxghp
2023-06-19 15:44:24 +08:00
parent 6417659f14
commit 5f48d9d4a2
16 changed files with 130 additions and 48 deletions

View File

@ -12,10 +12,10 @@ from app.schemas.types import MediaType
router = APIRouter()
@router.get("/info", response_model=schemas.MediaInfo)
@router.get("/info", summary="TMDB详情", response_model=schemas.MediaInfo)
async def tmdb_info(tmdbid: int, type_name: str) -> Any:
"""
根据TMDBID查询themoviedb媒体信息
根据TMDBID查询themoviedb媒体信息type_name: 电影/电视剧
"""
mtype = MediaType.MOVIE if type_name == MediaType.MOVIE.value else MediaType.TV
tmdbinfo = TmdbChain().tmdb_info(tmdbid=tmdbid, mtype=mtype)
@ -25,7 +25,7 @@ async def tmdb_info(tmdbid: int, type_name: str) -> Any:
return MediaInfo(tmdb_info=tmdbinfo).to_dict()
@router.get("/movies", response_model=List[schemas.MediaInfo])
@router.get("/movies", summary="TMDB电影", response_model=List[schemas.MediaInfo])
async def tmdb_movies(sort_by: str = "popularity.desc",
with_genres: str = "",
with_original_language: str = "",
@ -44,7 +44,7 @@ async def tmdb_movies(sort_by: str = "popularity.desc",
return [MediaInfo(tmdb_info=movie).to_dict() for movie in movies]
@router.get("/tvs", response_model=List[schemas.MediaInfo])
@router.get("/tvs", summary="TMDB剧集", response_model=List[schemas.MediaInfo])
async def tmdb_tvs(sort_by: str = "popularity.desc",
with_genres: str = "",
with_original_language: str = "",
@ -63,7 +63,7 @@ async def tmdb_tvs(sort_by: str = "popularity.desc",
return [MediaInfo(tmdb_info=tv).to_dict() for tv in tvs]
@router.get("/trending", response_model=List[schemas.MediaInfo])
@router.get("/trending", summary="TMDB流行趋势", response_model=List[schemas.MediaInfo])
async def tmdb_trending(page: int = 1,
_: User = Depends(get_current_active_user)) -> Any:
"""