mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-11 18:10:15 +08:00
downloading api 支持多下载器
This commit is contained in:
@@ -15,12 +15,13 @@ router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/", summary="正在下载", response_model=List[schemas.DownloadingTorrent])
|
||||
def read(
|
||||
def list(
|
||||
name: str = None,
|
||||
_: schemas.TokenPayload = Depends(verify_token)) -> Any:
|
||||
"""
|
||||
查询正在下载的任务
|
||||
"""
|
||||
return DownloadChain().downloading()
|
||||
return DownloadChain().downloading(name)
|
||||
|
||||
|
||||
@router.post("/", summary="添加下载(含媒体信息)", response_model=schemas.Response)
|
||||
|
||||
@@ -886,11 +886,11 @@ class DownloadChain(ChainBase):
|
||||
link=settings.MP_DOMAIN('#/downloading')
|
||||
))
|
||||
|
||||
def downloading(self) -> List[DownloadingTorrent]:
|
||||
def downloading(self, name: str = None) -> List[DownloadingTorrent]:
|
||||
"""
|
||||
查询正在下载的任务
|
||||
"""
|
||||
torrents = self.list_torrents(status=TorrentStatus.DOWNLOADING)
|
||||
torrents = self.list_torrents(downloader=name, status=TorrentStatus.DOWNLOADING)
|
||||
if not torrents:
|
||||
return []
|
||||
ret_torrents = []
|
||||
|
||||
Reference in New Issue
Block a user