feat 支持Emby/Jellyfin登录认证

This commit is contained in:
jxxghp
2023-06-20 13:09:11 +08:00
parent 47f5942e22
commit 0776a0b235
17 changed files with 117 additions and 87 deletions

View File

@ -4,8 +4,7 @@ from fastapi import APIRouter, Depends
from app import schemas
from app.chain.search import SearchChain
from app.db.models.user import User
from app.db.userauth import get_current_active_user
from app.core.security import verify_token
from app.schemas.types import MediaType
router = APIRouter()
@ -14,7 +13,7 @@ router = APIRouter()
@router.get("/tmdbid", summary="精确搜索资源", response_model=List[schemas.Context])
async def search_by_tmdbid(tmdbid: int,
mtype: str = None,
_: User = Depends(get_current_active_user)) -> Any:
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
"""
根据TMDBID精确搜索站点资源
"""
@ -26,7 +25,7 @@ async def search_by_tmdbid(tmdbid: int,
@router.get("/title", summary="模糊搜索资源", response_model=List[schemas.TorrentInfo])
async def search_by_title(title: str,
_: User = Depends(get_current_active_user)) -> Any:
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
"""
根据名称模糊搜索站点资源
"""