fix api order
This commit is contained in:
@ -36,20 +36,6 @@ async def tmdb_season_episodes(tmdbid: int, season: int,
|
||||
return episodes_info
|
||||
|
||||
|
||||
@router.get("/{tmdbid}", summary="TMDB详情", response_model=schemas.MediaInfo)
|
||||
async def tmdb_info(tmdbid: int, type_name: str,
|
||||
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
||||
"""
|
||||
根据TMDBID查询themoviedb媒体信息,type_name: 电影/电视剧
|
||||
"""
|
||||
mtype = MediaType.MOVIE if type_name == MediaType.MOVIE.value else MediaType.TV
|
||||
tmdbinfo = TmdbChain().tmdb_info(tmdbid=tmdbid, mtype=mtype)
|
||||
if not tmdbinfo:
|
||||
return schemas.MediaInfo()
|
||||
else:
|
||||
return MediaInfo(tmdb_info=tmdbinfo).to_dict()
|
||||
|
||||
|
||||
@router.get("/movies", summary="TMDB电影", response_model=List[schemas.MediaInfo])
|
||||
async def tmdb_movies(sort_by: str = "popularity.desc",
|
||||
with_genres: str = "",
|
||||
@ -98,3 +84,17 @@ async def tmdb_trending(page: int = 1,
|
||||
if not infos:
|
||||
return []
|
||||
return [MediaInfo(tmdb_info=info).to_dict() for info in infos]
|
||||
|
||||
|
||||
@router.get("/{tmdbid}", summary="TMDB详情", response_model=schemas.MediaInfo)
|
||||
async def tmdb_info(tmdbid: int, type_name: str,
|
||||
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
||||
"""
|
||||
根据TMDBID查询themoviedb媒体信息,type_name: 电影/电视剧
|
||||
"""
|
||||
mtype = MediaType.MOVIE if type_name == MediaType.MOVIE.value else MediaType.TV
|
||||
tmdbinfo = TmdbChain().tmdb_info(tmdbid=tmdbid, mtype=mtype)
|
||||
if not tmdbinfo:
|
||||
return schemas.MediaInfo()
|
||||
else:
|
||||
return MediaInfo(tmdb_info=tmdbinfo).to_dict()
|
||||
|
Reference in New Issue
Block a user