downloading api

This commit is contained in:
jxxghp
2023-07-02 15:48:18 +08:00
parent 96c7a3fc92
commit 5a5edfb2a3
3 changed files with 27 additions and 2 deletions

View File

@ -1,7 +1,7 @@
from fastapi import APIRouter
from app.api.endpoints import login, user, site, message, webhook, subscribe, \
media, douban, search, plugin, tmdb, history, system
media, douban, search, plugin, tmdb, history, system, download
api_router = APIRouter()
api_router.include_router(login.router, tags=["login"])
@ -17,3 +17,4 @@ api_router.include_router(tmdb.router, prefix="/tmdb", tags=["tmdb"])
api_router.include_router(history.router, prefix="/history", tags=["history"])
api_router.include_router(system.router, prefix="/system", tags=["system"])
api_router.include_router(plugin.router, prefix="/plugin", tags=["plugin"])
api_router.include_router(download.router, prefix="/download", tags=["download"])

View File

@ -0,0 +1,18 @@
from typing import Any, List
from fastapi import APIRouter, Depends
from app import schemas
from app.chain.download import DownloadChain
from app.core.security import verify_token
router = APIRouter()
@router.get("/", summary="正在下载", response_model=List[schemas.DownloadingTorrent])
async def read_subscribes(
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
"""
查询正在下载的任务
"""
return DownloadChain().downloading()