feat:媒体信息聚合
This commit is contained in:
@ -19,7 +19,7 @@ from app.db.message_oper import MessageOper
|
||||
from app.helper.message import MessageHelper
|
||||
from app.log import logger
|
||||
from app.schemas import TransferInfo, TransferTorrent, ExistMediaInfo, DownloadingTorrent, CommingMessage, Notification, \
|
||||
WebhookEventInfo, TmdbEpisode, TmdbPerson
|
||||
WebhookEventInfo, TmdbEpisode, MediaPerson
|
||||
from app.schemas.types import TorrentStatus, MediaType, MediaImageType, EventType
|
||||
from app.utils.object import ObjectUtils
|
||||
|
||||
@ -260,7 +260,7 @@ class ChainBase(metaclass=ABCMeta):
|
||||
"""
|
||||
return self.run_module("search_medias", meta=meta)
|
||||
|
||||
def search_persons(self, name: str) -> Optional[List[TmdbPerson]]:
|
||||
def search_persons(self, name: str) -> Optional[List[MediaPerson]]:
|
||||
"""
|
||||
搜索人物信息
|
||||
:param name: 人物名称
|
||||
|
@ -40,3 +40,18 @@ class BangumiChain(ChainBase, metaclass=Singleton):
|
||||
:param bangumiid: BangumiID
|
||||
"""
|
||||
return self.run_module("bangumi_recommend", bangumiid=bangumiid)
|
||||
|
||||
def person_detail(self, person_id: int) -> dict:
|
||||
"""
|
||||
根据人物ID查询Bangumi人物详情
|
||||
:param person_id: 人物ID
|
||||
"""
|
||||
return self.run_module("bangumi_person_detail", person_id=person_id)
|
||||
|
||||
def person_credits(self, person_id: int, page: int = 1) -> List[dict]:
|
||||
"""
|
||||
根据人物ID查询人物参演作品
|
||||
:param person_id: 人物ID
|
||||
:param page: 页码
|
||||
"""
|
||||
return self.run_module("bangumi_person_credits", person_id=person_id, page=page)
|
||||
|
@ -11,6 +11,21 @@ class DoubanChain(ChainBase, metaclass=Singleton):
|
||||
豆瓣处理链,单例运行
|
||||
"""
|
||||
|
||||
def person_detail(self, person_id: int) -> dict:
|
||||
"""
|
||||
根据人物ID查询豆瓣人物详情
|
||||
:param person_id: 人物ID
|
||||
"""
|
||||
return self.run_module("douban_person_detail", person_id=person_id)
|
||||
|
||||
def person_credits(self, person_id: int, page: int = 1) -> List[dict]:
|
||||
"""
|
||||
根据人物ID查询人物参演作品
|
||||
:param person_id: 人物ID
|
||||
:param page: 页码
|
||||
"""
|
||||
return self.run_module("douban_person_credits", person_id=person_id, page=page)
|
||||
|
||||
def movie_top250(self, page: int = 1, count: int = 30) -> Optional[List[dict]]:
|
||||
"""
|
||||
获取豆瓣电影TOP250
|
||||
|
@ -10,7 +10,7 @@ from app.core.event import eventmanager, Event
|
||||
from app.core.meta import MetaBase
|
||||
from app.core.metainfo import MetaInfo, MetaInfoPath
|
||||
from app.log import logger
|
||||
from app.schemas import TmdbPerson
|
||||
from app.schemas import MediaPerson
|
||||
from app.schemas.types import EventType, MediaType
|
||||
from app.utils.singleton import Singleton
|
||||
from app.utils.string import StringUtils
|
||||
@ -158,7 +158,7 @@ class MediaChain(ChainBase, metaclass=Singleton):
|
||||
return Context(meta_info=file_meta, media_info=mediainfo)
|
||||
|
||||
def search(self, title: str,
|
||||
stype: str = "media") -> Tuple[Optional[MetaBase], List[Union[MediaInfo, TmdbPerson]]]:
|
||||
stype: str = "media") -> Tuple[Optional[MetaBase], List[Union[MediaInfo, MediaPerson]]]:
|
||||
"""
|
||||
搜索媒体/人物信息
|
||||
:param title: 搜索内容
|
||||
|
Reference in New Issue
Block a user