diff --git a/app/chain/download.py b/app/chain/download.py index b427c5db..599b3189 100644 --- a/app/chain/download.py +++ b/app/chain/download.py @@ -301,8 +301,8 @@ class DownloadChain(ChainBase): if files_to_add: self.downloadhis.add_files(files_to_add) - # 发送消息 - self.post_download_message(meta=_meta, mediainfo=_media, torrent=_torrent, channel=channel, userid=userid) + # 发送消息(群发,不带channel和userid) + self.post_download_message(meta=_meta, mediainfo=_media, torrent=_torrent) # 下载成功后处理 self.download_added(context=context, download_dir=download_dir, torrent_path=torrent_file) # 广播事件 @@ -823,6 +823,7 @@ class DownloadChain(ChainBase): } # 下载用户 torrent.userid = history.userid + torrent.username = history.username ret_torrents.append(torrent) return ret_torrents diff --git a/app/chain/message.py b/app/chain/message.py index bf410f96..28a346d6 100644 --- a/app/chain/message.py +++ b/app/chain/message.py @@ -275,7 +275,8 @@ class MessageChain(ChainBase): # 下载种子 context: Context = cache_list[_choice] # 下载 - self.downloadchain.download_single(context, userid=userid, channel=channel, username=username) + self.downloadchain.download_single(context, channel=channel, + userid=userid, username=username) elif text.lower() == "p": # 上一页 diff --git a/app/schemas/transfer.py b/app/schemas/transfer.py index 740e2ad8..370636d7 100644 --- a/app/schemas/transfer.py +++ b/app/schemas/transfer.py @@ -31,6 +31,7 @@ class DownloadingTorrent(BaseModel): dlspeed: Optional[str] = None media: Optional[dict] = {} userid: Optional[str] = None + username: Optional[str] = None left_time: Optional[str] = None