mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-11 02:31:25 +08:00
fix download api add save_path
This commit is contained in:
@@ -29,6 +29,7 @@ def download(
|
|||||||
media_in: schemas.MediaInfo,
|
media_in: schemas.MediaInfo,
|
||||||
torrent_in: schemas.TorrentInfo,
|
torrent_in: schemas.TorrentInfo,
|
||||||
downloader: str = None,
|
downloader: str = None,
|
||||||
|
save_path: str = None,
|
||||||
current_user: User = Depends(get_current_active_user)) -> Any:
|
current_user: User = Depends(get_current_active_user)) -> Any:
|
||||||
"""
|
"""
|
||||||
添加下载任务(含媒体信息)
|
添加下载任务(含媒体信息)
|
||||||
@@ -47,7 +48,8 @@ def download(
|
|||||||
media_info=mediainfo,
|
media_info=mediainfo,
|
||||||
torrent_info=torrentinfo
|
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:
|
if not did:
|
||||||
return schemas.Response(success=False, message="任务添加失败")
|
return schemas.Response(success=False, message="任务添加失败")
|
||||||
return schemas.Response(success=True, data={
|
return schemas.Response(success=True, data={
|
||||||
@@ -59,6 +61,7 @@ def download(
|
|||||||
def add(
|
def add(
|
||||||
torrent_in: schemas.TorrentInfo,
|
torrent_in: schemas.TorrentInfo,
|
||||||
downloader: str = None,
|
downloader: str = None,
|
||||||
|
save_path: str = None,
|
||||||
current_user: User = Depends(get_current_active_user)) -> Any:
|
current_user: User = Depends(get_current_active_user)) -> Any:
|
||||||
"""
|
"""
|
||||||
添加下载任务(不含媒体信息)
|
添加下载任务(不含媒体信息)
|
||||||
@@ -78,7 +81,8 @@ def add(
|
|||||||
media_info=mediainfo,
|
media_info=mediainfo,
|
||||||
torrent_info=torrentinfo
|
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:
|
if not did:
|
||||||
return schemas.Response(success=False, message="任务添加失败")
|
return schemas.Response(success=False, message="任务添加失败")
|
||||||
return schemas.Response(success=True, data={
|
return schemas.Response(success=True, data={
|
||||||
|
|||||||
Reference in New Issue
Block a user