From d52cbd2f7443c4e6a25dd3887245d87d9f612464 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 10 Jul 2025 22:16:19 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=B5=84=E6=BA=90=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E4=BA=8B=E4=BB=B6=E4=BF=9D=E5=AD=98=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/download.py | 3 +++ app/schemas/event.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/chain/download.py b/app/chain/download.py index 697dc3a8..adee5b90 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -188,6 +188,9 @@ class DownloadChain(ChainBase): f"Resource download canceled by event: {event_data.source}," f"Reason: {event_data.reason}") return None + # 如果事件修改了下载路径,使用新路径 + if event_data.options and event_data.options.get("save_path"): + save_path = event_data.options.get("save_path") # 补充完整的media数据 if not _media.genre_ids: diff --git a/app/schemas/event.py b/app/schemas/event.py index a880f826..7fe3fddc 100644 --- a/app/schemas/event.py +++ b/app/schemas/event.py @@ -214,7 +214,7 @@ class ResourceDownloadEventData(ChainEventData): channel: Optional[MessageChannel] = Field(None, description="通知渠道") origin: Optional[str] = Field(None, description="来源") downloader: Optional[str] = Field(None, description="下载器") - options: Optional[dict] = Field(None, description="其他参数") + options: Optional[dict] = Field(default={}, description="其他参数") # 输出参数 cancel: bool = Field(default=False, description="是否取消下载")