feat 热门动漫
This commit is contained in:
parent
0e35cec6e2
commit
860d55a0e2
@ -139,6 +139,18 @@ def tv_weekly_global(page: int = 1,
|
|||||||
return [MediaInfo(douban_info=tv).to_dict() for tv in tvs]
|
return [MediaInfo(douban_info=tv).to_dict() for tv in tvs]
|
||||||
|
|
||||||
|
|
||||||
|
@router.get("/tv_animation", summary="豆瓣动画剧集", response_model=List[schemas.MediaInfo])
|
||||||
|
def tv_animation(page: int = 1,
|
||||||
|
count: int = 30,
|
||||||
|
db: Session = Depends(get_db),
|
||||||
|
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
||||||
|
"""
|
||||||
|
热门动画剧集
|
||||||
|
"""
|
||||||
|
tvs = DoubanChain(db).tv_animation(page=page, count=count)
|
||||||
|
return [MediaInfo(douban_info=tv).to_dict() for tv in tvs]
|
||||||
|
|
||||||
|
|
||||||
@router.get("/{doubanid}", summary="查询豆瓣详情", response_model=schemas.MediaInfo)
|
@router.get("/{doubanid}", summary="查询豆瓣详情", response_model=schemas.MediaInfo)
|
||||||
def douban_info(doubanid: str,
|
def douban_info(doubanid: str,
|
||||||
db: Session = Depends(get_db),
|
db: Session = Depends(get_db),
|
||||||
|
@ -84,3 +84,9 @@ class DoubanChain(ChainBase):
|
|||||||
"""
|
"""
|
||||||
return self.run_module("douban_discover", mtype=mtype, sort=sort, tags=tags,
|
return self.run_module("douban_discover", mtype=mtype, sort=sort, tags=tags,
|
||||||
page=page, count=count)
|
page=page, count=count)
|
||||||
|
|
||||||
|
def tv_animation(self, page: int = 1, count: int = 30) -> List[dict]:
|
||||||
|
"""
|
||||||
|
获取动画剧集
|
||||||
|
"""
|
||||||
|
return self.run_module("tv_animation", page=page, count=count)
|
||||||
|
@ -369,6 +369,16 @@ class DoubanModule(_ModuleBase):
|
|||||||
return []
|
return []
|
||||||
return infos.get("subject_collection_items")
|
return infos.get("subject_collection_items")
|
||||||
|
|
||||||
|
def tv_animation(self, page: int = 1, count: int = 30) -> List[dict]:
|
||||||
|
"""
|
||||||
|
获取豆瓣动画剧
|
||||||
|
"""
|
||||||
|
infos = self.doubanapi.tv_animation(start=(page - 1) * count,
|
||||||
|
count=count)
|
||||||
|
if not infos:
|
||||||
|
return []
|
||||||
|
return infos.get("subject_collection_items")
|
||||||
|
|
||||||
def search_medias(self, meta: MetaBase) -> Optional[List[MediaInfo]]:
|
def search_medias(self, meta: MetaBase) -> Optional[List[MediaInfo]]:
|
||||||
"""
|
"""
|
||||||
搜索媒体信息
|
搜索媒体信息
|
||||||
|
Loading…
x
Reference in New Issue
Block a user