diff --git a/app/api/endpoints/download.py b/app/api/endpoints/download.py index 6739c1d0..d159f288 100644 --- a/app/api/endpoints/download.py +++ b/app/api/endpoints/download.py @@ -29,6 +29,7 @@ def download( media_in: schemas.MediaInfo, torrent_in: schemas.TorrentInfo, downloader: str = None, + save_path: str = None, current_user: User = Depends(get_current_active_user)) -> Any: """ 添加下载任务(含媒体信息) @@ -47,7 +48,8 @@ def download( media_info=mediainfo, torrent_info=torrentinfo ) - did = DownloadChain().download_single(context=context, username=current_user.name, downloader=downloader) + did = DownloadChain().download_single(context=context, username=current_user.name, + downloader=downloader, save_path=save_path) if not did: return schemas.Response(success=False, message="任务添加失败") return schemas.Response(success=True, data={ @@ -59,6 +61,7 @@ def download( def add( torrent_in: schemas.TorrentInfo, downloader: str = None, + save_path: str = None, current_user: User = Depends(get_current_active_user)) -> Any: """ 添加下载任务(不含媒体信息) @@ -78,7 +81,8 @@ def add( media_info=mediainfo, torrent_info=torrentinfo ) - did = DownloadChain().download_single(context=context, username=current_user.name, downloader=downloader) + did = DownloadChain().download_single(context=context, username=current_user.name, + downloader=downloader, save_path=save_path) if not did: return schemas.Response(success=False, message="任务添加失败") return schemas.Response(success=True, data={