feat:资源下载事件保存路径

This commit is contained in:
jxxghp
2025-07-10 22:16:19 +08:00
parent 8d0003db94
commit d52cbd2f74
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -188,6 +188,9 @@ class DownloadChain(ChainBase):
f"Resource download canceled by event: {event_data.source}," f"Resource download canceled by event: {event_data.source},"
f"Reason: {event_data.reason}") f"Reason: {event_data.reason}")
return None return None
# 如果事件修改了下载路径,使用新路径
if event_data.options and event_data.options.get("save_path"):
save_path = event_data.options.get("save_path")
# 补充完整的media数据 # 补充完整的media数据
if not _media.genre_ids: if not _media.genre_ids:
+1 -1
View File
@@ -214,7 +214,7 @@ class ResourceDownloadEventData(ChainEventData):
channel: Optional[MessageChannel] = Field(None, description="通知渠道") channel: Optional[MessageChannel] = Field(None, description="通知渠道")
origin: Optional[str] = Field(None, description="来源") origin: Optional[str] = Field(None, description="来源")
downloader: 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="是否取消下载") cancel: bool = Field(default=False, description="是否取消下载")