更新 douban.py

This commit is contained in:
jxxghp 2024-04-27 22:38:47 +08:00 committed by GitHub
parent e56cfd6ad4
commit ce357540eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,6 @@ from typing import Optional, List
from app import schemas from app import schemas
from app.chain import ChainBase from app.chain import ChainBase
from app.core.config import settings
from app.core.context import MediaInfo from app.core.context import MediaInfo
from app.schemas import MediaType from app.schemas import MediaType
from app.utils.singleton import Singleton from app.utils.singleton import Singleton
@ -78,16 +77,12 @@ class DoubanChain(ChainBase, metaclass=Singleton):
""" """
获取热门电影 获取热门电影
""" """
if settings.RECOGNIZE_SOURCE != "douban":
return None
return self.run_module("movie_hot", page=page, count=count) return self.run_module("movie_hot", page=page, count=count)
def tv_hot(self, page: int = 1, count: int = 30) -> Optional[List[MediaInfo]]: def tv_hot(self, page: int = 1, count: int = 30) -> Optional[List[MediaInfo]]:
""" """
获取热门剧集 获取热门剧集
""" """
if settings.RECOGNIZE_SOURCE != "douban":
return None
return self.run_module("tv_hot", page=page, count=count) return self.run_module("tv_hot", page=page, count=count)
def movie_credits(self, doubanid: str) -> Optional[List[schemas.MediaPerson]]: def movie_credits(self, doubanid: str) -> Optional[List[schemas.MediaPerson]]: